Skip to content

Commit fa34d69

Browse files
committed
,.
1 parent f1b6f0c commit fa34d69

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

petab/v2/converters.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,34 @@ def _preprocess(self):
103103
if self._max_event_priority is not None
104104
else None
105105
)
106-
# Check for undefined event priorities and warn
106+
107107
for event in model.getListOfEvents():
108+
# Check for undefined event priorities and warn
108109
if (prio := event.getPriority()) and prio.getMath() is None:
109110
warnings.warn(
110111
f"Event `{event.getId()}` has no priority set. "
111112
"Make sure that this event cannot trigger at the time of "
112-
"PEtab condition change, otherwise the behavior is "
113+
"a PEtab condition change, otherwise the behavior is "
113114
"undefined.",
114115
stacklevel=1,
115116
)
116117

118+
# Check for useValuesFromTrigger time
119+
if event.getUseValuesFromTriggerTime():
120+
# Non-PEtab-condition-change events must be executed *after*
121+
# PEtab condition changes have been applied, based on the
122+
# updated model state. This would be violated by
123+
# useValuesFromTriggerTime=true.
124+
warnings.warn(
125+
f"Event `{event.getId()}` has "
126+
"`useValuesFromTriggerTime=true'. "
127+
"Make sure that this event cannot trigger at the time of "
128+
"a PEtab condition change, or consider changing "
129+
"`useValuesFromTriggerTime' to `false'. Otherwise "
130+
"simulation results may be incorrect.",
131+
stacklevel=1,
132+
)
133+
117134
def convert(self) -> Problem:
118135
"""Convert the PEtab experiments to SBML events.
119136

0 commit comments

Comments
 (0)