list_of_simulation_output_evaluators module

Define an object to regroup several SimulationOutputEvaluator.

We also define some factory functions to facilitate their creation.

class ListOfSimulationOutputEvaluators(evaluators)[source]

Bases: list

A simple list of SimulationOutputEvaluator.

Parameters:

evaluators (list[SimulationOutputEvaluator])

__init__(evaluators)[source]

Create the objects (factory).

Parameters:

evaluators (list[SimulationOutputEvaluator])

Return type:

None

run(*simulation_outputs, other_evals=None, project_folder=None, **files_kw)[source]

Run all the evaluations.

Parameters:
  • simulation_outputs (SimulationOutput) – All the simulation output instances.

  • other_evals (dict[str, list[Any]] | None, default: None) – Dictionary with over evaluations to put in the output file. Keys are the column headers, values are corresponding values stored as lists. The default is None, in which case nothing is added.

  • project_folder (Path | None, default: None) – Where to save the output file.

Return type:

DataFrame

Returns:

A dataframe holding the evaluations.

_unpack_other_evals(other_evals)[source]

Extract column names and data.

Parameters:

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

Return type:

tuple[list[str], list[list[Any]]]

_set_indexes(*simulation_outputs)[source]

Set the indexes of the pandas dataframe.

Parameters:

simulation_outputs (SimulationOutput)

Return type:

list[str]

_set_columns(other_columns)[source]

Set the columns of the pandas dataframe.

Parameters:

other_columns (list[str])

Return type:

list[str]

_get_evaluations(other_data, *simulation_outputs)[source]
Parameters:
Return type:

list[list[float | bool | timedelta]]

class FaultScenarioSimulationOutputEvaluators(quantities, objective_factories, simulation_outputs, additional_elts=None)[source]

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.

Parameters:
__init__(quantities, objective_factories, simulation_outputs, additional_elts=None)[source]
Parameters:
Return type:

None

_set_evaluation_elements(objective_factories, additional_elts=None)[source]

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.

Parameters:
Return type:

tuple[list[Element | str], list[str]]

_create_simulation_output_evaluators(ref_simulation_output)[source]

Create the proper SimulationOutputEvaluator s.

Parameters:

ref_simulation_output (SimulationOutput)

Return type:

list[SimulationOutputEvaluator]

run(output=True)[source]

Perform all the simulation output evaluations.

Parameters:

output (bool, default: True)

Return type:

DataFrame

_to_pandas_dataframe(evaluations, precision=3)[source]

Convert all the evaluations to a compact pd.DataFrame.

Parameters:
Return type:

DataFrame

_format_evaluations(evaluations, precision=3)[source]

Prepare the evaluations array for a nice output.

Parameters:
Return type:

list[str]

_output(evaluations)[source]

Print out the given pd.DataFrame.

Parameters:

evaluations (DataFrame)

Return type:

None