Closed jonrkarr closed 4 years ago
Also, enhance testing coverage of dynamic_expressions.py
Enhanced coverage of dynamic_expressions.py
Actually, wc_sim.multialgorithm.dynamic_expressions.DynamicExpression.prepare
and wc_sim.multialgorithm.dynamic_expressions.DynamicExpression.eval
are not redundant with obj_model.expression
.
obj_model.expression
is concerned with parsing, validating and testing expressions provided as strings, while the DynamicExpression
methods use the output of obj_model.expression
to create expressions that reference dynamic objects. The DynamicExpression
methods also include some optimizations to speed up run-time evaluation of expressions in simulations.
Completed implementation of DynamicRateLaw
which is consistent with the eval methods for dynamic observables, functions, stop conditions, etc., and is used by DynamicSubmodel.calc_reaction_rate
.
There's currently a good amount of redundancy between
wc_sim.multialgorithm.dynamic_expressions.DynamicExpression.prepare
andwc_sim.multialgorithm.dynamic_expressions.DynamicExpression.eval
andobj_model.expression
.Also,
wc_sim.multialgorithm.submodels.dynamic_submodel.DynamicSubmodel.calc_reaction_rates
already usesobj_model
for evaluation. This should be implemented more consistently with the eval methods for dynamic observables, functions, stop conditions, etc.