Skip to content

abc

CalibrationABC

Abstract base class for calibration classes.

Fitness abstractmethod property

Fitness: Type[FitnessBase]

io abstractmethod property

io: Self

parameters abstractmethod property

parameters: List[str]

calibrate

calibrate(
    experiments: Union[
        "Experiment", List["Experiment"], Dict[str, "Experiment"]
    ],
    *,
    includes: List[str | CalibrationKey] | None = None,
    include_additions: List[str | CalibrationKey] | None = None,
    excludes: List[str | CalibrationKey] | None = None,
    experiment_specific_parameters: List[str] | None = None,
    x0: Dict[str | CalibrationKey, float] | None = None,
    bounds: Dict[str | CalibrationKey, Tuple[float, float]] | None = None,
    stds: Dict[str | CalibrationKey, float] | None = None,
    fitness: Union["FitnessBase", Type["FitnessBase"], str, None] = None,
    error_fitness: float = 10000000000.0,
    method: str = "PYCMA-CMAES",
    save_to: str | None = None,
    **kwargs
) -> Tuple[Dict[str, float], OptimizerResult]

Calibrate the yield function to the experiments.

PARAMETER DESCRIPTION
experiments

Experiments to evaluate the fitness, by default None which means all experiments in the manager

TYPE: Experiment | List[Experiment] | Dict[str, Experiment]

includes

Parameters to include in the calibration, by default None which means all parameters

TYPE: List[str | CalibrationKey] DEFAULT: None

include_additions

Additional parameters to include in the calibration, by default None

TYPE: List[str | CalibrationKey] DEFAULT: None

excludes

Parameters to exclude from the calibration, by default None

TYPE: List[str | CalibrationKey] DEFAULT: None

experiment_specific_parameters

Optimization parameters that are specific to each experiment, by default None

TYPE: List[str] DEFAULT: None

x0

Initial guess for the parameters, by default None

TYPE: Dict[str | CalibrationKey, float] DEFAULT: None

bounds

Bounds for the parameters, by default None

TYPE: Dict[str | CalibrationKey, Tuple[float, float]] DEFAULT: None

stds

Standard deviations for the parameters, by default None

TYPE: Dict[str | CalibrationKey, float] DEFAULT: None

fitness

Custom fitness object or class or the full name of the class, by default None

TYPE: FitnessBase | Type[FitnessBase] | str DEFAULT: None

error_fitness

Fitness value to return if the simulation fails, by default 1e10

TYPE: float DEFAULT: 10000000000.0

method

Optimization method, by default "PYCMA-CMAES"

TYPE: str DEFAULT: 'PYCMA-CMAES'

save_to

Save the calibration results to a file, by default None

TYPE: str DEFAULT: None

kwargs

Fitness or optimizer keyword arguments, if the fitness has attributes with the same name, the value will be set to the attribute, and other arguments will be passed to the optimizer

DEFAULT: {}

RETURNS DESCRIPTION
Tuple[Dict[str, float], OptimizerResult]

Optimized parameters and the optimization result

fitness

fitness(
    experiments: Union[
        "Experiment", List["Experiment"], Dict[str, "Experiment"]
    ],
    *,
    x0: Dict[str, float] | None = None,
    fitness: Union["FitnessBase", Type["FitnessBase"], str, None] = None,
    error_fitness: float = 10000000000.0,
    **kwargs
) -> float

Evaluate the fitness of the yield function to the experiments.

setParameters

setParameters(params: Dict | None = None, *, force: bool = False, **kwargs)

Set the parameters of the yield function.