Skip to content

Commit

Permalink
Merge branch 'fix_pysb_import' into release_0.10.16
Browse files Browse the repository at this point in the history
  • Loading branch information
FFroehlich committed Dec 10, 2019
2 parents aafbf52 + 18572d7 commit 96cb13e
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions python/amici/pysb_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ def _process_pysb_expressions(model, ODE, observables, sigmas):
"""
for exp in model.expressions:
ODE.add_component(
Expression(
exp,
f'{exp.name}',
exp.expand_expr(expand_observables=True))
)
if exp.name in observables:
# here we do not define a new Expression from the
# pysb.Expression but define an observable, so we do not need
Expand All @@ -244,7 +250,8 @@ def _process_pysb_expressions(model, ODE, observables, sigmas):
Observable(
y,
f'{exp.name}',
exp.expand_expr(expand_observables=False))
exp
)
)

sigma_name, sigma_value = _get_sigma_name_and_value(
Expand Down Expand Up @@ -273,16 +280,6 @@ def _process_pysb_expressions(model, ODE, observables, sigmas):
elif exp.name in sigmas.values():
# do nothing
pass
else:
# here we do define a new Expression from the pysb.Expression
# so we do need to expand observables as these would otherwise
# lead to dependencies between different Expressions
ODE.add_component(
Expression(
exp,
f'{exp.name}',
exp.expand_expr(expand_observables=True))
)


def _get_sigma_name_and_value(model, name, sigmas):
Expand Down

0 comments on commit 96cb13e

Please sign in to comment.