Objectives

The base class for all objectives is Objective.

class ionworkspipeline.objectives.Objective(data_input, options=None, callbacks=None, custom_parameters=None)

A pipeline element that constructs an objective function used to fit a model to data.

Parameters

data_inputstr or dict

The data to use for the fit. Can be a string giving the path to the data, or a dictionary with keys “data” and “metadata”. “data” should be a DataFrame that supplies the raw data, and “metadata” should be a dictionary that supplies metadata about the data.

optionsdict, optional

A dictionary of options to pass to the data fit.

callbacksCallback or list of callbacks

A class with methods that get called at various points during the datafit process

custom_parametersdict of str: float or callable, optional

A dictionary of parameters to use within this objective only. Values in this dictionary will override any values for the simulation within this objective but will not be passed on as results of the DataFit object. If a callable is provided, it must take the form of a function that takes in a dictionary of parameters and the data_input “data” dictionary and returns the value of the parameter (which can be a float or function, as in PyBaMM).

Extends: ionworkspipeline.controllers.OptionsController

class ionworkspipeline.objectives.SimulationObjective(*args, **kwargs)

A pipeline element that constructs an objective function used to fit a model to data. SimulationObjective is a subclass of Objective that intended for use with objectives that run a pybamm simulation.

Parameters

data_inputstr or dict

The data to use for the fit. Can be a string giving the path to the data, or a dictionary with keys “data” and “metadata”. “data” should be a DataFrame that supplies the raw data, and “metadata” should be a dictionary that supplies metadata about the data.

optionsdict, optional

A dictionary of options to pass to the data fit.

callbacksCallback or list of callbacks

A class with methods that get called at various points during the datafit process

custom_parametersdict of str: float or callable, optional

A dictionary of parameters to use within this objective only. Values in this dictionary will override any values for the simulation within this objective but will not be passed on as results of the DataFit object. If a callable is provided, it must take the form of a function that takes in a dictionary of parameters and the data_input “data” dictionary and returns the value of the parameter (which can be a float or function, as in PyBaMM).

Extends: ionworkspipeline.data_fits.objectives.objective.Objective

For the objectives that are implemented in the pipeline, see the following sections.