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

Fix sympy DeprecationWarning #2131

Merged
merged 3 commits into from
Jun 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion python/sdist/amici/sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import libsbml as sbml
import numpy as np
import sympy as sp
from sympy.logic.boolalg import BooleanFalse, BooleanTrue

from . import has_clibs
from .constants import SymbolId
Expand Down Expand Up @@ -1047,7 +1048,12 @@ def _process_reactions(self):
reaction.getKineticLaw() or sp.Float(0)
)

self.flux_vector[reaction_index] = sym_math
self.flux_vector[reaction_index] = sym_math.subs(
{
BooleanTrue(): sp.Float(1.0),
BooleanFalse(): sp.Float(0.0),
}
)
if any(
str(symbol) in reaction_ids
for symbol in self.flux_vector[reaction_index].free_symbols
Expand Down