experimental.new_evaluator.simulation_output.i_simulation_output_evaluator module
Define the base object for SimulationOutput
evaluators.
- class ISimulationOutputEvaluator(reference: SimulationOutput, plotter: PandasPlotter)
Bases:
IEvaluator
Base class for
SimulationOutput
evaluations.- __init__(reference: SimulationOutput, plotter: PandasPlotter) None
Instantiate with a reference simulation output.
- _abc_impl = <_abc._abc_data object>
- _constant_limits: bool
- final _default_dummy(quantity: str) ndarray[Any, dtype[float64]]
Give dummy ydata, with expected shape if possible.
Also, set
_dump_no_numerical_data_to_plot
to avoid future pandas plotter errors.
- _dump_no_numerical_data_to_plot: bool = False
- final _evaluate_single(post_treated: ndarray[Any, dtype[float64]], lower_limit: ndarray[Any, dtype[float64]] | float = nan, upper_limit: ndarray[Any, dtype[float64]] | float = nan, nan_in_data_is_allowed: bool = False, **kwargs) bool
Check that
post_treated
is within limits.- Parameters:
post_treated (npt.NDArray[np.float64]) – Data, already post-treated. If there is
np.nan
in this array, we consider that the test if failed.lower_limit (npt.NDArray[np.float64] | float, optional) – Min/max value for data. Where it is
np.nan
, the test is passed.upper_limit (npt.NDArray[np.float64] | float, optional) – Min/max value for data. Where it is
np.nan
, the test is passed.nan_in_data_is_allowed (boolean, optional) – If the test is valid where
post_treated
is NaN. Use for example with synchronous phases, which is Nan when not in a cavity.
- Returns:
test – If the data is always within the given limits.
- Return type:
bool
- _get_kwargs: dict[str, bool | str | None]
- _get_n_interpolate(simulation_output: SimulationOutput, interp: bool = True, **kwargs) ndarray[Any, dtype[float64]]
Give ydata from one simulation, with proper number of points.
- _getter(simulation_output: SimulationOutput, quantity: str) ndarray[Any, dtype[float64]]
Call the
get
method with proper kwarguments.
- _pos: str | None = None
- _to_deg: bool = True
- _x_quantity: str = 'z_abs'
- get(*simulation_outputs: SimulationOutput, **kwargs) ndarray[Any, dtype[float64]]
Get the data from the simulation outputs.
- plot(post_treated: ndarray[Any, dtype[float64]], elts: Sequence[ListOfElements] | None = None, png_folders: Sequence[Path] | None = None, lower_limits: Sequence[Iterable[float]] | Sequence[float] | None = None, upper_limits: Sequence[Iterable[float]] | Sequence[float] | None = None, keep_nan: bool = False, style: Sequence[str] | None = None, **kwargs: Any) Any
Plot all the post treated data using
plotter
.
- property png_filename: str
Give a filename for consistent saving of figures.