Ignore:
Timestamp:
Oct 14, 2005, 11:26:21 AM (19 years ago)
Author:
ole
Message:

Implemented arbitrary expressions for sww2dem using code from changeset:1916

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/domain.py

    r1916 r1919  
    745745    """
    746746
    747     #Replace quantity names with actual quantities
    748     quantities = domain.quantities
    749     for quantity_name in quantities.keys():
    750         expression = expression.replace(quantity_name,
    751                                         'quantities["%s"]' %quantity_name)
    752 
    753     #Evaluate and return
    754     return eval(expression)   
     747    from util import apply_expression_to_dictionary
     748    return apply_expression_to_dictionary(expression, domain.quantities)
    755749   
    756750
Note: See TracChangeset for help on using the changeset viewer.