post_treaters module
Define the functions used by SimulationOutputEvaluator.
They are dedicated to treat data. They all take a value and a reference value as arguments and return the treated value (ref is unchanged).
- do_nothing(value, ref_value, **kwargs)[source]
Hold the place for a post treater.
If you want to plot the data as imported from the
SimulationOutput, set the first of thepost_treaterskeys to: partial(_do_nothing, to_plot=True)
- set_first_value_to(*args, value, **kwargs)[source]
Set first element of array to
value, sometimes bugs in TW output.
- difference(value, reference_value, **kwargs)[source]
- Overloads:
value (float), reference_value (float), kwargs (bool) → float
value (np.ndarray), reference_value (np.ndarray), kwargs (bool) → np.ndarray
- Parameters:
- Return type:
Compute the difference.
- relative_difference(value, reference_value, replace_zeros_by_nan_in_ref=True, **kwargs)[source]
- Overloads:
value (float), reference_value (float), kwargs (bool) → float
value (np.ndarray), reference_value (np.ndarray), kwargs (bool) → np.ndarray
- Parameters:
- Return type:
Compute the relative difference.
- absolute(*args, **kwargs)[source]
- Overloads:
args (float), kwargs (bool) → float
args (np.ndarray), kwargs (bool) → np.ndarray
- Parameters:
- Return type:
Return the absolute
value.
- scale_by(*args, scale=1.0, **kwargs)[source]
- Overloads:
args (float), scale (float), kwargs → float
args (np.ndarray), scale (np.ndarray | float), kwargs → np.ndarray
- Parameters:
- Return type:
Return
valuescaled byscale.