-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
Description
Python 3.13 Test Summary
examples/notebooks/battery_parameterisation/ecm_multipulse_identification.ipynb::ecm_multipulse_identification.ipynb: ---------------------------------------------------------------------------
parameter_values.update(result.best_inputs)
sol = pybamm.Simulation(
model, parameter_values=parameter_values, experiment=experiment
).solve(initial_soc=0.95)
# sol.plot();
---------------------------------------------------------------------------
OptionError Traceback (most recent call last)
Cell In[12], line 4
1 parameter_values.update(result.best_inputs)
2 sol = pybamm.Simulation(
3 model, parameter_values=parameter_values, experiment=experiment
----> 4 ).solve(initial_soc=0.95)
5 # sol.plot();
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/simulation.py:865, in Simulation.solve(self, t_eval, solver, save_at_cycles, calc_esoh, starting_solution, initial_soc, direction, callbacks, showprogress, inputs, t_interp, **kwargs)
860 if isinstance(inputs, list):
861 raise pybamm.SolverError(
862 "Solving with a list of input sets is not supported with experiments."
863 )
--> 865 self.build_for_experiment(
866 initial_soc=initial_soc,
867 direction=direction,
868 inputs=inputs,
869 solve_kwargs=kwargs,
870 )
871 if t_eval is not None:
872 pybamm.logger.warning(
873 "Ignoring t_eval as solution times are specified by the experiment"
874 )
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/simulation.py:572, in Simulation.build_for_experiment(self, initial_soc, direction, inputs, solve_kwargs)
567 """
568 Similar to :meth:`Simulation.build`, but for the case of simulating an
569 experiment, where there may be several models and solvers to build.
570 """
571 if initial_soc is not None:
--> 572 self.set_initial_state(initial_soc, direction=direction, inputs=inputs)
574 if self.steps_to_built_models:
575 if self._needs_ic_rebuild:
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/simulation.py:450, in Simulation.set_initial_state(self, initial_soc, direction, inputs)
448 if self._cache_esoh:
449 if self._initial_soc_solver is None:
--> 450 self._initial_soc_solver = self._create_esoh_solver(
451 direction, initial_soc
452 )
453 self._parameter_values = pybamm.lithium_ion.set_initial_state(
454 initial_soc,
455 self._unprocessed_parameter_values,
(...) 461 esoh_solver=self._initial_soc_solver,
462 )
463 else:
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/simulation.py:396, in Simulation._create_esoh_solver(self, direction, initial_soc)
391 pv = self._unprocessed_parameter_values
392 param = self._model.param
394 if options.get("open-circuit potential") == "MSMR" or (
395 options.get("working electrode") != "positive"
--> 396 and not pybamm.lithium_ion.check_if_composite(options, "positive")
397 and not pybamm.lithium_ion.check_if_composite(options, "negative")
398 ):
399 return pybamm.lithium_ion.ElectrodeSOHSolver(
400 pv,
401 direction=direction,
402 param=param,
403 options=options,
404 )
405 elif options.get("working electrode") == "positive":
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/models/full_battery_models/lithium_ion/util.py:6, in check_if_composite(options, electrode)
4 def check_if_composite(options, electrode):
5 if not isinstance(options, pybamm.BatteryModelOptions):
----> 6 options = pybamm.BatteryModelOptions(options)
7 domain_options = getattr(options, electrode)
8 particle_phases = domain_options["particle phases"]
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/models/full_battery_models/base_battery_model.py:566, in BatteryModelOptions.__init__(self, extra_options)
561 raise pybamm.OptionError(
562 "The 'particle cracking' option has been renamed. "
563 "Use 'particle mechanics' instead."
564 )
565 else:
--> 566 raise pybamm.OptionError(
567 f"Option '{name}' not recognised. Best matches are {options.get_best_matches(name)}"
568 )
570 # If any of "open-circuit potential", "particle" or "intercalation kinetics" is
571 # "MSMR" then all of them must be "MSMR".
572 # Note: this check is currently performed on full cells, but is loosened for
573 # half-cells where you must pass a tuple of options to only set MSMR models in
574 # the working electrode
575 msmr_check_list = [
576 options[opt] == "MSMR"
577 for opt in ["open-circuit potential", "particle", "intercalation kinetics"]
578 ]
OptionError: Option 'diffusion element' not recognised. Best matches are ['diffusivity', 'dimensionality']
examples/notebooks/battery_parameterisation/lgm50_pulse_validation.ipynb::lgm50_pulse_validation.ipynb: ---------------------------------------------------------------------------
simulator = pybop.pybamm.Simulator(
model,
parameter_values=parameter_values,
protocol=dataset_two_pulse,
initial_state={"Initial SoC": 0.8 - 0.0075},
)
cost_two_pulse = pybop.SumSquaredError(dataset_two_pulse)
problem = pybop.Problem(simulator, cost_two_pulse)
---------------------------------------------------------------------------
OptionError Traceback (most recent call last)
Cell In[15], line 1
----> 1 simulator = pybop.pybamm.Simulator(
2 model,
3 parameter_values=parameter_values,
4 protocol=dataset_two_pulse,
5 initial_state={"Initial SoC": 0.8 - 0.0075},
6 )
7 cost_two_pulse = pybop.SumSquaredError(dataset_two_pulse)
8 problem = pybop.Problem(simulator, cost_two_pulse)
File ~/work/PyBOP/PyBOP/pybop/pybamm/simulator.py:126, in Simulator.__init__(self, model, parameter_values, initial_state, protocol, solver, output_variables, geometry, submesh_types, var_pts, spatial_methods, discretisation_kwargs, build_every_time)
124 # Build
125 self._input_parameter_names = self.parameters.names
--> 126 self._requires_model_rebuild = self._determine_rebuild_requirement(
127 build_every_time
128 )
129 self._set_up_solution_method(output_variables=output_variables)
File ~/work/PyBOP/PyBOP/pybop/pybamm/simulator.py:205, in Simulator._determine_rebuild_requirement(self, build_every_time)
203 try:
204 self.create_simulation()
--> 205 self._simulation.build(initial_soc=self._initial_state, inputs=None)
206 requires_model_rebuild = False
207 except (ValueError, TypeError, IndexError):
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/simulation.py:540, in Simulation.build(self, initial_soc, direction, inputs)
523 """
524 A method to build the model into a system of matrices and vectors suitable for
525 performing numerical computations. If the model has already been built or
(...) 537 A dictionary of input parameters to pass to the model when solving.
538 """
539 if initial_soc is not None:
--> 540 self.set_initial_state(initial_soc, direction=direction, inputs=inputs)
542 if self._built_model:
543 if self._needs_ic_rebuild:
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/simulation.py:450, in Simulation.set_initial_state(self, initial_soc, direction, inputs)
448 if self._cache_esoh:
449 if self._initial_soc_solver is None:
--> 450 self._initial_soc_solver = self._create_esoh_solver(
451 direction, initial_soc
452 )
453 self._parameter_values = pybamm.lithium_ion.set_initial_state(
454 initial_soc,
455 self._unprocessed_parameter_values,
(...) 461 esoh_solver=self._initial_soc_solver,
462 )
463 else:
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/simulation.py:396, in Simulation._create_esoh_solver(self, direction, initial_soc)
391 pv = self._unprocessed_parameter_values
392 param = self._model.param
394 if options.get("open-circuit potential") == "MSMR" or (
395 options.get("working electrode") != "positive"
--> 396 and not pybamm.lithium_ion.check_if_composite(options, "positive")
397 and not pybamm.lithium_ion.check_if_composite(options, "negative")
398 ):
399 return pybamm.lithium_ion.ElectrodeSOHSolver(
400 pv,
401 direction=direction,
402 param=param,
403 options=options,
404 )
405 elif options.get("working electrode") == "positive":
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/models/full_battery_models/lithium_ion/util.py:6, in check_if_composite(options, electrode)
4 def check_if_composite(options, electrode):
5 if not isinstance(options, pybamm.BatteryModelOptions):
----> 6 options = pybamm.BatteryModelOptions(options)
7 domain_options = getattr(options, electrode)
8 particle_phases = domain_options["particle phases"]
File ~/work/PyBOP/PyBOP/.venv/lib/python3.13/site-packages/pybamm/models/full_battery_models/base_battery_model.py:566, in BatteryModelOptions.__init__(self, extra_options)
561 raise pybamm.OptionError(
562 "The 'particle cracking' option has been renamed. "
563 "Use 'particle mechanics' instead."
564 )
565 else:
--> 566 raise pybamm.OptionError(
567 f"Option '{name}' not recognised. Best matches are {options.get_best_matches(name)}"
568 )
570 # If any of "open-circuit potential", "particle" or "intercalation kinetics" is
571 # "MSMR" then all of them must be "MSMR".
572 # Note: this check is currently performed on full cells, but is loosened for
573 # half-cells where you must pass a tuple of options to only set MSMR models in
574 # the working electrode
575 msmr_check_list = [
576 options[opt] == "MSMR"
577 for opt in ["open-circuit potential", "particle", "intercalation kinetics"]
578 ]
OptionError: Option 'diffusion element' not recognised. Best matches are ['diffusivity', 'dimensionality']
Reactions are currently unavailable