Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Feb 24, 2024
1 parent fb23dba commit d8cc28d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions python/sdist/amici/de_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -1650,10 +1650,8 @@ def static_indices(self, name: str) -> list[int]:
"""
Returns the indices of static expressions in the given model entity.
Static expressions are those that:
* do not depend on time, directly or indirectly
* do not depend on state variables, directly or indirectly
Static expressions are those that do not depend on time,
neither directly nor indirectly.
:param name: Name of the model entity.
:return: List of indices of static expressions.
Expand Down Expand Up @@ -4378,7 +4376,7 @@ def get_model_override_implementation(
body = (
""
if nobody
else "\n{ind8}{maybe_return}{fun}_{name}({eval_signature});{ind4}\n".format(
else "\n{ind8}{maybe_return}{fun}_{name}({eval_signature});\n{ind4}".format(
ind4=" " * 4,
ind8=" " * 8,
maybe_return="" if func_info.return_type == "void" else "return ",
Expand Down Expand Up @@ -4425,7 +4423,9 @@ def get_sunindex_override_implementation(
if nobody:
impl += "}}\n"
else:
impl += "{ind8}{fun}_{indextype}_{name}({eval_signature});\n{ind4}}}\n"
impl += (
"\n{ind8}{fun}_{indextype}_{name}({eval_signature});\n{ind4}}}\n"
)

return impl.format(
ind4=" " * 4,
Expand Down
4 changes: 3 additions & 1 deletion src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ void Model::initialize(
// evaluate static expressions once
// (w and dwdw will be evaluated from within dwdp/dwdx)
fdwdx(t0(), x.data(), true);
fdwdp(t0(), x.data(), true);
if(computeSensitivities) {
fdwdp(t0(), x.data(), true);
}
}

void Model::reinitialize(
Expand Down

0 comments on commit d8cc28d

Please sign in to comment.