Skip to content

Commit

Permalink
Merge pull request #368 from nanglo123/fix_sbml_amr_export
Browse files Browse the repository at this point in the history
Fix sbml amr export
  • Loading branch information
bgyori committed Sep 23, 2024
2 parents 15708a9 + cc9fb51 commit 23da16b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mira/modeling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def make_model(self):
self.template_model.initials)
for participant in template.left
)
consumed_key = tuple(c.key for c in consumed)
else:
consumed, consumed_key = tuple(), None

Expand Down Expand Up @@ -333,6 +334,7 @@ def make_model(self):
self.template_model.initials)
for participant in template.right
)
produced_key = tuple(p.key for p in produced)
elif not is_replication(template):
produced, produced_key = tuple(), None

Expand Down
14 changes: 14 additions & 0 deletions tests/test_metamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,17 @@ def test_initial_expression_float():
init = Initial(concept=Concept(name='x'), expression=1)
assert isinstance(init.expression, SympyExprStr)
assert isinstance(init.expression.args[0], sympy.Expr)


def test_reversible_flux():
from mira.modeling import Model
from mira.modeling.amr.petrinet import template_model_to_petrinet_json
t = ReversibleFlux(
left=[Concept(name='x')],
right=[Concept(name='y')],
)
# Make sure we can export to AMR
tm = TemplateModel(templates=[t])
model = Model(tm)
amr = template_model_to_petrinet_json(tm)

0 comments on commit 23da16b

Please sign in to comment.