@@ -103,17 +103,34 @@ def _preprocess(self):
103
103
if self ._max_event_priority is not None
104
104
else None
105
105
)
106
- # Check for undefined event priorities and warn
106
+
107
107
for event in model .getListOfEvents ():
108
+ # Check for undefined event priorities and warn
108
109
if (prio := event .getPriority ()) and prio .getMath () is None :
109
110
warnings .warn (
110
111
f"Event `{ event .getId ()} ` has no priority set. "
111
112
"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 "
113
114
"undefined." ,
114
115
stacklevel = 1 ,
115
116
)
116
117
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
+
117
134
def convert (self ) -> Problem :
118
135
"""Convert the PEtab experiments to SBML events.
119
136
0 commit comments