Skip to content

Commit 932a133

Browse files
Merge pull request #2613 from pybamm-team/termination-success
change success to final time
2 parents 8543525 + 938ff95 commit 932a133

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
- Steps in `Experiment` can now be tagged and cycle numbers be searched based on those tags ([#2593](https://github.com/pybamm-team/PyBaMM/pull/2593)).
66
- New `contact resistance` option, new parameter `Contact resistance [Ohm]` and new variable `Contact overpotential [V]` ([#2598](https://github.com/pybamm-team/PyBaMM/pull/2598)).
77

8+
## Bug fixes
9+
10+
- Changed termination from "success" to "final time" for algebraic solvers to match ODE/DAE solvers ([#2613](https://github.com/pybamm-team/PyBaMM/pull/2613)).
11+
812
# [v22.12](https://github.com/pybamm-team/PyBaMM/tree/v22.12) - 2022-12-31
913

1014
## Features

pybamm/solvers/algebraic_solver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ def jac_norm(y):
234234
y_diff = np.r_[[y0_diff] * len(t_eval)].T
235235
y_sol = np.r_[y_diff, y_alg]
236236
# Return solution object (no events, so pass None to t_event, y_event)
237-
sol = pybamm.Solution(t_eval, y_sol, model, inputs_dict, termination="success")
237+
sol = pybamm.Solution(
238+
t_eval, y_sol, model, inputs_dict, termination="final time"
239+
)
238240
sol.integration_time = integration_time
239241
return sol

pybamm/solvers/base_solver.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,8 +1302,6 @@ def get_termination_reason(self, solution, events):
13021302

13031303
pybamm.logger.debug("Finish post-processing events")
13041304
return solution, solution.termination
1305-
elif solution.termination == "success":
1306-
return solution, solution.termination
13071305

13081306
def check_extrapolation(self, solution, events):
13091307
"""

pybamm/solvers/casadi_algebraic_solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _integrate(self, model, t_eval, inputs_dict=None):
174174
y_sol,
175175
model,
176176
inputs_dict,
177-
termination="success",
177+
termination="final time",
178178
sensitivities=explicit_sensitivities,
179179
)
180180
sol.integration_time = integration_time

pybamm/solvers/solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def first_state(self):
383383
self.all_inputs[:1],
384384
None,
385385
None,
386-
"success",
386+
"final time",
387387
)
388388
new_sol._all_inputs_casadi = self.all_inputs_casadi[:1]
389389
new_sol._sub_solutions = self.sub_solutions[:1]

0 commit comments

Comments
 (0)