From 02b3a38fb7f018ee3f9e22f7a01ac0fc43371d92 Mon Sep 17 00:00:00 2001 From: Jon Chapman Date: Mon, 15 Jan 2024 16:50:44 +0000 Subject: [PATCH 1/2] Fixed issue #3724 Documentation added for pybamm.Experiment.read_termination --- pybamm/experiment/experiment.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pybamm/experiment/experiment.py b/pybamm/experiment/experiment.py index b04281d78d..d516a3f023 100644 --- a/pybamm/experiment/experiment.py +++ b/pybamm/experiment/experiment.py @@ -141,6 +141,21 @@ def __repr__(self): def read_termination(self, termination): """ Read the termination reason. If this condition is hit, the experiment will stop. + + Parameters + ---------- + termination : list[str], optional + A single string, or a list of strings, representing the conditions to terminate the experiment. + Only capacity or voltage can be provided as a termination reason. + e.g. '4 Ah capacity' or ['80% capacity', '2.5 V'] + + Returns + ------- + dict + A dictionary of the termination conditions. + e.g. {'capacity': (4.0, 'Ah')} or + {'capacity': (80.0, '%'), 'voltage': (2.5, 'V')} + """ if termination is None: return {} From 23492445da85dc2d6dddd354fb3081330db1966e Mon Sep 17 00:00:00 2001 From: Jon Chapman Date: Wed, 17 Jan 2024 12:54:38 +0000 Subject: [PATCH 2/2] Issue #3724 Updated the documentation based on the discussion so that the argument passed to read_termination is of type str or list[str] --- pybamm/experiment/experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybamm/experiment/experiment.py b/pybamm/experiment/experiment.py index d516a3f023..792483e324 100644 --- a/pybamm/experiment/experiment.py +++ b/pybamm/experiment/experiment.py @@ -144,7 +144,7 @@ def read_termination(self, termination): Parameters ---------- - termination : list[str], optional + termination : str or list[str], optional A single string, or a list of strings, representing the conditions to terminate the experiment. Only capacity or voltage can be provided as a termination reason. e.g. '4 Ah capacity' or ['80% capacity', '2.5 V']