Skip to content

Commit

Permalink
do not call item if multiple log lengths in exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ahalev committed Jun 2, 2023
1 parent 52e3dd5 commit 66e002a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pymgrid/microgrid/microgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def get_log(self, as_frame=True, drop_singleton_key=False, drop_forecasts=False)
if 'Length of values' in e.args[0]:
module_log_lengths = pd.Series([len(log_dict) for log_dict in _log_dict.values()])

msg = f"Length of module log dicts ({module_log_lengths.unique().item()}) " \
msg = f"Length of module log dicts ({module_log_lengths.unique()}) " \
f"do not match self.current_step-initial_step ({self.current_step-initial_step}). " \
f"Did you set a trajectory attribute " \
f"('initial_step', 'final_step', 'trajectory_func') without calling Microgrid.reset()?"
Expand Down

0 comments on commit 66e002a

Please sign in to comment.