Skip to content

Commit 568e98a

Browse files
committed
..
1 parent d8bc4f6 commit 568e98a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

petab/v2/converters.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,18 @@ def _convert_experiment(self, experiment: Experiment) -> None:
283283
target = model.getElementBySId(target_id)
284284
default = self._initial_value_from_element(target)
285285

286-
# combine all changes into a single piecewise expression
286+
# Only create the initial assignment if there is
287+
# actually something to change.
287288
if expr_cond_pairs := [
288289
(target_value, sp.Symbol(exp_ind) > 0.5)
289290
for exp_ind, target_value in changes
290291
if target_value != default
291292
]:
292-
# only create the initial assignment if there is
293-
# actually something to change
293+
# Unlike events, we can't have different initial
294+
# assignments for different experiments, so we need to
295+
# combine all changes into a single piecewise
296+
# expression.
297+
294298
expr = sp.Piecewise(
295299
*expr_cond_pairs,
296300
(default, True),

0 commit comments

Comments
 (0)