Skip to content

Commit

Permalink
Merge branch 'develop' into swigptr_props
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Dec 18, 2023
2 parents 4bd8c80 + a3b1c2b commit 19f39fc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions python/sdist/amici/de_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -2232,6 +2232,23 @@ def _compute_equation(self, name: str) -> None:
else:
raise ValueError(f"Unknown equation {name}")

if name in ("sigmay", "sigmaz"):
# check for states in sigma{y,z}, which is currently not supported
syms_x = self.sym("x")
syms_yz = self.sym(name.removeprefix("sigma"))
xs_in_sigma = {}
for sym_yz, eq_yz in zip(syms_yz, self._eqs[name]):
yz_free_syms = eq_yz.free_symbols
if tmp := {x for x in syms_x if x in yz_free_syms}:
xs_in_sigma[sym_yz] = tmp
if xs_in_sigma:
msg = ", ".join(
[f"{yz} depends on {xs}" for yz, xs in xs_in_sigma.items()]
)
raise NotImplementedError(
f"State-dependent observables are not supported, but {msg}."
)

if name == "root":
# Events are processed after the model has been set up.
# Equations are there, but symbols for roots must be added
Expand Down

0 comments on commit 19f39fc

Please sign in to comment.