CADETProcess.comparison.DifferenceBase#
- class CADETProcess.comparison.DifferenceBase(reference: ReferenceBase, components: dict[str, list] | None = None, use_total_concentration: bool = False, use_total_concentration_components: bool = True, start: float | None = None, end: float | None = None, transform: Callable | None = None, only_transforms_array: bool = True, resample: bool = True, smooth: bool = False, normalize: bool = False)[source]#
Bases:
MetricBaseBase class for difference metric evaluation between a reference and a solution.
- Parameters:
- referenceReferenceBase
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.
- checks_dimensions() Callable[source]#
Wrap method automatically check reference and solution dimensions.
- evaluate(solution: SolutionBase) ndarray[source]#
Compute the difference between the reference solution and the input solution.
- Parameters:
- solutionSolution
The solution to compare with the reference solution.
- Returns:
- np.ndarray
The difference between the two solutions.
- property reference: SolutionBase#
SolutionBase: The reference solution.
- resamples_normalizes_and_smoothes_solution() Callable[source]#
Wrap method to automatically resample, normalize, and smooth solution.
- slice_and_transform(solution: SolutionBase) SolutionBase[source]#
Slice the solution and applies the transform callable (if defined).
- Parameters:
- solutionSolution
The solution to slice and transform.
- Returns:
- Solution
The sliced and transformed solution.