diff --git a/src/common/io.py b/src/common/io.py index 7b20c208..9e91ace0 100644 --- a/src/common/io.py +++ b/src/common/io.py @@ -1642,11 +1642,7 @@ def _find_max_trajectory_length(self, trajectories): among the set of continuous variables. We disregard parameters/constants since they are not stored with the same amount of data points as trajectories for continuous variables. """ - length = 0 - for var_name, trajectory in trajectories.items(): - if self.is_variable(var_name): # since we only consider continuous variables - length = max(length, len(trajectory.x)) - return length + return max([0] + [len(t.x) for v, t in trajectories.items() if self.is_variable(v)]) def _calculate_events_and_steps(self, name): if name in self._data_3: