Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
FFroehlich committed Jan 31, 2025
1 parent 32782a5 commit e1b5bc4
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions python/sdist/amici/sbml_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -1985,29 +1985,37 @@ def _process_observables(
self.symbols[SymbolId.OBSERVABLE], "eventObservable"
)

noise_pars = list(
{
name
for sigma in sigmas.values()
for symbol in sp.sympify(sigma).free_symbols
if re.match(r"noiseParameter\d+$", (name := str(symbol)))
}
)
if sigmas:
noise_pars = list(
{
name
for sigma in sigmas.values()
for symbol in sp.sympify(sigma).free_symbols
if re.match(r"noiseParameter\d+$", (name := str(symbol)))
}
)
else:
noise_pars = []
self.symbols[SymbolId.NOISE_PARAMETER] = {
symbol_with_assumptions(np): {"name": np}
for np in sorted(
noise_pars, key=lambda x: int(x.replace("noiseParameter", ""))
)
}

observable_pars = list(
{
name
for obs in observables.values()
for symbol in sp.sympify(obs["formula"]).free_symbols
if re.match(r"observableParameter\d+$", (name := str(symbol)))
}
)
if observables:
observable_pars = list(
{
name
for obs in observables.values()
for symbol in sp.sympify(obs["formula"]).free_symbols
if re.match(
r"observableParameter\d+$", (name := str(symbol))
)
}
)
else:
observable_pars = []

Check warning on line 2018 in python/sdist/amici/sbml_import.py

View check run for this annotation

Codecov / codecov/patch

python/sdist/amici/sbml_import.py#L2018

Added line #L2018 was not covered by tests
self.symbols[SymbolId.OBSERVABLE_PARAMETER] = {
symbol_with_assumptions(op): {"name": op}
for op in sorted(
Expand Down

0 comments on commit e1b5bc4

Please sign in to comment.