sierra.core.pipeline.stage5.inter_scenario_comparator

Classes for comparing deliverables across a set of scenarios.

Univariate batch criteria only. The same controller must be used for all scenarios.

class sierra.core.pipeline.stage5.inter_scenario_comparator.UnivarInterScenarioComparator(controller: str, scenarios: List[str], roots: Dict[str, Path], cmdopts: Dict[str, Any], cli_args: Namespace, main_config: Dict[str, Any])[source]

Compares a single controller across a set of scenarios.

Graph generation is controlled via a config file parsed in PipelineStage5.

Univariate batch criteria only.

controller

Controller to use.

scenarios

List of scenario names to compare controller across.

sc_csv_root

Absolute directory path to the location scenario CSV files should be output to.

sc_graph_root

Absolute directory path to the location the generated graphs should be output to.

cmdopts

Dictionary of parsed cmdline parameters.

cli_args

argparse object containing the cmdline parameters. Needed for BatchCriteria generation for each scenario controllers are compared within, as batch criteria is dependent on controller+scenario definition, and needs to be re-generated for each scenario in order to get graph labels/axis ticks to come out right in all cases.

Inheritance

Inheritance diagram of UnivarInterScenarioComparator
__call__(graphs: List[Dict[str, Any]], legend: List[str]) None[source]

Call self as a function.

__dict__ = mappingproxy({'__module__': 'sierra.core.pipeline.stage5.inter_scenario_comparator', '__doc__': 'Compares a single controller across a set of scenarios.\n\n    Graph generation is controlled via a config file parsed in\n    :class:`~sierra.core.pipeline.stage5.pipeline_stage5.PipelineStage5`.\n\n    Univariate batch criteria only.\n\n    Attributes:\n\n        controller: Controller to use.\n\n        scenarios: List of scenario names to compare ``controller`` across.\n\n        sc_csv_root: Absolute directory path to the location scenario CSV\n                     files should be output to.\n\n        sc_graph_root: Absolute directory path to the location the generated\n                       graphs should be output to.\n\n        cmdopts: Dictionary of parsed cmdline parameters.\n\n        cli_args: :class:`argparse` object containing the cmdline\n                  parameters. Needed for\n                  :class:`~sierra.core.variables.batch_criteria.BatchCriteria`\n                  generation for each scenario controllers are compared within,\n                  as batch criteria is dependent on controller+scenario\n                  definition, and needs to be re-generated for each scenario in\n                  order to get graph labels/axis ticks to come out right in all\n                  cases.\n\n    ', '__init__': <function UnivarInterScenarioComparator.__init__>, '__call__': <function UnivarInterScenarioComparator.__call__>, '_leaf_select': <function UnivarInterScenarioComparator._leaf_select>, '_compare_across_scenarios': <function UnivarInterScenarioComparator._compare_across_scenarios>, '_gen_graph': <function UnivarInterScenarioComparator._gen_graph>, '_gen_csvs': <function UnivarInterScenarioComparator._gen_csvs>, '_accum_df': <function UnivarInterScenarioComparator._accum_df>, '__dict__': <attribute '__dict__' of 'UnivarInterScenarioComparator' objects>, '__weakref__': <attribute '__weakref__' of 'UnivarInterScenarioComparator' objects>, '__annotations__': {}})
__doc__ = 'Compares a single controller across a set of scenarios.\n\n    Graph generation is controlled via a config file parsed in\n    :class:`~sierra.core.pipeline.stage5.pipeline_stage5.PipelineStage5`.\n\n    Univariate batch criteria only.\n\n    Attributes:\n\n        controller: Controller to use.\n\n        scenarios: List of scenario names to compare ``controller`` across.\n\n        sc_csv_root: Absolute directory path to the location scenario CSV\n                     files should be output to.\n\n        sc_graph_root: Absolute directory path to the location the generated\n                       graphs should be output to.\n\n        cmdopts: Dictionary of parsed cmdline parameters.\n\n        cli_args: :class:`argparse` object containing the cmdline\n                  parameters. Needed for\n                  :class:`~sierra.core.variables.batch_criteria.BatchCriteria`\n                  generation for each scenario controllers are compared within,\n                  as batch criteria is dependent on controller+scenario\n                  definition, and needs to be re-generated for each scenario in\n                  order to get graph labels/axis ticks to come out right in all\n                  cases.\n\n    '
__init__(controller: str, scenarios: List[str], roots: Dict[str, Path], cmdopts: Dict[str, Any], cli_args: Namespace, main_config: Dict[str, Any]) None[source]
__module__ = 'sierra.core.pipeline.stage5.inter_scenario_comparator'
__weakref__

list of weak references to the object (if defined)

_accum_df(ipath: Path, opath: Path, src_stem: str) DataFrame[source]
_compare_across_scenarios(cmdopts: Dict[str, Any], graph: Dict[str, Any], batch_leaf: str, legend: List[str]) None[source]
_gen_csvs(cmdopts: Dict[str, Any], batch_leaf: str, src_stem: str, dest_stem: str) None[source]

Generate a set of CSV files for use in inter-scenario graph generation.

Generates:

  • .mean CSV file containing results for each scenario the controller

    is being compared across, 1 per line.

  • Stastics CSV files containing various statistics for the .mean CSV file, 1 per line.

  • .model file containing model predictions for controller behavior during each scenario, 1 per line (not generated if models were not run the performance measures we are generating graphs for).

  • .legend file containing legend values for models to plot (not generated if models were not run for the performance measures we are generating graphs for).

_gen_graph(criteria: IConcreteBatchCriteria, cmdopts: Dict[str, Any], dest_stem: str, inc_exps: Optional[str], title: str, label: str, legend: List[str]) None[source]

Generate graph comparing the specified controller across scenarios.

_leaf_select(candidate: str) bool[source]

Figure out if a batch experiment root should be included in the comparison.

Inclusion determined by if a scenario that the selected controller has been run on in the past is part of the set passed that the controller should be compared across (i.e., the controller is not compared across all scenarios it has ever been run on).