sierra.core.pipeline.stage5.intra_scenario_comparator

Classes for comparing deliverables within the same scenario.

Univariate and bivariate batch criteria.

class sierra.core.pipeline.stage5.intra_scenario_comparator.UnivarIntraScenarioComparator(controllers: List[str], cc_csv_root: Path, cc_graph_root: Path, cmdopts: Dict[str, Any], cli_args, main_config: Dict[str, Any])[source]

Compares a set of controllers within each of a set of scenarios.

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

Univariate batch criteria only.

controllers

List of controller names to compare.

cc_csv_root

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

cc_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 UnivarIntraScenarioComparator
__call__(graphs: List[Dict[str, Any]], legend: List[str], comp_type: str) None[source]

Call self as a function.

__dict__ = mappingproxy({'__module__': 'sierra.core.pipeline.stage5.intra_scenario_comparator', '__doc__': 'Compares a set of controllers within each of a set of scenarios.\n\n    Graph generation\n    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        controllers: List of controller names to compare.\n\n        cc_csv_root: Absolute directory path to the location controller CSV\n                     files should be output to.\n\n        cc_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 UnivarIntraScenarioComparator.__init__>, '__call__': <function UnivarIntraScenarioComparator.__call__>, '_leaf_select': <function UnivarIntraScenarioComparator._leaf_select>, '_compare_in_scenario': <function UnivarIntraScenarioComparator._compare_in_scenario>, '_gen_csv': <function UnivarIntraScenarioComparator._gen_csv>, '_gen_graph': <function UnivarIntraScenarioComparator._gen_graph>, '__dict__': <attribute '__dict__' of 'UnivarIntraScenarioComparator' objects>, '__weakref__': <attribute '__weakref__' of 'UnivarIntraScenarioComparator' objects>, '__annotations__': {}})
__doc__ = 'Compares a set of controllers within each of a set of scenarios.\n\n    Graph generation\n    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        controllers: List of controller names to compare.\n\n        cc_csv_root: Absolute directory path to the location controller CSV\n                     files should be output to.\n\n        cc_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__(controllers: List[str], cc_csv_root: Path, cc_graph_root: Path, cmdopts: Dict[str, Any], cli_args, main_config: Dict[str, Any]) None[source]
__module__ = 'sierra.core.pipeline.stage5.intra_scenario_comparator'
__weakref__

list of weak references to the object (if defined)

_compare_in_scenario(cmdopts: Dict[str, Any], graph: Dict[str, Any], batch_leaf: str, legend: List[str]) None[source]
_gen_csv(batch_leaf: str, criteria: IConcreteBatchCriteria, cmdopts: Dict[str, Any], controller: str, src_stem: str, dest_stem: str, inc_exps: Optional[str]) None[source]

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

1 CSV per controller.

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

Generate a graph comparing the specified controllers within a scenario.

_leaf_select(candidate: str) bool[source]

Determine if a controller can be included in the comparison for a scenario.

You can only compare controllers within the scenario directly generated from the value of --batch-criteria; other scenarios will (probably) cause file not found errors.

class sierra.core.pipeline.stage5.intra_scenario_comparator.BivarIntraScenarioComparator(controllers: List[str], cc_csv_root: Path, cc_graph_root: Path, cmdopts: Dict[str, Any], cli_args: Namespace, main_config: Dict[str, Any])[source]

Compares a set of controllers within each of a set of scenarios.

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

Bivariate batch criteria only.

controllers

List of controller names to compare.

cc_csv_root

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

cc_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 BivarIntraScenarioComparator
__call__(graphs: List[Dict[str, Any]], legend: List[str], comp_type: str) None[source]

Call self as a function.

__dict__ = mappingproxy({'__module__': 'sierra.core.pipeline.stage5.intra_scenario_comparator', '__doc__': 'Compares a set of controllers within each of a set of scenarios.\n\n    Graph generation is controlled via a config file\n    parsed in\n    :class:`~sierra.core.pipeline.stage5.pipeline_stage5.PipelineStage5`.\n\n    Bivariate batch criteria only.\n\n    Attributes:\n\n        controllers: List of controller names to compare.\n\n        cc_csv_root: Absolute directory path to the location controller CSV\n                     files should be output to.\n\n        cc_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 BivarIntraScenarioComparator.__init__>, '__call__': <function BivarIntraScenarioComparator.__call__>, '_leaf_select': <function BivarIntraScenarioComparator._leaf_select>, '_compare_in_scenario': <function BivarIntraScenarioComparator._compare_in_scenario>, '_gen_csvs_for_2D_or_3D': <function BivarIntraScenarioComparator._gen_csvs_for_2D_or_3D>, '_gen_csvs_for_1D': <function BivarIntraScenarioComparator._gen_csvs_for_1D>, '_gen_graphs1D': <function BivarIntraScenarioComparator._gen_graphs1D>, '_gen_graphs2D': <function BivarIntraScenarioComparator._gen_graphs2D>, '_gen_paired_heatmaps': <function BivarIntraScenarioComparator._gen_paired_heatmaps>, '_gen_dual_heatmaps': <function BivarIntraScenarioComparator._gen_dual_heatmaps>, '_gen_graph3D': <function BivarIntraScenarioComparator._gen_graph3D>, '_gen_zaxis_label': <function BivarIntraScenarioComparator._gen_zaxis_label>, '__dict__': <attribute '__dict__' of 'BivarIntraScenarioComparator' objects>, '__weakref__': <attribute '__weakref__' of 'BivarIntraScenarioComparator' objects>, '__annotations__': {}})
__doc__ = 'Compares a set of controllers within each of a set of scenarios.\n\n    Graph generation is controlled via a config file\n    parsed in\n    :class:`~sierra.core.pipeline.stage5.pipeline_stage5.PipelineStage5`.\n\n    Bivariate batch criteria only.\n\n    Attributes:\n\n        controllers: List of controller names to compare.\n\n        cc_csv_root: Absolute directory path to the location controller CSV\n                     files should be output to.\n\n        cc_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__(controllers: List[str], cc_csv_root: Path, cc_graph_root: Path, cmdopts: Dict[str, Any], cli_args: Namespace, main_config: Dict[str, Any]) None[source]
__module__ = 'sierra.core.pipeline.stage5.intra_scenario_comparator'
__weakref__

list of weak references to the object (if defined)

_compare_in_scenario(cmdopts: Dict[str, Any], graph: Dict[str, Any], batch_leaf: str, legend: List[str], comp_type: str) None[source]

Compare all controllers within the specified scenario.

Generates CSV files and graphs according to configuration.

_gen_csvs_for_1D(cmdopts: Dict[str, Any], criteria: IConcreteBatchCriteria, batch_leaf: str, controller: str, src_stem: str, dest_stem: str, primary_axis: int, inc_exps: Optional[str]) None[source]

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

Because we are targeting linegraphs, we draw the the i-th row/col (as configured) from the performance results of each controller .csv, and concatenate them into a new .csv file which can be given to SummaryLineGraph.

_gen_csvs_for_2D_or_3D(cmdopts: Dict[str, Any], batch_leaf: str, controller: str, src_stem: str, dest_stem: str) None[source]

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

1 CSV per controller, for 2D/3D comparison types only. Because each CSV file corresponding to performance measures are 2D arrays, we actually just copy and rename the performance measure CSV files for each controllers into cc_csv_root.

StackedSurfaceGraph expects an _[0-9]+.csv pattern for each 2D surfaces to graph in order to disambiguate which files belong to which controller without having the controller name in the filepath (contains dots), so we do that here. Heatmap does not require that, but for the heatmap set we generate it IS helpful to have an easy way to differentiate primary vs. other controllers, so we do it unconditionally here to handle both cases.

_gen_dual_heatmaps(batch_leaf: str, criteria: BivarBatchCriteria, cmdopts: Dict[str, Any], dest_stem: str, title: str, label: str, legend: List[str], comp_type: str) None[source]

Generate a set of DualHeatmap graphs.

Graphs contain all pairings of (primary controller, other), one per graph, within the specified scenario after input files have been gathered from each controller into cc_csv_root. Only valid if the comparison type is HMraw.

_gen_graph3D(batch_leaf: str, criteria: BivarBatchCriteria, cmdopts: Dict[str, Any], dest_stem: str, title: str, zlabel: str, legend: List[str], comp_type: str) None[source]

Generate a graph comparing the specified controllers within a scenario.

Graph contains the specified controllers within thes pecified scenario after input files have been gathered from each controllers into cc_csv_root.

_gen_graphs1D(batch_leaf: str, criteria: BivarBatchCriteria, cmdopts: Dict[str, Any], dest_stem: str, title: str, label: str, primary_axis: int, inc_exps: Optional[str], legend: List[str]) None[source]
_gen_graphs2D(batch_leaf: str, criteria: BivarBatchCriteria, cmdopts: Dict[str, Any], dest_stem: str, title: str, label: str, legend: List[str], comp_type: str) None[source]
_gen_paired_heatmaps(batch_leaf: str, criteria: BivarBatchCriteria, cmdopts: Dict[str, Any], dest_stem: str, title: str, label: str, comp_type: str) None[source]

Generate a set of Heatmap graphs.

Uses a configured controller of primary interest against all other controllers (one graph per pairing), after input files have been gathered from each controller into cc_csv_root.

_gen_zaxis_label(label: str, comp_type: str) str[source]

If the comparison type is not “raw”, put it on the graph as Z axis title.

_leaf_select(candidate: str) bool[source]

Determine if a controller can be included in the comparison for a scenario.

You can only compare controllers within the scenario directly generated from the value of --batch-criteria; other scenarios will (probably) cause file not found errors.