From 7aee06e816ed9b623274916c3dd1d9f3135b513d Mon Sep 17 00:00:00 2001 From: Abhishek Date: Thu, 26 Oct 2023 18:56:17 +0530 Subject: [PATCH 01/10] Added docstring for print_parameter_info method --- pybamm/models/base_model.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pybamm/models/base_model.py b/pybamm/models/base_model.py index 41192dbe1f..985d0b4568 100644 --- a/pybamm/models/base_model.py +++ b/pybamm/models/base_model.py @@ -365,6 +365,9 @@ def input_parameters(self): return self._input_parameters def print_parameter_info(self): + """ + Returns parameters used in the model + """ self._parameter_info = "" parameters = self._find_symbols(pybamm.Parameter) for param in parameters: From be87f8184555b09d87147493323d886423e357d3 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Thu, 26 Oct 2023 19:10:49 +0530 Subject: [PATCH 02/10] PEP8 adherence for One-line docstring --- pybamm/models/base_model.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pybamm/models/base_model.py b/pybamm/models/base_model.py index 985d0b4568..48b8097dc7 100644 --- a/pybamm/models/base_model.py +++ b/pybamm/models/base_model.py @@ -365,9 +365,7 @@ def input_parameters(self): return self._input_parameters def print_parameter_info(self): - """ - Returns parameters used in the model - """ + """Returns parameters used in the model""" self._parameter_info = "" parameters = self._find_symbols(pybamm.Parameter) for param in parameters: From 3c59897a3ef85e0753997dbb7cc9d3e1c1814835 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 27 Oct 2023 13:07:32 +0530 Subject: [PATCH 03/10] Mentioned that arrays can be passed as values for drive cycles. --- pybamm/step/_steps_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybamm/step/_steps_util.py b/pybamm/step/_steps_util.py index e524bc6064..eaa9c64636 100644 --- a/pybamm/step/_steps_util.py +++ b/pybamm/step/_steps_util.py @@ -37,7 +37,7 @@ class _Step: or "resistance". value : float The value of the step, corresponding to the type of step. Can be a number, a - 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) + 2-tuple (for cccv_ode), or a 2-column array. Can pass list as argument (for drive cycles) duration : float, optional The duration of the step in seconds. termination : str or list, optional From 9e829903f86c3af0f35b4a362bb86ddcfaf1e712 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Wed, 29 Nov 2023 13:18:57 +0530 Subject: [PATCH 04/10] reverted changes from 3c59897a3ef85e0753997dbb7cc9d3e1c1814835 --- pybamm/step/_steps_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybamm/step/_steps_util.py b/pybamm/step/_steps_util.py index eaa9c64636..e524bc6064 100644 --- a/pybamm/step/_steps_util.py +++ b/pybamm/step/_steps_util.py @@ -37,7 +37,7 @@ class _Step: or "resistance". value : float The value of the step, corresponding to the type of step. Can be a number, a - 2-tuple (for cccv_ode), or a 2-column array. Can pass list as argument (for drive cycles) + 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) duration : float, optional The duration of the step in seconds. termination : str or list, optional From 7c5995f1b6a42aa54bc5203ffcdd10a06fdd668f Mon Sep 17 00:00:00 2001 From: Abhishek Date: Wed, 29 Nov 2023 17:56:38 +0530 Subject: [PATCH 05/10] value can be a 2-column array added in steps.py --- pybamm/step/steps.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pybamm/step/steps.py b/pybamm/step/steps.py index 0b8123ddb0..4852131eff 100644 --- a/pybamm/step/steps.py +++ b/pybamm/step/steps.py @@ -120,7 +120,8 @@ def current(value, **kwargs): Parameters ---------- value : float - The current value in A. + The current value in A. + Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. @@ -142,6 +143,7 @@ def c_rate(value, **kwargs): ---------- value : float The C-rate value. + Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. @@ -163,6 +165,7 @@ def voltage(value, **kwargs): ---------- value : float The voltage value in V. + Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. @@ -184,6 +187,7 @@ def power(value, **kwargs): ---------- value : float The power value in W. + Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. @@ -205,6 +209,7 @@ def resistance(value, **kwargs): ---------- value : float The resistance value in Ohm. + Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. From 53efe92d2622841f88bdd3b24e637ab5ed4fa1ed Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:29:36 +0000 Subject: [PATCH 06/10] style: pre-commit fixes --- pybamm/step/steps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybamm/step/steps.py b/pybamm/step/steps.py index 4852131eff..1765d68085 100644 --- a/pybamm/step/steps.py +++ b/pybamm/step/steps.py @@ -120,7 +120,7 @@ def current(value, **kwargs): Parameters ---------- value : float - The current value in A. + The current value in A. Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` From efba2e0922b4006b3dcbd2c628d759684a1fe5a0 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Tue, 5 Dec 2023 16:13:40 +0530 Subject: [PATCH 07/10] removed cccv_ode --- pybamm/step/steps.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pybamm/step/steps.py b/pybamm/step/steps.py index 1765d68085..1f642864f7 100644 --- a/pybamm/step/steps.py +++ b/pybamm/step/steps.py @@ -120,7 +120,7 @@ def current(value, **kwargs): Parameters ---------- value : float - The current value in A. + The current value in A. Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` @@ -142,8 +142,7 @@ def c_rate(value, **kwargs): Parameters ---------- value : float - The C-rate value. - Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) + The C-rate value. It can be a number or a 2-column array (for drive cycles). **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. @@ -164,8 +163,7 @@ def voltage(value, **kwargs): Parameters ---------- value : float - The voltage value in V. - Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) + The voltage value in V. It can be a number or a 2-column array (for drive cycles). **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. @@ -186,8 +184,7 @@ def power(value, **kwargs): Parameters ---------- value : float - The power value in W. - Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) + The power value in W. It can be a number or a 2-column array (for drive cycles). **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. @@ -208,8 +205,7 @@ def resistance(value, **kwargs): Parameters ---------- value : float - The resistance value in Ohm. - Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) + The resistance value in Ohm. It can be a number or a 2-column array (for drive cycles). **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. From 6b6ad0d60479794134108aff31fc6fe7c19054d1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 10:58:11 +0000 Subject: [PATCH 08/10] style: pre-commit fixes --- pybamm/step/steps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybamm/step/steps.py b/pybamm/step/steps.py index 1f642864f7..89b36b7895 100644 --- a/pybamm/step/steps.py +++ b/pybamm/step/steps.py @@ -120,7 +120,7 @@ def current(value, **kwargs): Parameters ---------- value : float - The current value in A. + The current value in A. Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` From 0aa035800ae23b69d0a7aedadb4cc9df5cadc427 Mon Sep 17 00:00:00 2001 From: Abhishek Chaudhari <91185083+AbhishekChaudharii@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:36:22 +0530 Subject: [PATCH 09/10] removed cccv_ode - fix --- pybamm/step/steps.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pybamm/step/steps.py b/pybamm/step/steps.py index 89b36b7895..2f2e9e31a4 100644 --- a/pybamm/step/steps.py +++ b/pybamm/step/steps.py @@ -120,8 +120,7 @@ def current(value, **kwargs): Parameters ---------- value : float - The current value in A. - Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles) + The current value in A. It can be a number or a 2-column array (for drive cycles). **kwargs Any other keyword arguments are passed to the :class:`pybamm.step._Step` class. From d5106c77299c03853d84dde65268cf8f9e9df20a Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 8 Dec 2023 12:58:10 +0530 Subject: [PATCH 10/10] Added documentation for filename argrument in simulation.py --- pybamm/simulation.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pybamm/simulation.py b/pybamm/simulation.py index bf418f068d..46ef3f330d 100644 --- a/pybamm/simulation.py +++ b/pybamm/simulation.py @@ -1166,7 +1166,13 @@ def solution(self): return self._solution def save(self, filename): - """Save simulation using pickle""" + """Save simulation using pickle module. + + Parameters + ---------- + filename : str + The file extension can be arbitrary, but it is common to use ".pkl" or ".pickle" + """ if self._model.convert_to_format == "python": # We currently cannot save models in the 'python' format raise NotImplementedError(