Using undefined parameter in a symbolic rate expression (transitions) slips thru input checks and results in uninformative error
twallema opened this issue · 0 comments
twallema commented
Describe the bug
Very easily made mistake in large configs: I used a parameter I hadn't defined in a symbolic rate expression in the transition block of the config.
Uninformative error stack: doesn't point to real cause of mistake, makes it seem as if there is a mistake in the way the symbolic transitions are parsed. Made me worry Flepi couldn't parse symbolic "divide /" or underscores in parameter names, etc.
parse_parameters
(compartments.py)
--> parse_parameter_strings_to_numpy_arrays_v2
--> scimpy.lambdify()
-->scimpy._imp_namespace()
--> ERROR
To Reproduce
seir:
integration:
method: rk4
dt: 1.0
parameters:
gamma:
value: 0.2
transitions:
- source: ["S"]
destination: ["I"]
rate: ["beta"]
proportional_to: [[["S"],["I"]]]
proportion_exponent: ["1","1"]
- source: ["I"]
destination: ["R"]
rate: ["gamma"]
proportional_to: ["I"]
proportional_exponent: ["1"]
Very easy mistake to make.
Expected behavior
This not slipping thru the cracks by adding an appropriate input check.