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 a method to check units in a model #56

Merged
merged 8 commits into from
Jun 18, 2019
Merged

Conversation

kaizu
Copy link
Member

@kaizu kaizu commented Jun 16, 2019

pint is required.

from ecell4 import *
from ecell4_base.core import Quantity_Integer, Quantity_Real

with species_attributes():
    A | B | C | {}
    D | {'location': 'M'}
    M | {'dimension': 2, 'structure': True}
    
with reaction_rules():
    A + B > C | Quantity_Real(0.01, 'um**3/item/s')
    A + M > D | Quantity_Real(1.0, 'um/s')
    A > B | Quantity_Real(1.0, 'item/s') * A / (Quantity_Integer(120, 'item') + A)

m = get_model()

from ecell4.extra.unit_checker import check_units
check_units(m)  # Nothing would occur

@kaizu kaizu self-assigned this Jun 16, 2019
@kozo2 kozo2 merged commit 15202d1 into ecell:master Jun 18, 2019
@kaizu kaizu deleted the units_checker branch May 11, 2020 01:53
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

Successfully merging this pull request may close these issues.

2 participants