KarrLab / wc_sim

A multi-algorithmic simulator for whole-cell models
MIT License
6 stars 2 forks source link

Consider merging `wc_sim.multialgorithm.dynamic_expressions.DynamicExpression.prepare` with expression parsing in `obj_model.expression` #43

Closed jonrkarr closed 4 years ago

jonrkarr commented 5 years ago

There's currently a good amount of redundancy between wc_sim.multialgorithm.dynamic_expressions.DynamicExpression.prepare and wc_sim.multialgorithm.dynamic_expressions.DynamicExpression.eval and obj_model.expression.

Also, wc_sim.multialgorithm.submodels.dynamic_submodel.DynamicSubmodel.calc_reaction_rates already uses obj_model for evaluation. This should be implemented more consistently with the eval methods for dynamic observables, functions, stop conditions, etc.

artgoldberg commented 5 years ago

Also, enhance testing coverage of dynamic_expressions.py

artgoldberg commented 4 years ago

Enhanced coverage of dynamic_expressions.py

artgoldberg commented 4 years ago

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.

artgoldberg commented 4 years ago

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.