Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add units to model parameters, expressions, species #571

Open
ortega2247 opened this issue Jan 4, 2023 · 2 comments
Open

Add units to model parameters, expressions, species #571

ortega2247 opened this issue Jan 4, 2023 · 2 comments

Comments

@ortega2247
Copy link
Contributor

Hi, mistakes in units can lead to unexpected simulation results and some times hard to interpret results. Dimensional errors happen quite often. Would it be too hard to add dimensional analysis to pysb? I have been thinking we could add a unit argument (sympy has units) to parameter, expression objects, species and evaluate if the reaction rates have the desired units. Is something like this feasible?

@lh64
Copy link
Contributor

lh64 commented Jan 18, 2023

I think this is a good idea. Could we add a 'units' attribute to the 'Parameter' class? If we did, it should be possible to write a script that confirms that all units in a model are consistent. I'm not sure if we'd need to add a 'units' attribute to the 'Expression' class as well, or if units could be automatically derived for expressions based on parameter units. Something to think about, though.

@FFroehlich
Copy link
Contributor

Agree that this would be interesting.

I think it should be possible to infer units for all model components from Monomer, time and parameter units for most models. Units for expressions could be necessary for some models, but that could also always be addressed by converting some factor in the expression to a parameter. Yet, it would be nice to make specification of units for expressions, observables, etc optional and only check consistency when units can be inferred from constituent symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants