compare_runs module

Define functions to compare several runs based on their evaluations.csv.

concatenate_evaluation_files(simulation_id, evaluation_folder, evaluation_namecol)[source]

Load the file and rename column header.

Parameters:
  • simulation_id (str) – Name that will be given to the simulation in the plot.

  • evaluation_folder (Path) – Folder where the evaluations.csv file is.

  • evaluation_namecol (str) – Name of the column in the evaluations.csv file.

Return type:

DataFrame

Returns:

Holds all the values of evaluation_namecol in evaluation_path; new name of the column is simulation_id.

_compare_one_quantity_all_simulations(simulation_ids_and_paths, evaluation_namecol, y_label)[source]

Load and plot all the given files.

Parameters:
  • simulation_ids_and_paths (dict[str, Path]) – Keys are name of the simulation in the plot, values are corresponding evaluations.csv path.

  • evaluation_namecol (str) – Name of the column to take in evaluations.csv.

  • y_label (str) – Name of the y-axis in the plot.

Return type:

None

compare_simulations(simulation_ids_and_paths, studies)[source]

Perform all defined studies.

Parameters:
  • simulation_ids_and_paths (dict[str, Path]) – Keys are name of the simulation in the plot, values are corresponding evaluations.csv path.

  • studies (dict[str, str]) – Keys are the y-labels of the plots, values are corresponding column names in evaluations.csv.

Return type:

None

Examples

>>> simulation_ids_and_paths = {"leapfrog": "run_1/evaluations.csv",
                                "downhill": "run2/evaluations.csv"}
>>> studies = {"Lost power [W]", "lost power shall be null",
               "Relative emittance increase", "emittance increase"}
>>> compare_simulations(simulation_ids_and_paths, studies)