biosustain / Maud

Enzyme models that take into account kinetics, allostery and thermodynamics
https://maud-metabolic-models.readthedocs.io/en/latest/
GNU General Public License v3.0
26 stars 2 forks source link

Better errors for generated inits #392

Open carrascomj opened 2 years ago

carrascomj commented 2 years ago

Description

In the user_generated_inits file, if there is a row specifying conc_unbalanced parameters for balanced metabolites, maud will spit a wall of Stan errors:

...
Exception: ode_bdf_tol: ode parameters and data[14] is nan, but must be finite! (in '/home/georg/git/maud.git/master/src/maud/stan/model.stan', line 156, column 4 to line 203, column 39)
Exception: ode_bdf_tol: ode parameters and data[14] is nan, but must be finite! (in '/home/georg/git/maud.git/master/src/maud/stan/model.stan', line 156, column 4 to line 203, column 39)
Exception: ode_bdf_tol: ode parameters and data[14] is nan, but must be finite! (in '/home/georg/git/maud.git/master/src/maud/stan/model.stan', line 156, column 4 to line 203, column 39)
...

This can happen if/when the user changes a metabolite from unbalanced to balanced and forgets about the inits file.

Desired behavior

Some very light validation for the generated inits would be great to enhance UX.

teddygroves commented 2 years ago

yes this is definitely necessary, I get errors like that to do with inits all the time