CADETProcess.comparison.DifferenceBase

Contents

CADETProcess.comparison.DifferenceBase#

class CADETProcess.comparison.DifferenceBase(reference, components=None, use_total_concentration=False, use_total_concentration_components=True, start=None, end=None, transform=None, resample=True, smooth=False, normalize=False)[source]#

Base class for difference metric evaluation between a reference and a solution.

Parameters:
referenceReferenceIO

Reference used for calculating difference metric.

components{str, list}, optional

Solution components to be considered. If None, all components are considered. The default is None.

use_total_concentrationbool, optional

If True, use sum of all components. The default is False.

use_total_concentration_componentsbool, optional

If True, sum concentration of species. The default is True.

startfloat, optional

End time of solution slice to be considered. The default is None.

endfloat, optional

End time of solution slice to be considered. The default is None.

transformcallable, optional

Function to transform solution. The default is None.

resamplebool, optional

If True, resample data. The default is True.

smoothbool, optional

If True, smooth data. The default is False.

normalizebool, optional

If True, normalize data. The default is False.

Attributes:
bad_metrics

list: Worst case values for each metric.

n_metrics

int: Number of metrics.

reference

SolutionBase: The reference Solution, sliced and transformed.

Methods

__call__(solution)

Compute the difference between the reference solution and the input solution.

checks_dimensions()

Decorator to automatically check reference and solution dimensions.

evaluate(solution)

Compute the difference between the reference solution and the input solution.

resamples_smoothes_and_normalizes_solution()

Decorator to automatically smooth and normalize solution.

slice_and_transform(solution)

Slice the solution and applies the transform callable (if defined).

slices_solution()

Decorator to automatically slice solution.

transforms_solution()

Decorator to automatically transform solution data.