From 8b335890750a68b2c84ecfd9028c19b08ba01f5e Mon Sep 17 00:00:00 2001 From: "Eric G. Kratz" Date: Tue, 14 Jan 2025 13:56:19 -0500 Subject: [PATCH 01/14] Fix test workflow (#4754) --- .github/workflows/run_periodic_tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_periodic_tests.yml b/.github/workflows/run_periodic_tests.yml index 283d82f805..24bb48fbd5 100644 --- a/.github/workflows/run_periodic_tests.yml +++ b/.github/workflows/run_periodic_tests.yml @@ -36,7 +36,7 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo dot -c + sudo apt-get install gfortran gcc graphviz pandoc sudo apt-get install libopenblas-dev texlive-latex-extra dvipng - name: Install macOS system dependencies @@ -100,6 +100,7 @@ jobs: - name: Install Linux system dependencies run: | sudo apt-get update + sudo apt-get install graphviz pandoc sudo apt-get install texlive-latex-extra dvipng - name: Set up Python @@ -132,6 +133,7 @@ jobs: - name: Install Linux system dependencies run: | sudo apt-get update + sudo apt-get install gfortran gcc graphviz pandoc sudo apt-get install libopenblas-dev texlive-latex-extra dvipng - name: Set up Python 3.12 @@ -161,6 +163,7 @@ jobs: - name: Install Linux system dependencies run: | sudo apt-get update + sudo apt-get install gfortran gcc graphviz sudo apt-get install libopenblas-dev texlive-latex-extra dvipng - name: Set up Python 3.12 From 43802af74b28e093c075ef027b59b4d697c0d189 Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Wed, 15 Jan 2025 12:14:41 -0500 Subject: [PATCH 02/14] don't get esoh solver for any non-lithium-ion model --- src/pybamm/simulation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pybamm/simulation.py b/src/pybamm/simulation.py index 7bd1e5eea0..2635374579 100644 --- a/src/pybamm/simulation.py +++ b/src/pybamm/simulation.py @@ -1022,8 +1022,7 @@ def step( def _get_esoh_solver(self, calc_esoh): if ( calc_esoh is False - or isinstance(self._model, pybamm.lead_acid.BaseModel) - or isinstance(self._model, pybamm.equivalent_circuit.Thevenin) + or not isinstance(self._model, pybamm.lithium_ion.BaseModel) or self._model.options["working electrode"] != "both" ): return None From 04536fb04480638b3d0c95e72a4f032930f753bf Mon Sep 17 00:00:00 2001 From: "Eric G. Kratz" Date: Wed, 15 Jan 2025 12:33:25 -0500 Subject: [PATCH 03/14] Turn off validation benchmarks for develop (#4761) * Turn off validation benchmarks for develop * Add manual trigger --- .github/workflows/validation_benchmarks.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/validation_benchmarks.yml b/.github/workflows/validation_benchmarks.yml index 5b5d5fad21..8100171b83 100644 --- a/.github/workflows/validation_benchmarks.yml +++ b/.github/workflows/validation_benchmarks.yml @@ -1,11 +1,9 @@ name: Alert validation repository on: + workflow_dispatch: release: types: - published - push: - branches: - - develop jobs: build: From 1ac422a06edcee7e444a5a2f6b80e9c45055a035 Mon Sep 17 00:00:00 2001 From: Arjun Verma Date: Thu, 16 Jan 2025 00:03:25 +0530 Subject: [PATCH 04/14] Remove Update license workflow (#4760) --- .github/workflows/update_license.yml | 39 ---------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/workflows/update_license.yml diff --git a/.github/workflows/update_license.yml b/.github/workflows/update_license.yml deleted file mode 100644 index c426493ed6..0000000000 --- a/.github/workflows/update_license.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Update copyright year(s) - -on: - # Manual trigger - workflow_dispatch: - # Every January 1st at 3am GMT - schedule: - - cron: "0 3 1 1 *" - -jobs: - license: - # This workflow is only of value to PyBaMM and would always be skipped in forks - if: github.repository_owner == 'pybamm-team' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - name: Update year in license - uses: FantasticFiasco/action-update-license-year@9135da8f9ccc675217e02357c744b6b541d45cb0 # v3.0.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - path: LICENSE.txt - - docs: - # This workflow is only of value to PyBaMM and would always be skipped in forks - if: github.repository_owner == 'pybamm-team' - needs: license - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - - name: Update year in docs - uses: FantasticFiasco/action-update-license-year@9135da8f9ccc675217e02357c744b6b541d45cb0 # v3.0.2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - path: docs/conf.py - transform: (?<=copyright = ")(?\d{4})?-?(\d{4})? From 435b9e9730e6e24bda6ceff725ff82aa1e3ad1e3 Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Thu, 16 Jan 2025 14:37:23 -0500 Subject: [PATCH 05/14] exclude composite simulations from esoh calcs --- src/pybamm/simulation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pybamm/simulation.py b/src/pybamm/simulation.py index 2635374579..24ae029032 100644 --- a/src/pybamm/simulation.py +++ b/src/pybamm/simulation.py @@ -1023,6 +1023,7 @@ def _get_esoh_solver(self, calc_esoh): if ( calc_esoh is False or not isinstance(self._model, pybamm.lithium_ion.BaseModel) + or self._model.options["particle phases"] not in ["1", ("1", "1")] or self._model.options["working electrode"] != "both" ): return None From ef8571c0241d181d9cc2f701c2f5bf06fd8a4384 Mon Sep 17 00:00:00 2001 From: Alec Bills <48105066+aabills@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:23:09 -0800 Subject: [PATCH 06/14] fix ec reaction bug (#4774) fix bugs --- src/pybamm/models/submodels/interface/sei/sei_growth.py | 1 - src/pybamm/simulation.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybamm/models/submodels/interface/sei/sei_growth.py b/src/pybamm/models/submodels/interface/sei/sei_growth.py index e2b83a2b67..b4b6e3a0b7 100644 --- a/src/pybamm/models/submodels/interface/sei/sei_growth.py +++ b/src/pybamm/models/submodels/interface/sei/sei_growth.py @@ -186,7 +186,6 @@ def get_coupled_variables(self, variables): # j = -F * c_0* k_exp() / (1 + L * k_exp() / D) # c_ec = c_0 - L * k_exp() / D / (1 + L * k_exp() / D) # = c_0 / (1 + L * k_exp() / D) - eta_SEI = delta_phi k_exp = phase_param.k_sei * pybamm.exp(-alpha_SEI * F_RT * eta_SEI) L_over_D = L_sei / phase_param.D_ec c_0 = phase_param.c_ec_0 diff --git a/src/pybamm/simulation.py b/src/pybamm/simulation.py index 24ae029032..cf84755e77 100644 --- a/src/pybamm/simulation.py +++ b/src/pybamm/simulation.py @@ -895,7 +895,6 @@ def solve( logs["summary variables"] = cycle_sum_vars # Calculate capacity_start using the first cycle - capacity_stop = None if cycle_num == 1: # Note capacity_start could be defined as # self._parameter_values["Nominal cell capacity [A.h]"] instead @@ -907,6 +906,8 @@ def solve( capacity_stop = value elif typ == "%": capacity_stop = value / 100 * capacity_start + else: + capacity_stop = None logs["stopping conditions"]["capacity"] = capacity_stop logs["elapsed time"] = timer.time() From f55912212b3cb18d37c608028ef981e19b0b2786 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 19:39:04 +0000 Subject: [PATCH 07/14] Build(deps): bump docker/build-push-action in the actions group (#4777) Bumps the actions group with 1 update: [docker/build-push-action](https://github.com/docker/build-push-action). Updates `docker/build-push-action` from 6.11.0 to 6.12.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/b32b51a8eda65d6793cd0494a773d4f6bcef32dc...67a2d409c0a876cbe6b11854e3e25193efe4e62d) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5247295480..1d98043a92 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -30,7 +30,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push Docker image to Docker Hub - uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0 + uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0 with: context: . file: scripts/Dockerfile From 9338b4e8117f1f9c2b4611cff9c767a68e1ab7f3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 21:49:06 +0000 Subject: [PATCH 08/14] chore: update pre-commit hooks (#4778) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.1 → v0.9.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.1...v0.9.2) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 183c169027..7fee30f777 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.9.1" + rev: "v0.9.2" hooks: - id: ruff args: [--fix, --show-fixes] From 46757635074a06dfa714443e7f90dd2baa297ef0 Mon Sep 17 00:00:00 2001 From: Alec Bills <48105066+aabills@users.noreply.github.com> Date: Mon, 20 Jan 2025 14:47:23 -0800 Subject: [PATCH 09/14] add operator to experiment terminations (#4770) add operator to experiment terminations --- CHANGELOG.md | 3 + src/pybamm/experiment/step/__init__.py | 2 +- src/pybamm/experiment/step/base_step.py | 14 +++-- .../experiment/step/step_termination.py | 57 +++++++++++++++---- .../test_experiments/test_experiment_steps.py | 39 +++++++++++++ .../test_simulation_with_experiment.py | 4 +- 6 files changed, 102 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58fafc076a..9f01feeef6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # [Unreleased](https://github.com/pybamm-team/PyBaMM/) +## Features +- Added Operators to current and voltage termination events. ([#4770](https://github.com/pybamm-team/PyBaMM/pull/4770)) + # [v25.1.0](https://github.com/pybamm-team/PyBaMM/tree/v25.1.0) - 2025-01-14 ## Features diff --git a/src/pybamm/experiment/step/__init__.py b/src/pybamm/experiment/step/__init__.py index 1810844d3f..b2613a50d7 100644 --- a/src/pybamm/experiment/step/__init__.py +++ b/src/pybamm/experiment/step/__init__.py @@ -1,5 +1,5 @@ from .steps import * from .base_step import BaseStep, BaseStepExplicit, BaseStepImplicit -from .step_termination import * +from .step_termination import BaseTermination, CurrentTermination, VoltageTermination, CustomTermination, CrateTermination, _read_termination __all__ = ['base_step', 'step_termination', 'steps'] diff --git a/src/pybamm/experiment/step/base_step.py b/src/pybamm/experiment/step/base_step.py index 8dd829935e..b2f92d4dfc 100644 --- a/src/pybamm/experiment/step/base_step.py +++ b/src/pybamm/experiment/step/base_step.py @@ -67,8 +67,14 @@ def __init__( tags=None, start_time=None, description=None, - direction=None, + direction: str | None = None, ): + potential_directions = ["charge", "discharge", "rest", None] + if direction not in potential_directions: + raise ValueError( + f"Invalid direction: {direction}. Must be one of {potential_directions}" + ) + self.input_duration = duration self.input_duration = duration self.input_value = value # Check if drive cycle @@ -386,11 +392,11 @@ def value_based_charge_or_discharge(self): init_curr = self.value sign = np.sign(init_curr) if sign == 0: - return "Rest" + return "rest" elif sign > 0: - return "Discharge" + return "discharge" else: - return "Charge" + return "charge" def record_tags( self, diff --git a/src/pybamm/experiment/step/step_termination.py b/src/pybamm/experiment/step/step_termination.py index d4ffbe1aab..a17bae87f4 100644 --- a/src/pybamm/experiment/step/step_termination.py +++ b/src/pybamm/experiment/step/step_termination.py @@ -14,8 +14,11 @@ class BaseTermination: The value at which the event is triggered """ - def __init__(self, value): + def __init__(self, value, operator=None): self.value = value + if operator not in ["<", ">", None]: + raise ValueError(f"Invalid operator: {operator}") + self.operator = operator def get_event(self, variables, step): """ @@ -67,9 +70,19 @@ def get_event(self, variables, step): """ See :meth:`BaseTermination.get_event` """ + operator = self.operator + if operator == ">": + expr = self.value - variables["Current [A]"] + event_string = f"Current [A] > {self.value} [A] [experiment]" + elif operator == "<": + expr = variables["Current [A]"] - self.value + event_string = f"Current [A] < {self.value} [A] [experiment]" + else: + expr = abs(variables["Current [A]"]) - self.value + event_string = f"abs(Current [A]) < {self.value} [A] [experiment]" event = pybamm.Event( - "Current cut-off [A] [experiment]", - abs(variables["Current [A]"]) - self.value, + event_string, + expr, ) return event @@ -89,24 +102,48 @@ def get_event(self, variables, step): # figure out whether the voltage event is greater than the starting # voltage (charge) or less (discharge) and set the sign of the # event accordingly - direction = step.direction.capitalize() - if direction == "Charge": + operator = self.operator + if operator is None: + direction = step.direction + if direction == "charge": + operator = ">" + elif direction == "discharge": + operator = "<" + else: + # No event for rest steps + return None + + if operator == ">": sign = -1 - elif direction == "Discharge": + else: + # operator can only be "<" or ">" sign = 1 - elif direction == "Rest": - # No event for rest steps - return None # Event should be positive at initial conditions for both # charge and discharge event = pybamm.Event( - f"{direction} voltage cut-off [V] [experiment]", + f"Voltage {operator} {self.value} [V] [experiment]", sign * (variables["Battery voltage [V]"] - self.value), ) return event +class Voltage: + def __gt__(self, value): + return VoltageTermination(value, operator=">") + + def __lt__(self, value): + return VoltageTermination(value, operator="<") + + +class Current: + def __gt__(self, value): + return CurrentTermination(value, operator=">") + + def __lt__(self, value): + return CurrentTermination(value, operator="<") + + class CustomTermination(BaseTermination): """ Define a custom termination event using a function. This can be used to create an diff --git a/tests/unit/test_experiments/test_experiment_steps.py b/tests/unit/test_experiments/test_experiment_steps.py index 67f63032b8..e79b18d47e 100644 --- a/tests/unit/test_experiments/test_experiment_steps.py +++ b/tests/unit/test_experiments/test_experiment_steps.py @@ -307,3 +307,42 @@ def custom_step_voltage(variables): with pytest.raises(ValueError, match="control must be"): pybamm.step.CustomStepImplicit(custom_step_voltage, control="bla") + + def test_bad_direction(self): + with pytest.raises(ValueError, match="Invalid direction"): + pybamm.step.Voltage(4.1, direction="foo") + + def test_steps_with_operators(self): + # voltage + step = pybamm.step.voltage(1, duration=3600) + termination_lt_4_1 = pybamm.step.VoltageTermination(4.1, operator="<") + termination_gt_4_1 = pybamm.step.VoltageTermination(4.1, operator=">") + variables = {"Battery voltage [V]": 4.2} + event_lt_4_1 = termination_lt_4_1.get_event(variables, step) + np.testing.assert_allclose(event_lt_4_1.expression, 4.2 - 4.1) + event_gt_4_1 = termination_gt_4_1.get_event(variables, step) + np.testing.assert_allclose(event_gt_4_1.expression, 4.1 - 4.2) + + # current + step = pybamm.step.current(1, duration=3600) + termination_lt_0_05 = pybamm.step.CurrentTermination(0.05, operator="<") + termination_gt_0_05 = pybamm.step.CurrentTermination(0.05, operator=">") + variables = {"Current [A]": 0.06} + event_lt_0_05 = termination_lt_0_05.get_event(variables, step) + np.testing.assert_allclose(event_lt_0_05.expression, 0.06 - 0.05) + event_gt_0_05 = termination_gt_0_05.get_event(variables, step) + np.testing.assert_allclose(event_gt_0_05.expression, 0.05 - 0.06) + + # error + with pytest.raises(ValueError, match="Invalid operator"): + pybamm.step.CurrentTermination(0.05, operator="=") + + # operator overloading + termination_lt_0_05_oo = pybamm.step.step_termination.Current() < 0.05 + termination_gt_0_05_oo = pybamm.step.step_termination.Current() > 0.05 + assert termination_lt_0_05_oo == termination_gt_0_05 + assert termination_gt_0_05_oo == termination_gt_0_05 + termination_lt_4_1_oo = pybamm.step.step_termination.Voltage() < 4.1 + termination_gt_4_1_oo = pybamm.step.step_termination.Voltage() > 4.1 + assert termination_lt_4_1_oo == termination_gt_4_1 + assert termination_gt_4_1_oo == termination_gt_4_1 diff --git a/tests/unit/test_experiments/test_simulation_with_experiment.py b/tests/unit/test_experiments/test_simulation_with_experiment.py index 8b56b519de..ba64c6f108 100644 --- a/tests/unit/test_experiments/test_simulation_with_experiment.py +++ b/tests/unit/test_experiments/test_simulation_with_experiment.py @@ -33,10 +33,10 @@ def test_set_up(self): steps[1].basic_repr() ] # CC charge model_V = sim.experiment_unique_steps_to_model[steps[2].basic_repr()] # CV hold - assert "Current cut-off [A] [experiment]" in [ + assert "abs(Current [A]) < 0.05 [A] [experiment]" in [ event.name for event in model_V.events ] - assert "Charge voltage cut-off [V] [experiment]" in [ + assert "Voltage > 4.1 [V] [experiment]" in [ event.name for event in model_I.events ] From 707a9197396252a3360dc25463a628abc1f97628 Mon Sep 17 00:00:00 2001 From: "Eric G. Kratz" Date: Mon, 20 Jan 2025 19:11:04 -0500 Subject: [PATCH 10/14] Remove missed file (#4783) --- .clang-format | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .clang-format diff --git a/.clang-format b/.clang-format deleted file mode 100644 index 909e831f6d..0000000000 --- a/.clang-format +++ /dev/null @@ -1,3 +0,0 @@ -# Visual Studio format -BasedOnStyle: LLVM -BreakBeforeBraces: Allman From 3fad5e13b1904a6777e476e7568e8bbafe89b982 Mon Sep 17 00:00:00 2001 From: "Eric G. Kratz" Date: Mon, 20 Jan 2025 20:24:47 -0500 Subject: [PATCH 11/14] Fix CHANGELOG (#4784) * Fix CHANGELOG * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f01feeef6..49af3c5f19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ # [Unreleased](https://github.com/pybamm-team/PyBaMM/) ## Features + - Added Operators to current and voltage termination events. ([#4770](https://github.com/pybamm-team/PyBaMM/pull/4770)) +## Bug fixes + +- Fixed a bug which caused the wc-reaction limited SEI model to give + incorrect results ([#4774](https://github.com/pybamm-team/PyBaMM/pull/4774)) + # [v25.1.0](https://github.com/pybamm-team/PyBaMM/tree/v25.1.0) - 2025-01-14 ## Features From b2fed61af1c05e0e1462d37397b502429cd1b561 Mon Sep 17 00:00:00 2001 From: "Eric G. Kratz" Date: Tue, 21 Jan 2025 06:49:18 -0500 Subject: [PATCH 12/14] Cleanup (#4785) --- .github/codecov.yml | 0 conftest.py | 7 ------- pyproject.toml | 1 - tests/unit/test_solvers/test_idaklu_solver.py | 1 - 4 files changed, 9 deletions(-) delete mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/conftest.py b/conftest.py index 77513d56db..ce0170a167 100644 --- a/conftest.py +++ b/conftest.py @@ -19,19 +19,12 @@ def pytest_addoption(parser): default=False, help="run integration tests", ) - parser.addoption( - "--cibw", - action="store_true", - default=False, - help="test build wheels", - ) def pytest_configure(config): config.addinivalue_line("markers", "scripts: mark test as an example script") config.addinivalue_line("markers", "unit: mark test as a unit test") config.addinivalue_line("markers", "integration: mark test as an integration test") - config.addinivalue_line("markers", "cibw: mark test as build wheel test") def pytest_collection_modifyitems(items): diff --git a/pyproject.toml b/pyproject.toml index 50893200cb..a416544551 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -227,7 +227,6 @@ required_plugins = [ "pytest-mock", "pytest-subtests", ] -norecursedirs = 'pybind11*' addopts = [ "-nauto", "-vra", diff --git a/tests/unit/test_solvers/test_idaklu_solver.py b/tests/unit/test_solvers/test_idaklu_solver.py index 28cc34ded9..cd5d12a462 100644 --- a/tests/unit/test_solvers/test_idaklu_solver.py +++ b/tests/unit/test_solvers/test_idaklu_solver.py @@ -7,7 +7,6 @@ from tests import get_discretisation_for_testing -@pytest.mark.cibw class TestIDAKLUSolver: def test_ida_roberts_klu(self): # this test implements a python version of the ida Roberts From a54b9a5e2581f711c901f9b3d23cd7ca69cc8eb2 Mon Sep 17 00:00:00 2001 From: "Eric G. Kratz" Date: Tue, 21 Jan 2025 11:58:57 -0500 Subject: [PATCH 13/14] Replace CChem link with attribution to John Newman (#4788) * Replace citation * Replace bitbucket link and cleanup --- CONTRIBUTING.md | 7 +------ noxfile.py | 14 ++++---------- .../input/parameters/lithium_ion/Ai2020.py | 6 +++--- .../input/parameters/lithium_ion/Marquis2019.py | 16 ++++++++-------- .../input/parameters/lithium_ion/Mohtat2020.py | 10 +++++----- .../input/parameters/lithium_ion/Ramadass2004.py | 2 +- 6 files changed, 22 insertions(+), 33 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb510f7054..861db23b10 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -422,18 +422,13 @@ wherever code is called that uses that citation (for example, in functions or in ### Installation -Installation of PyBaMM and its dependencies is handled via [pip](https://pip.pypa.io/en/stable/) and [setuptools](http://setuptools.readthedocs.io/). It uses `CMake` to compile C++ extensions using [`pybind11`](https://pybind11.readthedocs.io/en/stable/) and [`casadi`](https://web.casadi.org/). The installation process is described in detail in the [source installation](https://docs.pybamm.org/en/latest/source/user_guide/installation/install-from-source.html) page and is configured through the `CMakeLists.txt` file. +Installation of PyBaMM and its dependencies is handled via [pip](https://pip.pypa.io/en/stable/) Configuration files: - ``` -setup.py pyproject.toml -MANIFEST.in ``` -Note: `MANIFEST.in` is used to include and exclude non-Python files and auxiliary package data for PyBaMM when distributing it. If a file is not included in `MANIFEST.in`, it will not be included in the source distribution (SDist) and subsequently not be included in the binary distribution (wheel). - ### Continuous Integration using GitHub Actions Each change pushed to the PyBaMM GitHub repository will trigger the test and benchmark suites to be run, using [GitHub Actions](https://github.com/features/actions). diff --git a/noxfile.py b/noxfile.py index 7892ad86ac..5c1b263f97 100644 --- a/noxfile.py +++ b/noxfile.py @@ -64,8 +64,7 @@ def run_integration(session): @nox.session(name="doctests") def run_doctests(session): """Run the doctests and generate the output(s) in the docs/build/ directory.""" - # TODO: Temporary fix for Python 3.12 CI. - # See: https://bitbucket.org/pybtex-devs/pybtex/issues/169/ + # Fix for Python 3.12 CI. This can be removed after pybtex is replaced. session.install("setuptools", silent=False) session.install("-e", ".[all,dev,docs]", silent=False) session.run( @@ -102,9 +101,7 @@ def run_examples(session): def run_scripts(session): """Run the scripts tests for Python scripts.""" set_environment_variables(PYBAMM_ENV, session=session) - # Temporary fix for Python 3.12 CI. TODO: remove after - # https://bitbucket.org/pybtex-devs/pybtex/issues/169/replace-pkg_resources-with - # is fixed + # Fix for Python 3.12 CI. This can be removed after pybtex is replaced. session.install("setuptools", silent=False) session.install("-e", ".[all,dev,jax]", silent=False) session.run("python", "-m", "pytest", "-m", "scripts") @@ -119,9 +116,7 @@ def set_dev(session): python = os.fsdecode(VENV_DIR.joinpath("bin/python")) components = ["all", "dev", "jax"] args = [] - # Temporary fix for Python 3.12 CI. TODO: remove after - # https://bitbucket.org/pybtex-devs/pybtex/issues/169/replace-pkg_resources-with - # is fixed + # Fix for Python 3.12 CI. This can be removed after pybtex is replaced. session.run(python, "-m", "pip", "install", "setuptools", external=True) session.run( python, @@ -153,8 +148,7 @@ def run_tests(session): def build_docs(session): """Build the documentation and load it in a browser tab, rebuilding on changes.""" envbindir = session.bin - # TODO: Temporary fix for Python 3.12 CI. - # See: https://bitbucket.org/pybtex-devs/pybtex/issues/169/ + # Fix for Python 3.12 CI. This can be removed after pybtex is replaced. session.install("setuptools", silent=False) session.install("-e", ".[all,docs]", silent=False) session.chdir("docs") diff --git a/src/pybamm/input/parameters/lithium_ion/Ai2020.py b/src/pybamm/input/parameters/lithium_ion/Ai2020.py index 1223ddfdce..ff317c2ac0 100644 --- a/src/pybamm/input/parameters/lithium_ion/Ai2020.py +++ b/src/pybamm/input/parameters/lithium_ion/Ai2020.py @@ -45,7 +45,7 @@ def graphite_electrolyte_exchange_current_density_Dualfoil1998( References ---------- - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- @@ -219,7 +219,7 @@ def lico2_diffusivity_Dualfoil1998(sto, T): References ---------- - .. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [1] John Newman, Dualfoil Parameters ---------- @@ -247,7 +247,7 @@ def lico2_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_m References ---------- - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- diff --git a/src/pybamm/input/parameters/lithium_ion/Marquis2019.py b/src/pybamm/input/parameters/lithium_ion/Marquis2019.py index 3e3b864fe3..ecd9a59ff0 100644 --- a/src/pybamm/input/parameters/lithium_ion/Marquis2019.py +++ b/src/pybamm/input/parameters/lithium_ion/Marquis2019.py @@ -9,7 +9,7 @@ def graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T): References ---------- - .. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [1] John Newman, Dualfoil Parameters ---------- @@ -40,7 +40,7 @@ def graphite_mcmb2528_ocp_Dualfoil1998(sto): References ---------- - .. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [1] John Newman, Dualfoil """ u_eq = ( @@ -68,7 +68,7 @@ def graphite_electrolyte_exchange_current_density_Dualfoil1998( References ---------- - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- @@ -134,7 +134,7 @@ def lico2_diffusivity_Dualfoil1998(sto, T): References ---------- - .. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [1] John Newman, Dualfoil Parameters ---------- @@ -166,7 +166,7 @@ def lico2_ocp_Dualfoil1998(sto): References ---------- - .. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [1] John Newman, Dualfoil .. [2] CM Doyle. Design and simulation of lithium rechargeable batteries, 1995. @@ -200,7 +200,7 @@ def lico2_electrolyte_exchange_current_density_Dualfoil1998(c_e, c_s_surf, c_s_m References ---------- - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- @@ -269,7 +269,7 @@ def electrolyte_diffusivity_Capiglia1999(c_e, T): .. [1] C Capiglia et al. 7Li and 19F diffusion coefficients and thermal properties of non-aqueous electrolyte solutions for rechargeable lithium batteries. Journal of power sources 81 (1999): 859-862. - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- @@ -302,7 +302,7 @@ def electrolyte_conductivity_Capiglia1999(c_e, T): .. [1] C Capiglia et al. 7Li and 19F diffusion coefficients and thermal properties of non-aqueous electrolyte solutions for rechargeable lithium batteries. Journal of power sources 81 (1999): 859-862. - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- diff --git a/src/pybamm/input/parameters/lithium_ion/Mohtat2020.py b/src/pybamm/input/parameters/lithium_ion/Mohtat2020.py index 7963575097..c35b205d4e 100644 --- a/src/pybamm/input/parameters/lithium_ion/Mohtat2020.py +++ b/src/pybamm/input/parameters/lithium_ion/Mohtat2020.py @@ -9,7 +9,7 @@ def graphite_diffusivity_PeymanMPM(sto, T): References ---------- - .. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [1] John Newman, Dualfoil Parameters ---------- @@ -63,7 +63,7 @@ def graphite_electrolyte_exchange_current_density_PeymanMPM(c_e, c_s_surf, c_s_m References ---------- - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- @@ -126,7 +126,7 @@ def NMC_diffusivity_PeymanMPM(sto, T): References ---------- - .. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [1] John Newman, Dualfoil Parameters ---------- @@ -257,7 +257,7 @@ def electrolyte_diffusivity_PeymanMPM(c_e, T): .. [1] C Capiglia et al. 7Li and 19F diffusion coefficients and thermal properties of non-aqueous electrolyte solutions for rechargeable lithium batteries. Journal of power sources 81 (1999): 859-862. - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- @@ -290,7 +290,7 @@ def electrolyte_conductivity_PeymanMPM(c_e, T): .. [1] C Capiglia et al. 7Li and 19F diffusion coefficients and thermal properties of non-aqueous electrolyte solutions for rechargeable lithium batteries. Journal of power sources 81 (1999): 859-862. - .. [2] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [2] John Newman, Dualfoil Parameters ---------- c_e: :class:`pybamm.Symbol` diff --git a/src/pybamm/input/parameters/lithium_ion/Ramadass2004.py b/src/pybamm/input/parameters/lithium_ion/Ramadass2004.py index f01cb8e985..1a94149f51 100644 --- a/src/pybamm/input/parameters/lithium_ion/Ramadass2004.py +++ b/src/pybamm/input/parameters/lithium_ion/Ramadass2004.py @@ -9,7 +9,7 @@ def graphite_mcmb2528_diffusivity_Dualfoil1998(sto, T): References ---------- - .. [1] http://www.cchem.berkeley.edu/jsngrp/fortran.html + .. [1] John Newman, Dualfoil Parameters ---------- From 2e99a0efb60714bd5af6f8d399ab13332b5dd1dd Mon Sep 17 00:00:00 2001 From: kratman Date: Mon, 20 Jan 2025 18:03:02 -0500 Subject: [PATCH 14/14] Update version --- CHANGELOG.md | 2 ++ CITATION.cff | 2 +- pyproject.toml | 2 +- src/pybamm/version.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49af3c5f19..c0ed6790da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # [Unreleased](https://github.com/pybamm-team/PyBaMM/) +# [v25.1.1](https://github.com/pybamm-team/PyBaMM/tree/v25.1.1) - 2025-01-20 + ## Features - Added Operators to current and voltage termination events. ([#4770](https://github.com/pybamm-team/PyBaMM/pull/4770)) diff --git a/CITATION.cff b/CITATION.cff index 742806759c..7cce9ecde2 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -24,6 +24,6 @@ keywords: - "expression tree" - "python" - "symbolic differentiation" -version: "25.1.0" +version: "25.1.1" repository-code: "https://github.com/pybamm-team/PyBaMM" title: "Python Battery Mathematical Modelling (PyBaMM)" diff --git a/pyproject.toml b/pyproject.toml index a416544551..5b3d96c5f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "pybamm" -version = "25.1.0" +version = "25.1.1" license = { file = "LICENSE.txt" } description = "Python Battery Mathematical Modelling" authors = [{name = "The PyBaMM Team", email = "pybamm@pybamm.org"}] diff --git a/src/pybamm/version.py b/src/pybamm/version.py index e5d7ca6220..f579313f94 100644 --- a/src/pybamm/version.py +++ b/src/pybamm/version.py @@ -1 +1 @@ -__version__ = "25.1.0" +__version__ = "25.1.1"