Skip to content

Commit

Permalink
pybamm-team#3130 use model.y_slices rather than var.y_slice
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Sep 7, 2023
1 parent 8c39199 commit a05a461
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pybamm/solvers/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ def check_ys_are_not_too_large(self):
y = y[:, -1]
if np.any(y > pybamm.settings.max_y_value):
for var in [*model.rhs.keys(), *model.algebraic.keys()]:
y_var = y[model.variables[var.name].y_slices[0]]
first_index = model.y_slices[var][0]
y_var = y[first_index]
if np.any(y_var > pybamm.settings.max_y_value):
pybamm.logger.error(
f"Solution for '{var}' exceeds the maximum allowed value "
Expand Down

0 comments on commit a05a461

Please sign in to comment.