From 54adaab24ded423951d17ebc58d26513067a05b4 Mon Sep 17 00:00:00 2001 From: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:27:48 +0000 Subject: [PATCH 1/5] Divide examples into folders --- examples/{scripts => data}/Chen_example.csv | 0 .../{ => battery_parameterisation}/ecm_trust-constr.ipynb | 0 .../electrode_balancing.ipynb | 0 .../equivalent_circuit_identification.ipynb | 4 ++-- .../equivalent_circuit_identification_hppc.ipynb | 0 .../equivalent_circuit_identification_multipulse.ipynb | 0 .../monte_carlo_ecm_identification.ipynb | 0 .../multi_model_identification.ipynb | 0 .../pouch_cell_identification.ipynb | 0 .../single_pulse_circuit_model.ipynb | 0 .../comparing_cost_functions.ipynb | 0 .../multi_optimiser_identification.ipynb | 0 .../{ => comparison_examples}/optimiser_calibration.ipynb | 0 .../{ => comparison_examples}/solver_selection.ipynb | 0 .../energy_based_electrode_design.ipynb | 0 .../{ => getting_started}/adamw_identification.ipynb | 0 .../{ => getting_started}/cost_compute_methods.ipynb | 0 .../{ => getting_started}/creating_a_model.ipynb | 0 .../{ => getting_started}/maximum_a_posteriori.ipynb | 0 .../{ => getting_started}/optimiser_interface.ipynb | 0 .../transformation_introduction.ipynb | 0 examples/{scripts => }/parameters/example_BPX.json | 0 .../{scripts => }/parameters/initial_ecm_parameters.json | 0 .../scripts/{ => battery_parameterisation}/ecm_CMAES.py | 0 .../{ => battery_parameterisation}/ecm_tau_constraints.py | 0 .../scripts/{ => battery_parameterisation}/eis_fitting.py | 0 examples/scripts/{ => battery_parameterisation}/gitt.py | 0 .../{ => battery_parameterisation}/ocp_balancing.py | 0 examples/scripts/{ => comparison_examples}/cuckoo.py | 0 examples/scripts/{ => comparison_examples}/exp_UKF.py | 0 .../{ => comparison_examples}/maximum_a_posteriori.py | 0 .../{ => comparison_examples}/maximum_likelihood.py | 0 .../{ => comparison_examples}/selecting_a_solver.py | 0 examples/scripts/{ => comparison_examples}/spm_AdamW.py | 0 examples/scripts/{ => comparison_examples}/spm_CMAES.py | 0 .../scripts/{ => comparison_examples}/spm_IRPropMin.py | 0 .../scripts/{ => comparison_examples}/spm_NelderMead.py | 0 examples/scripts/{ => comparison_examples}/spm_SNES.py | 0 examples/scripts/{ => comparison_examples}/spm_UKF.py | 0 examples/scripts/{ => comparison_examples}/spm_XNES.py | 0 examples/scripts/{ => comparison_examples}/spm_descent.py | 0 examples/scripts/{ => comparison_examples}/spm_pso.py | 0 .../scripts/{ => comparison_examples}/spm_scipymin.py | 2 +- .../{ => design_optimisation}/maximising_energy.py | 0 .../scripts/{ => design_optimisation}/maximising_power.py | 0 examples/scripts/{ => getting_started}/BPX_spm.py | 0 .../{ => getting_started}/functional_parameters.py | 0 .../scripts/{ => getting_started}/linked_parameters.py | 0 examples/scripts/{ => getting_started}/mcmc_example.py | 0 examples/scripts/{ => getting_started}/multi_fitting.py | 0 .../scripts/{ => getting_started}/spm_weighted_cost.py | 0 tests/integration/test_monte_carlo_thevenin.py | 2 +- tests/integration/test_thevenin_parameterisation.py | 2 +- tests/integration/test_transformation.py | 2 +- tests/unit/test_models.py | 2 +- tests/unit/test_parameter_sets.py | 8 ++++---- 56 files changed, 11 insertions(+), 11 deletions(-) rename examples/{scripts => data}/Chen_example.csv (100%) rename examples/notebooks/{ => battery_parameterisation}/ecm_trust-constr.ipynb (100%) rename examples/notebooks/{ => battery_parameterisation}/electrode_balancing.ipynb (100%) rename examples/notebooks/{ => battery_parameterisation}/equivalent_circuit_identification.ipynb (99%) rename examples/notebooks/{ => battery_parameterisation}/equivalent_circuit_identification_hppc.ipynb (100%) rename examples/notebooks/{ => battery_parameterisation}/equivalent_circuit_identification_multipulse.ipynb (100%) rename examples/notebooks/{ => battery_parameterisation}/monte_carlo_ecm_identification.ipynb (100%) rename examples/notebooks/{ => battery_parameterisation}/multi_model_identification.ipynb (100%) rename examples/notebooks/{ => battery_parameterisation}/pouch_cell_identification.ipynb (100%) rename examples/notebooks/{ => battery_parameterisation}/single_pulse_circuit_model.ipynb (100%) rename examples/notebooks/{ => comparison_examples}/comparing_cost_functions.ipynb (100%) rename examples/notebooks/{ => comparison_examples}/multi_optimiser_identification.ipynb (100%) rename examples/notebooks/{ => comparison_examples}/optimiser_calibration.ipynb (100%) rename examples/notebooks/{ => comparison_examples}/solver_selection.ipynb (100%) rename examples/notebooks/{ => design_optimisation}/energy_based_electrode_design.ipynb (100%) rename examples/notebooks/{ => getting_started}/adamw_identification.ipynb (100%) rename examples/notebooks/{ => getting_started}/cost_compute_methods.ipynb (100%) rename examples/notebooks/{ => getting_started}/creating_a_model.ipynb (100%) rename examples/notebooks/{ => getting_started}/maximum_a_posteriori.ipynb (100%) rename examples/notebooks/{ => getting_started}/optimiser_interface.ipynb (100%) rename examples/notebooks/{ => getting_started}/transformation_introduction.ipynb (100%) rename examples/{scripts => }/parameters/example_BPX.json (100%) rename examples/{scripts => }/parameters/initial_ecm_parameters.json (100%) rename examples/scripts/{ => battery_parameterisation}/ecm_CMAES.py (100%) rename examples/scripts/{ => battery_parameterisation}/ecm_tau_constraints.py (100%) rename examples/scripts/{ => battery_parameterisation}/eis_fitting.py (100%) rename examples/scripts/{ => battery_parameterisation}/gitt.py (100%) rename examples/scripts/{ => battery_parameterisation}/ocp_balancing.py (100%) rename examples/scripts/{ => comparison_examples}/cuckoo.py (100%) rename examples/scripts/{ => comparison_examples}/exp_UKF.py (100%) rename examples/scripts/{ => comparison_examples}/maximum_a_posteriori.py (100%) rename examples/scripts/{ => comparison_examples}/maximum_likelihood.py (100%) rename examples/scripts/{ => comparison_examples}/selecting_a_solver.py (100%) rename examples/scripts/{ => comparison_examples}/spm_AdamW.py (100%) rename examples/scripts/{ => comparison_examples}/spm_CMAES.py (100%) rename examples/scripts/{ => comparison_examples}/spm_IRPropMin.py (100%) rename examples/scripts/{ => comparison_examples}/spm_NelderMead.py (100%) rename examples/scripts/{ => comparison_examples}/spm_SNES.py (100%) rename examples/scripts/{ => comparison_examples}/spm_UKF.py (100%) rename examples/scripts/{ => comparison_examples}/spm_XNES.py (100%) rename examples/scripts/{ => comparison_examples}/spm_descent.py (100%) rename examples/scripts/{ => comparison_examples}/spm_pso.py (100%) rename examples/scripts/{ => comparison_examples}/spm_scipymin.py (93%) rename examples/scripts/{ => design_optimisation}/maximising_energy.py (100%) rename examples/scripts/{ => design_optimisation}/maximising_power.py (100%) rename examples/scripts/{ => getting_started}/BPX_spm.py (100%) rename examples/scripts/{ => getting_started}/functional_parameters.py (100%) rename examples/scripts/{ => getting_started}/linked_parameters.py (100%) rename examples/scripts/{ => getting_started}/mcmc_example.py (100%) rename examples/scripts/{ => getting_started}/multi_fitting.py (100%) rename examples/scripts/{ => getting_started}/spm_weighted_cost.py (100%) diff --git a/examples/scripts/Chen_example.csv b/examples/data/Chen_example.csv similarity index 100% rename from examples/scripts/Chen_example.csv rename to examples/data/Chen_example.csv diff --git a/examples/notebooks/ecm_trust-constr.ipynb b/examples/notebooks/battery_parameterisation/ecm_trust-constr.ipynb similarity index 100% rename from examples/notebooks/ecm_trust-constr.ipynb rename to examples/notebooks/battery_parameterisation/ecm_trust-constr.ipynb diff --git a/examples/notebooks/electrode_balancing.ipynb b/examples/notebooks/battery_parameterisation/electrode_balancing.ipynb similarity index 100% rename from examples/notebooks/electrode_balancing.ipynb rename to examples/notebooks/battery_parameterisation/electrode_balancing.ipynb diff --git a/examples/notebooks/equivalent_circuit_identification.ipynb b/examples/notebooks/battery_parameterisation/equivalent_circuit_identification.ipynb similarity index 99% rename from examples/notebooks/equivalent_circuit_identification.ipynb rename to examples/notebooks/battery_parameterisation/equivalent_circuit_identification.ipynb index 0f0b6f433..1d5f6262b 100644 --- a/examples/notebooks/equivalent_circuit_identification.ipynb +++ b/examples/notebooks/battery_parameterisation/equivalent_circuit_identification.ipynb @@ -104,7 +104,7 @@ "source": [ "## Importing Parameters\n", "\n", - "This can be completed by importing a JSON representation, such as the one in the PyBOP [examples](https://github.com/pybop-team/PyBOP/blob/develop/examples/scripts/parameters/initial_ecm_parameters.json). To import via JSON, either download the example file, or create your own and update the path below to reference the corresponding file." + "This can be completed by importing a JSON representation, such as the one in the PyBOP [examples](https://github.com/pybop-team/PyBOP/blob/develop/examples/parameters/initial_ecm_parameters.json). To import via JSON, either download the example file, or create your own and update the path below to reference the corresponding file." ] }, { @@ -115,7 +115,7 @@ "outputs": [], "source": [ "# parameter_set = pybop.ParameterSet(\n", - "# json_path=\"examples/scripts/parameters/initial_ecm_parameters.json\"\n", + "# json_path=\"examples/parameters/initial_ecm_parameters.json\"\n", "# )\n", "# parameter_set.import_parameters()" ] diff --git a/examples/notebooks/equivalent_circuit_identification_hppc.ipynb b/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb similarity index 100% rename from examples/notebooks/equivalent_circuit_identification_hppc.ipynb rename to examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb diff --git a/examples/notebooks/equivalent_circuit_identification_multipulse.ipynb b/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_multipulse.ipynb similarity index 100% rename from examples/notebooks/equivalent_circuit_identification_multipulse.ipynb rename to examples/notebooks/battery_parameterisation/equivalent_circuit_identification_multipulse.ipynb diff --git a/examples/notebooks/monte_carlo_ecm_identification.ipynb b/examples/notebooks/battery_parameterisation/monte_carlo_ecm_identification.ipynb similarity index 100% rename from examples/notebooks/monte_carlo_ecm_identification.ipynb rename to examples/notebooks/battery_parameterisation/monte_carlo_ecm_identification.ipynb diff --git a/examples/notebooks/multi_model_identification.ipynb b/examples/notebooks/battery_parameterisation/multi_model_identification.ipynb similarity index 100% rename from examples/notebooks/multi_model_identification.ipynb rename to examples/notebooks/battery_parameterisation/multi_model_identification.ipynb diff --git a/examples/notebooks/pouch_cell_identification.ipynb b/examples/notebooks/battery_parameterisation/pouch_cell_identification.ipynb similarity index 100% rename from examples/notebooks/pouch_cell_identification.ipynb rename to examples/notebooks/battery_parameterisation/pouch_cell_identification.ipynb diff --git a/examples/notebooks/single_pulse_circuit_model.ipynb b/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb similarity index 100% rename from examples/notebooks/single_pulse_circuit_model.ipynb rename to examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb diff --git a/examples/notebooks/comparing_cost_functions.ipynb b/examples/notebooks/comparison_examples/comparing_cost_functions.ipynb similarity index 100% rename from examples/notebooks/comparing_cost_functions.ipynb rename to examples/notebooks/comparison_examples/comparing_cost_functions.ipynb diff --git a/examples/notebooks/multi_optimiser_identification.ipynb b/examples/notebooks/comparison_examples/multi_optimiser_identification.ipynb similarity index 100% rename from examples/notebooks/multi_optimiser_identification.ipynb rename to examples/notebooks/comparison_examples/multi_optimiser_identification.ipynb diff --git a/examples/notebooks/optimiser_calibration.ipynb b/examples/notebooks/comparison_examples/optimiser_calibration.ipynb similarity index 100% rename from examples/notebooks/optimiser_calibration.ipynb rename to examples/notebooks/comparison_examples/optimiser_calibration.ipynb diff --git a/examples/notebooks/solver_selection.ipynb b/examples/notebooks/comparison_examples/solver_selection.ipynb similarity index 100% rename from examples/notebooks/solver_selection.ipynb rename to examples/notebooks/comparison_examples/solver_selection.ipynb diff --git a/examples/notebooks/energy_based_electrode_design.ipynb b/examples/notebooks/design_optimisation/energy_based_electrode_design.ipynb similarity index 100% rename from examples/notebooks/energy_based_electrode_design.ipynb rename to examples/notebooks/design_optimisation/energy_based_electrode_design.ipynb diff --git a/examples/notebooks/adamw_identification.ipynb b/examples/notebooks/getting_started/adamw_identification.ipynb similarity index 100% rename from examples/notebooks/adamw_identification.ipynb rename to examples/notebooks/getting_started/adamw_identification.ipynb diff --git a/examples/notebooks/cost_compute_methods.ipynb b/examples/notebooks/getting_started/cost_compute_methods.ipynb similarity index 100% rename from examples/notebooks/cost_compute_methods.ipynb rename to examples/notebooks/getting_started/cost_compute_methods.ipynb diff --git a/examples/notebooks/creating_a_model.ipynb b/examples/notebooks/getting_started/creating_a_model.ipynb similarity index 100% rename from examples/notebooks/creating_a_model.ipynb rename to examples/notebooks/getting_started/creating_a_model.ipynb diff --git a/examples/notebooks/maximum_a_posteriori.ipynb b/examples/notebooks/getting_started/maximum_a_posteriori.ipynb similarity index 100% rename from examples/notebooks/maximum_a_posteriori.ipynb rename to examples/notebooks/getting_started/maximum_a_posteriori.ipynb diff --git a/examples/notebooks/optimiser_interface.ipynb b/examples/notebooks/getting_started/optimiser_interface.ipynb similarity index 100% rename from examples/notebooks/optimiser_interface.ipynb rename to examples/notebooks/getting_started/optimiser_interface.ipynb diff --git a/examples/notebooks/transformation_introduction.ipynb b/examples/notebooks/getting_started/transformation_introduction.ipynb similarity index 100% rename from examples/notebooks/transformation_introduction.ipynb rename to examples/notebooks/getting_started/transformation_introduction.ipynb diff --git a/examples/scripts/parameters/example_BPX.json b/examples/parameters/example_BPX.json similarity index 100% rename from examples/scripts/parameters/example_BPX.json rename to examples/parameters/example_BPX.json diff --git a/examples/scripts/parameters/initial_ecm_parameters.json b/examples/parameters/initial_ecm_parameters.json similarity index 100% rename from examples/scripts/parameters/initial_ecm_parameters.json rename to examples/parameters/initial_ecm_parameters.json diff --git a/examples/scripts/ecm_CMAES.py b/examples/scripts/battery_parameterisation/ecm_CMAES.py similarity index 100% rename from examples/scripts/ecm_CMAES.py rename to examples/scripts/battery_parameterisation/ecm_CMAES.py diff --git a/examples/scripts/ecm_tau_constraints.py b/examples/scripts/battery_parameterisation/ecm_tau_constraints.py similarity index 100% rename from examples/scripts/ecm_tau_constraints.py rename to examples/scripts/battery_parameterisation/ecm_tau_constraints.py diff --git a/examples/scripts/eis_fitting.py b/examples/scripts/battery_parameterisation/eis_fitting.py similarity index 100% rename from examples/scripts/eis_fitting.py rename to examples/scripts/battery_parameterisation/eis_fitting.py diff --git a/examples/scripts/gitt.py b/examples/scripts/battery_parameterisation/gitt.py similarity index 100% rename from examples/scripts/gitt.py rename to examples/scripts/battery_parameterisation/gitt.py diff --git a/examples/scripts/ocp_balancing.py b/examples/scripts/battery_parameterisation/ocp_balancing.py similarity index 100% rename from examples/scripts/ocp_balancing.py rename to examples/scripts/battery_parameterisation/ocp_balancing.py diff --git a/examples/scripts/cuckoo.py b/examples/scripts/comparison_examples/cuckoo.py similarity index 100% rename from examples/scripts/cuckoo.py rename to examples/scripts/comparison_examples/cuckoo.py diff --git a/examples/scripts/exp_UKF.py b/examples/scripts/comparison_examples/exp_UKF.py similarity index 100% rename from examples/scripts/exp_UKF.py rename to examples/scripts/comparison_examples/exp_UKF.py diff --git a/examples/scripts/maximum_a_posteriori.py b/examples/scripts/comparison_examples/maximum_a_posteriori.py similarity index 100% rename from examples/scripts/maximum_a_posteriori.py rename to examples/scripts/comparison_examples/maximum_a_posteriori.py diff --git a/examples/scripts/maximum_likelihood.py b/examples/scripts/comparison_examples/maximum_likelihood.py similarity index 100% rename from examples/scripts/maximum_likelihood.py rename to examples/scripts/comparison_examples/maximum_likelihood.py diff --git a/examples/scripts/selecting_a_solver.py b/examples/scripts/comparison_examples/selecting_a_solver.py similarity index 100% rename from examples/scripts/selecting_a_solver.py rename to examples/scripts/comparison_examples/selecting_a_solver.py diff --git a/examples/scripts/spm_AdamW.py b/examples/scripts/comparison_examples/spm_AdamW.py similarity index 100% rename from examples/scripts/spm_AdamW.py rename to examples/scripts/comparison_examples/spm_AdamW.py diff --git a/examples/scripts/spm_CMAES.py b/examples/scripts/comparison_examples/spm_CMAES.py similarity index 100% rename from examples/scripts/spm_CMAES.py rename to examples/scripts/comparison_examples/spm_CMAES.py diff --git a/examples/scripts/spm_IRPropMin.py b/examples/scripts/comparison_examples/spm_IRPropMin.py similarity index 100% rename from examples/scripts/spm_IRPropMin.py rename to examples/scripts/comparison_examples/spm_IRPropMin.py diff --git a/examples/scripts/spm_NelderMead.py b/examples/scripts/comparison_examples/spm_NelderMead.py similarity index 100% rename from examples/scripts/spm_NelderMead.py rename to examples/scripts/comparison_examples/spm_NelderMead.py diff --git a/examples/scripts/spm_SNES.py b/examples/scripts/comparison_examples/spm_SNES.py similarity index 100% rename from examples/scripts/spm_SNES.py rename to examples/scripts/comparison_examples/spm_SNES.py diff --git a/examples/scripts/spm_UKF.py b/examples/scripts/comparison_examples/spm_UKF.py similarity index 100% rename from examples/scripts/spm_UKF.py rename to examples/scripts/comparison_examples/spm_UKF.py diff --git a/examples/scripts/spm_XNES.py b/examples/scripts/comparison_examples/spm_XNES.py similarity index 100% rename from examples/scripts/spm_XNES.py rename to examples/scripts/comparison_examples/spm_XNES.py diff --git a/examples/scripts/spm_descent.py b/examples/scripts/comparison_examples/spm_descent.py similarity index 100% rename from examples/scripts/spm_descent.py rename to examples/scripts/comparison_examples/spm_descent.py diff --git a/examples/scripts/spm_pso.py b/examples/scripts/comparison_examples/spm_pso.py similarity index 100% rename from examples/scripts/spm_pso.py rename to examples/scripts/comparison_examples/spm_pso.py diff --git a/examples/scripts/spm_scipymin.py b/examples/scripts/comparison_examples/spm_scipymin.py similarity index 93% rename from examples/scripts/spm_scipymin.py rename to examples/scripts/comparison_examples/spm_scipymin.py index caaa26c4c..36265b9e8 100644 --- a/examples/scripts/spm_scipymin.py +++ b/examples/scripts/comparison_examples/spm_scipymin.py @@ -3,7 +3,7 @@ import pybop # Form dataset -Measurements = pd.read_csv("examples/scripts/Chen_example.csv", comment="#").to_numpy() +Measurements = pd.read_csv("examples/data/Chen_example.csv", comment="#").to_numpy() dataset = pybop.Dataset( { "Time [s]": Measurements[:, 0], diff --git a/examples/scripts/maximising_energy.py b/examples/scripts/design_optimisation/maximising_energy.py similarity index 100% rename from examples/scripts/maximising_energy.py rename to examples/scripts/design_optimisation/maximising_energy.py diff --git a/examples/scripts/maximising_power.py b/examples/scripts/design_optimisation/maximising_power.py similarity index 100% rename from examples/scripts/maximising_power.py rename to examples/scripts/design_optimisation/maximising_power.py diff --git a/examples/scripts/BPX_spm.py b/examples/scripts/getting_started/BPX_spm.py similarity index 100% rename from examples/scripts/BPX_spm.py rename to examples/scripts/getting_started/BPX_spm.py diff --git a/examples/scripts/functional_parameters.py b/examples/scripts/getting_started/functional_parameters.py similarity index 100% rename from examples/scripts/functional_parameters.py rename to examples/scripts/getting_started/functional_parameters.py diff --git a/examples/scripts/linked_parameters.py b/examples/scripts/getting_started/linked_parameters.py similarity index 100% rename from examples/scripts/linked_parameters.py rename to examples/scripts/getting_started/linked_parameters.py diff --git a/examples/scripts/mcmc_example.py b/examples/scripts/getting_started/mcmc_example.py similarity index 100% rename from examples/scripts/mcmc_example.py rename to examples/scripts/getting_started/mcmc_example.py diff --git a/examples/scripts/multi_fitting.py b/examples/scripts/getting_started/multi_fitting.py similarity index 100% rename from examples/scripts/multi_fitting.py rename to examples/scripts/getting_started/multi_fitting.py diff --git a/examples/scripts/spm_weighted_cost.py b/examples/scripts/getting_started/spm_weighted_cost.py similarity index 100% rename from examples/scripts/spm_weighted_cost.py rename to examples/scripts/getting_started/spm_weighted_cost.py diff --git a/tests/integration/test_monte_carlo_thevenin.py b/tests/integration/test_monte_carlo_thevenin.py index 39ae02408..13f83a29f 100644 --- a/tests/integration/test_monte_carlo_thevenin.py +++ b/tests/integration/test_monte_carlo_thevenin.py @@ -40,7 +40,7 @@ def setup(self): @pytest.fixture def model(self): parameter_set = pybop.ParameterSet( - json_path="examples/scripts/parameters/initial_ecm_parameters.json" + json_path="examples/parameters/initial_ecm_parameters.json" ) parameter_set.import_parameters() parameter_set.params.update( diff --git a/tests/integration/test_thevenin_parameterisation.py b/tests/integration/test_thevenin_parameterisation.py index 7db6f1e4a..2b4bdabd1 100644 --- a/tests/integration/test_thevenin_parameterisation.py +++ b/tests/integration/test_thevenin_parameterisation.py @@ -20,7 +20,7 @@ def setup(self): @pytest.fixture def model(self): parameter_set = pybop.ParameterSet( - json_path="examples/scripts/parameters/initial_ecm_parameters.json" + json_path="examples/parameters/initial_ecm_parameters.json" ) parameter_set.import_parameters() parameter_set.params.update( diff --git a/tests/integration/test_transformation.py b/tests/integration/test_transformation.py index 79e416105..65a477755 100644 --- a/tests/integration/test_transformation.py +++ b/tests/integration/test_transformation.py @@ -21,7 +21,7 @@ def setup(self): @pytest.fixture def model(self): parameter_set = pybop.ParameterSet( - json_path="examples/scripts/parameters/initial_ecm_parameters.json" + json_path="examples/parameters/initial_ecm_parameters.json" ) parameter_set.import_parameters() parameter_set.params.update( diff --git a/tests/unit/test_models.py b/tests/unit/test_models.py index 02c321171..0f789dbc5 100644 --- a/tests/unit/test_models.py +++ b/tests/unit/test_models.py @@ -355,7 +355,7 @@ def test_basemodel(self): @pytest.mark.unit def test_thevenin_model(self): parameter_set = pybop.ParameterSet( - json_path="examples/scripts/parameters/initial_ecm_parameters.json" + json_path="examples/parameters/initial_ecm_parameters.json" ) parameter_set.import_parameters() assert parameter_set["Open-circuit voltage [V]"] == "default" diff --git a/tests/unit/test_parameter_sets.py b/tests/unit/test_parameter_sets.py index 3c4c116b9..35dbd9c1c 100644 --- a/tests/unit/test_parameter_sets.py +++ b/tests/unit/test_parameter_sets.py @@ -38,7 +38,7 @@ def test_ecm_parameter_sets(self): json_params.import_parameters() json_params = pybop.ParameterSet( - json_path="examples/scripts/parameters/initial_ecm_parameters.json" + json_path="examples/parameters/initial_ecm_parameters.json" ) json_params.import_parameters() @@ -94,14 +94,14 @@ def test_ecm_parameter_sets(self): ), ) params.export_parameters( - "examples/scripts/parameters/fit_ecm_parameters.json", fit_params=parameters + "examples/parameters/fit_ecm_parameters.json", fit_params=parameters ) # Test error when there no parameters to export empty_params = pybop.ParameterSet() with pytest.raises(ValueError): empty_params.export_parameters( - "examples/scripts/parameters/fit_ecm_parameters.json" + "examples/parameters/fit_ecm_parameters.json" ) @pytest.mark.unit @@ -115,7 +115,7 @@ def test_bpx_parameter_sets(self): bpx_parameters.import_from_bpx() bpx_parameters = pybop.ParameterSet( - json_path="examples/scripts/parameters/example_BPX.json" + json_path="examples/parameters/example_BPX.json" ) bpx_parameters.import_from_bpx() From 55d78d9aa470be9936faca63dca5eb86852de512 Mon Sep 17 00:00:00 2001 From: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:49:09 +0000 Subject: [PATCH 2/5] Update file paths --- .../equivalent_circuit_identification_hppc.ipynb | 4 ++-- .../equivalent_circuit_identification_multipulse.ipynb | 2 +- .../monte_carlo_ecm_identification.ipynb | 4 ++-- .../single_pulse_circuit_model.ipynb | 6 +++--- .../notebooks/getting_started/optimiser_interface.ipynb | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb b/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb index e144cd825..cb13dc55d 100644 --- a/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb +++ b/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_hppc.ipynb @@ -141,7 +141,7 @@ "metadata": {}, "outputs": [], "source": [ - "file_loc = r\"../data/Samsung_INR21700/sample_hppc_pulse.xlsx\"\n", + "file_loc = r\"../../data/Samsung_INR21700/sample_hppc_pulse.xlsx\"\n", "df = pd.read_excel(file_loc, index_col=None, na_values=[\"NA\"])\n", "df = df.drop_duplicates(subset=[\"Time\"], keep=\"first\")\n", "\n", @@ -459,7 +459,7 @@ "metadata": {}, "outputs": [], "source": [ - "file_loc = r\"../data/Samsung_INR21700/sample_drive_cycle.xlsx\"\n", + "file_loc = r\"../../data/Samsung_INR21700/sample_drive_cycle.xlsx\"\n", "df = pd.read_excel(file_loc, sheet_name=\"Sheet3\", index_col=None, na_values=[\"NA\"])\n", "\n", "# Remove duplicate rows, keeping the first occurrence\n", diff --git a/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_multipulse.ipynb b/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_multipulse.ipynb index 3a67cffc3..e4e4a7401 100644 --- a/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_multipulse.ipynb +++ b/examples/notebooks/battery_parameterisation/equivalent_circuit_identification_multipulse.ipynb @@ -144,7 +144,7 @@ "metadata": {}, "outputs": [], "source": [ - "file_loc = r\"../data/Samsung_INR21700/multipulse_hppc.xlsx\"\n", + "file_loc = r\"../../data/Samsung_INR21700/multipulse_hppc.xlsx\"\n", "df = pd.read_excel(file_loc, index_col=None, na_values=[\"NA\"])\n", "df = df.drop_duplicates(subset=[\"Time\"], keep=\"first\")\n", "\n", diff --git a/examples/notebooks/battery_parameterisation/monte_carlo_ecm_identification.ipynb b/examples/notebooks/battery_parameterisation/monte_carlo_ecm_identification.ipynb index 6625f8333..730a51311 100644 --- a/examples/notebooks/battery_parameterisation/monte_carlo_ecm_identification.ipynb +++ b/examples/notebooks/battery_parameterisation/monte_carlo_ecm_identification.ipynb @@ -63,7 +63,7 @@ "outputs": [], "source": [ "ocv_df = pd.read_csv(\n", - " \"../data/Tesla_4680/T-cell_pOCV_data.txt\",\n", + " \"../../data/Tesla_4680/T-cell_pOCV_data.txt\",\n", " sep=\"\\t\",\n", " decimal=\",\",\n", ")" @@ -217,7 +217,7 @@ ], "source": [ "cycling_df = pd.read_csv(\n", - " \"../data/Tesla_4680/601-828_Capacity_03_MB_CB1_subset.txt\",\n", + " \"../../data/Tesla_4680/601-828_Capacity_03_MB_CB1_subset.txt\",\n", " sep=\"\\t\",\n", ")\n", "filter_cycling = cycling_df.loc[54811:61000].copy() # Full cycle is [54811:127689]\n", diff --git a/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb b/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb index 88b300641..f02147b28 100644 --- a/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb +++ b/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb @@ -135,13 +135,13 @@ "outputs": [], "source": [ "ocp = loadmat(\n", - " \"../data/LG_M50_ECM/data/LGM50_5Ah_OCV.mat\", simplify_cells=True, mat_dtype=False\n", + " \"../../data/LG_M50_ECM/data/LGM50_5Ah_OCV.mat\", simplify_cells=True, mat_dtype=False\n", ")\n", "pulse_data = loadmat(\n", - " \"../data/LG_M50_ECM/data/LGM50_5Ah_Pulse.mat\", simplify_cells=True, mat_dtype=False\n", + " \"../../data/LG_M50_ECM/data/LGM50_5Ah_Pulse.mat\", simplify_cells=True, mat_dtype=False\n", ")\n", "rate_data = loadmat(\n", - " \"../data/LG_M50_ECM/data/LGM50_5Ah_RateTest.mat\",\n", + " \"../../data/LG_M50_ECM/data/LGM50_5Ah_RateTest.mat\",\n", " simplify_cells=True,\n", " mat_dtype=False,\n", ")" diff --git a/examples/notebooks/getting_started/optimiser_interface.ipynb b/examples/notebooks/getting_started/optimiser_interface.ipynb index 8aa6978e6..7c3fb6ac5 100644 --- a/examples/notebooks/getting_started/optimiser_interface.ipynb +++ b/examples/notebooks/getting_started/optimiser_interface.ipynb @@ -104,7 +104,7 @@ "source": [ "# Load the parameters\n", "parameter_set = pybop.ParameterSet(\n", - " json_path=\"../scripts/parameters/initial_ecm_parameters.json\"\n", + " json_path=\"../../parameters/initial_ecm_parameters.json\"\n", ")\n", "parameter_set.import_parameters()\n", "# Define the model\n", From 96372816b834f6107edd613f1e8e76c80f318278 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:49:35 +0000 Subject: [PATCH 3/5] style: pre-commit fixes --- .../battery_parameterisation/single_pulse_circuit_model.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb b/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb index f02147b28..dec6e812f 100644 --- a/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb +++ b/examples/notebooks/battery_parameterisation/single_pulse_circuit_model.ipynb @@ -138,7 +138,9 @@ " \"../../data/LG_M50_ECM/data/LGM50_5Ah_OCV.mat\", simplify_cells=True, mat_dtype=False\n", ")\n", "pulse_data = loadmat(\n", - " \"../../data/LG_M50_ECM/data/LGM50_5Ah_Pulse.mat\", simplify_cells=True, mat_dtype=False\n", + " \"../../data/LG_M50_ECM/data/LGM50_5Ah_Pulse.mat\",\n", + " simplify_cells=True,\n", + " mat_dtype=False,\n", ")\n", "rate_data = loadmat(\n", " \"../../data/LG_M50_ECM/data/LGM50_5Ah_RateTest.mat\",\n", From a357e9683ff63bc798e1e46e04d3fa14c0112124 Mon Sep 17 00:00:00 2001 From: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:11:26 +0000 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b574c0e5..a33fad57b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Features +- [#282](https://github.com/pybop-team/PyBOP/issues/282) - Restructures the examples directory. - [#452](https://github.com/pybop-team/PyBOP/issues/452) - Extends `cell_mass` and `approximate_capacity` for half-cell models. - [#544](https://github.com/pybop-team/PyBOP/issues/544) - Allows iterative plotting using `StandardPlot`. - [#541](https://github.com/pybop-team/PyBOP/pull/541) - Adds `ScaledLogLikelihood` and `BaseMetaLikelihood` classes. From a3306625638f7e473720c50b3bf0202b8d8623a0 Mon Sep 17 00:00:00 2001 From: NicolaCourtier <45851982+NicolaCourtier@users.noreply.github.com> Date: Tue, 19 Nov 2024 22:21:59 +0000 Subject: [PATCH 5/5] Move example --- examples/scripts/{ => battery_parameterisation}/ecm_with_tau.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/scripts/{ => battery_parameterisation}/ecm_with_tau.py (100%) diff --git a/examples/scripts/ecm_with_tau.py b/examples/scripts/battery_parameterisation/ecm_with_tau.py similarity index 100% rename from examples/scripts/ecm_with_tau.py rename to examples/scripts/battery_parameterisation/ecm_with_tau.py