id summary reporter owner description type status priority milestone component version severity resolution keywords cc 250 Extend set_quantity to allow addition of values ole ole "Sometimes, there is a need for adding values to a quantity - e.g. to put buildings on top of a landscape. Polygon_function is often used for defining the buildings, but there is currently no mechanism for adding them. I suggest allowing a new boolean keyword, addition, in set_quantity so that one can say: {{{ set_quantity('elevation', elevation_data set_quantity('elevation', building_data, addition=True) }}} It would be easy to implement using the overloading of '+' already present in class Quantity. I suggest something like this if addition is True: {{{ def set_quantity(quantity_name, x, addition=False): ... if addition is True: Q1 = domain.get_quantity(quantity_name) Q2 = Quantity(domain) # Create new temporary quantity Q2.set_values(x) domain.set_quantity(quantity_name, Q1+Q2, addition=False) or domain.quantities[quantity_name] += Q2 }}} Alternatively, we could make this behaviour the default as quantities are initialised as zero, and have a keyword 'replace'. On the other hand, this could be confusing whenever a code needs to change a quantity. " enhancement closed normal Architecture and API normal fixed