Changes between Version 1 and Version 2 of Ticket #250


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #250 – Description

    v1 v2  
    1313...
    1414if addition is True:
    15     #create new temporary quantity
    16     Q = Quantity(domain)
    17     Q.set_values(x)
     15    Q1 = domain.get_quantity(domain)
     16    Q2 = Quantity(domain) # Create new temporary quantity
     17    Q2.set_values(x)
     18    domain.set_quantity(quantity_name, Q1+Q2, addition=False)
    1819
    19     quantities[quantity_name] += Q
    20 
    21 
     20    or
     21    domain.quantities[quantity_name] += Q2
    2222
    2323Alternatively, we could make this behaviour the default as quantities are initialised as zero, and have a keyword 'replace'.