Changes between Initial Version and Version 1 of Ticket #250


Ignore:
Timestamp:
Feb 20, 2008, 6:25:48 AM (17 years ago)
Author:
ole
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #250 – Description

    initial v1  
    88
    99
     10It would be easy to implement using the overloading of '+' already present in class Quantity. I suggest something like this if addition is True:
     11
     12def set_quantity(quantity_name, x, addition=False):
     13...
     14if addition is True:
     15    #create new temporary quantity
     16    Q = Quantity(domain)
     17    Q.set_values(x)
     18
     19    quantities[quantity_name] += Q
     20
     21
     22
     23Alternatively, we could make this behaviour the default as quantities are initialised as zero, and have a keyword 'replace'.
     24On the other hand, this could be confusing whenever a code needs to change a quantity.
     25 
     26
     27
     28
    1029
    1130