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

Resolve underdetermined SBML export #420

Merged
merged 5 commits into from Mar 5, 2019
Prev

specify initialAmount for species without InitialAssignments

  • Loading branch information...
FFroehlich committed Feb 25, 2019
commit 9104f58e36c604e65ac9179f0a060e068639e54f
@@ -170,13 +170,15 @@ def convert(self, level=(3, 2)):

# Initial values/assignments
fixed_species_idx = set()
initial_species_idx = set()
for ic in self.model.initials:
sp_idx = self.model.get_species_index(ic.pattern)
ia = smodel.createInitialAssignment()
_check(ia)
_check(ia.setSymbol('__s{}'.format(sp_idx)))
init_mathml = self._sympy_to_sbmlast(Symbol(ic.value.name))
_check(ia.setMath(init_mathml))
initial_species_idx.add(sp_idx)

if ic.fixed:
fixed_species_idx.add(sp_idx)
@@ -207,6 +209,9 @@ def convert(self, level=(3, 2)):
_check(sp.setBoundaryCondition(i in fixed_species_idx))
_check(sp.setConstant(False))
_check(sp.setHasOnlySubstanceUnits(True))
if i not in initial_species_idx:
_check(sp.setInitialAmount(0.0))


# Parameters

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.