evaluator.list_of_simulation_output_evaluators module

Define an object to regroup several SimulationOutputEvaluator.

We also define some factory functions to facilitate their creation.

class FaultScenarioSimulationOutputEvaluators(quantities: tuple[str], faults: list[Fault], simulation_outputs: tuple[SimulationOutputEvaluator], additional_elts: tuple[Element | str] | None = None)

Bases: object

A more specific class to evaluate settings found for a FaultScenario.

This class was designed to be used when all the faults of a FaultScenario are fixed, to output several performance indicators in a compact way. No plot is produced.

__init__(quantities: tuple[str], faults: list[Fault], simulation_outputs: tuple[SimulationOutputEvaluator], additional_elts: tuple[Element | str] | None = None) None
_create_simulation_output_evaluators(ref_simulation_output: SimulationOutput) list[SimulationOutputEvaluator]

Create the proper SimulationOutputEvaluator s.

_format_evaluations(evaluations: list[float | bool | None], precision: int = 3) list[str]

Prepare the evaluations array for a nice output.

_output(evaluations: DataFrame) None

Print out the given pd.DataFrame.

_set_evaluation_elements(faults: list[Fault], additional_elts: tuple[Element | str] | None = None) tuple[list[Element | str], list[str]]

Set where the relative difference of quantities will be evaluated.

It is at the end of each compensation zone, plus at the exit of additional elements if given. Also set columns to ease pandas DataFrame creation.

_to_pandas_dataframe(evaluations: list[float | bool | None], precision: int = 3) DataFrame

Convert all the evaluations to a compact pd.DataFrame.

run(output: bool = True) DataFrame

Perform all the simulation output evaluations.

class ListOfSimulationOutputEvaluators(evaluators: list[SimulationOutputEvaluator])

Bases: list

A simple list of SimulationOutputEvaluator.

__init__(evaluators: list[SimulationOutputEvaluator]) None

Create the objects (factory).

_get_evaluations(other_data: list[list[Any]], *simulation_outputs: SimulationOutput) list[list[float | bool | timedelta]]
_set_columns(other_columns: list[str]) list[str]

Set the columns of the pandas dataframe.

_set_indexes(*simulation_outputs: SimulationOutput) list[str]

Set the indexes of the pandas dataframe.

_unpack_other_evals(other_evals: dict[str, list[Any]] | None) tuple[list[str], list[list[Any]]]

Extract column names and data.

run(*simulation_outputs: SimulationOutput, other_evals: dict[str, list[Any]] | None = None, project_folder: Path | None = None, **files_kw) DataFrame

Run all the evaluations.