sierra-research 1.3.11__py3-none-any.whl → 1.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sierra/__init__.py +3 -3
- sierra/core/__init__.py +3 -3
- sierra/core/batchroot.py +223 -0
- sierra/core/cmdline.py +681 -1057
- sierra/core/compare.py +11 -0
- sierra/core/config.py +96 -88
- sierra/core/engine.py +306 -0
- sierra/core/execenv.py +380 -0
- sierra/core/expdef.py +11 -0
- sierra/core/experiment/__init__.py +1 -0
- sierra/core/experiment/bindings.py +150 -101
- sierra/core/experiment/definition.py +414 -245
- sierra/core/experiment/spec.py +83 -85
- sierra/core/exproot.py +44 -0
- sierra/core/generators/__init__.py +10 -0
- sierra/core/generators/experiment.py +528 -0
- sierra/core/generators/generator_factory.py +138 -137
- sierra/core/graphs/__init__.py +23 -0
- sierra/core/graphs/bcbridge.py +94 -0
- sierra/core/graphs/heatmap.py +245 -324
- sierra/core/graphs/pathset.py +27 -0
- sierra/core/graphs/schema.py +77 -0
- sierra/core/graphs/stacked_line.py +341 -0
- sierra/core/graphs/summary_line.py +506 -0
- sierra/core/logging.py +3 -2
- sierra/core/models/__init__.py +3 -1
- sierra/core/models/info.py +19 -0
- sierra/core/models/interface.py +52 -122
- sierra/core/pipeline/__init__.py +2 -5
- sierra/core/pipeline/pipeline.py +228 -126
- sierra/core/pipeline/stage1/__init__.py +10 -0
- sierra/core/pipeline/stage1/pipeline_stage1.py +45 -31
- sierra/core/pipeline/stage2/__init__.py +10 -0
- sierra/core/pipeline/stage2/pipeline_stage2.py +8 -11
- sierra/core/pipeline/stage2/runner.py +401 -0
- sierra/core/pipeline/stage3/__init__.py +12 -0
- sierra/core/pipeline/stage3/gather.py +321 -0
- sierra/core/pipeline/stage3/pipeline_stage3.py +37 -84
- sierra/core/pipeline/stage4/__init__.py +12 -2
- sierra/core/pipeline/stage4/pipeline_stage4.py +36 -354
- sierra/core/pipeline/stage5/__init__.py +12 -0
- sierra/core/pipeline/stage5/pipeline_stage5.py +33 -208
- sierra/core/pipeline/yaml.py +48 -0
- sierra/core/plugin.py +529 -62
- sierra/core/proc.py +11 -0
- sierra/core/prod.py +11 -0
- sierra/core/ros1/__init__.py +5 -1
- sierra/core/ros1/callbacks.py +22 -21
- sierra/core/ros1/cmdline.py +59 -88
- sierra/core/ros1/generators.py +159 -175
- sierra/core/ros1/variables/__init__.py +3 -0
- sierra/core/ros1/variables/exp_setup.py +122 -116
- sierra/core/startup.py +106 -76
- sierra/core/stat_kernels.py +4 -5
- sierra/core/storage.py +13 -32
- sierra/core/trampoline.py +30 -0
- sierra/core/types.py +116 -71
- sierra/core/utils.py +103 -106
- sierra/core/variables/__init__.py +1 -1
- sierra/core/variables/base_variable.py +12 -17
- sierra/core/variables/batch_criteria.py +387 -481
- sierra/core/variables/builtin.py +135 -0
- sierra/core/variables/exp_setup.py +19 -39
- sierra/core/variables/population_size.py +72 -76
- sierra/core/variables/variable_density.py +44 -68
- sierra/core/vector.py +1 -1
- sierra/main.py +256 -88
- sierra/plugins/__init__.py +119 -0
- sierra/plugins/compare/__init__.py +14 -0
- sierra/plugins/compare/graphs/__init__.py +19 -0
- sierra/plugins/compare/graphs/cmdline.py +120 -0
- sierra/plugins/compare/graphs/comparator.py +291 -0
- sierra/plugins/compare/graphs/inter_controller.py +531 -0
- sierra/plugins/compare/graphs/inter_scenario.py +297 -0
- sierra/plugins/compare/graphs/namecalc.py +53 -0
- sierra/plugins/compare/graphs/outputroot.py +73 -0
- sierra/plugins/compare/graphs/plugin.py +147 -0
- sierra/plugins/compare/graphs/preprocess.py +172 -0
- sierra/plugins/compare/graphs/schema.py +37 -0
- sierra/plugins/engine/__init__.py +14 -0
- sierra/plugins/engine/argos/__init__.py +18 -0
- sierra/plugins/{platform → engine}/argos/cmdline.py +144 -151
- sierra/plugins/{platform/argos/variables → engine/argos/generators}/__init__.py +5 -0
- sierra/plugins/engine/argos/generators/engine.py +394 -0
- sierra/plugins/engine/argos/plugin.py +393 -0
- sierra/plugins/{platform/argos/generators → engine/argos/variables}/__init__.py +5 -0
- sierra/plugins/engine/argos/variables/arena_shape.py +183 -0
- sierra/plugins/engine/argos/variables/cameras.py +240 -0
- sierra/plugins/engine/argos/variables/constant_density.py +112 -0
- sierra/plugins/engine/argos/variables/exp_setup.py +82 -0
- sierra/plugins/{platform → engine}/argos/variables/physics_engines.py +83 -87
- sierra/plugins/engine/argos/variables/population_constant_density.py +178 -0
- sierra/plugins/engine/argos/variables/population_size.py +115 -0
- sierra/plugins/engine/argos/variables/population_variable_density.py +123 -0
- sierra/plugins/engine/argos/variables/rendering.py +108 -0
- sierra/plugins/engine/ros1gazebo/__init__.py +18 -0
- sierra/plugins/engine/ros1gazebo/cmdline.py +175 -0
- sierra/plugins/{platform/ros1robot → engine/ros1gazebo}/generators/__init__.py +5 -0
- sierra/plugins/engine/ros1gazebo/generators/engine.py +125 -0
- sierra/plugins/engine/ros1gazebo/plugin.py +404 -0
- sierra/plugins/engine/ros1gazebo/variables/__init__.py +15 -0
- sierra/plugins/engine/ros1gazebo/variables/population_size.py +214 -0
- sierra/plugins/engine/ros1robot/__init__.py +18 -0
- sierra/plugins/engine/ros1robot/cmdline.py +159 -0
- sierra/plugins/{platform/ros1gazebo → engine/ros1robot}/generators/__init__.py +4 -0
- sierra/plugins/engine/ros1robot/generators/engine.py +95 -0
- sierra/plugins/engine/ros1robot/plugin.py +410 -0
- sierra/plugins/{hpc/local → engine/ros1robot/variables}/__init__.py +5 -0
- sierra/plugins/engine/ros1robot/variables/population_size.py +146 -0
- sierra/plugins/execenv/__init__.py +11 -0
- sierra/plugins/execenv/hpc/__init__.py +18 -0
- sierra/plugins/execenv/hpc/adhoc/__init__.py +18 -0
- sierra/plugins/execenv/hpc/adhoc/cmdline.py +30 -0
- sierra/plugins/execenv/hpc/adhoc/plugin.py +131 -0
- sierra/plugins/execenv/hpc/cmdline.py +137 -0
- sierra/plugins/execenv/hpc/local/__init__.py +18 -0
- sierra/plugins/execenv/hpc/local/cmdline.py +31 -0
- sierra/plugins/execenv/hpc/local/plugin.py +145 -0
- sierra/plugins/execenv/hpc/pbs/__init__.py +18 -0
- sierra/plugins/execenv/hpc/pbs/cmdline.py +30 -0
- sierra/plugins/execenv/hpc/pbs/plugin.py +121 -0
- sierra/plugins/execenv/hpc/slurm/__init__.py +18 -0
- sierra/plugins/execenv/hpc/slurm/cmdline.py +30 -0
- sierra/plugins/execenv/hpc/slurm/plugin.py +133 -0
- sierra/plugins/execenv/prefectserver/__init__.py +18 -0
- sierra/plugins/execenv/prefectserver/cmdline.py +66 -0
- sierra/plugins/execenv/prefectserver/dockerremote/__init__.py +18 -0
- sierra/plugins/execenv/prefectserver/dockerremote/cmdline.py +66 -0
- sierra/plugins/execenv/prefectserver/dockerremote/plugin.py +132 -0
- sierra/plugins/execenv/prefectserver/flow.py +66 -0
- sierra/plugins/execenv/prefectserver/local/__init__.py +18 -0
- sierra/plugins/execenv/prefectserver/local/cmdline.py +29 -0
- sierra/plugins/execenv/prefectserver/local/plugin.py +133 -0
- sierra/plugins/{hpc/adhoc → execenv/robot}/__init__.py +1 -0
- sierra/plugins/execenv/robot/turtlebot3/__init__.py +18 -0
- sierra/plugins/execenv/robot/turtlebot3/plugin.py +204 -0
- sierra/plugins/expdef/__init__.py +14 -0
- sierra/plugins/expdef/json/__init__.py +14 -0
- sierra/plugins/expdef/json/plugin.py +504 -0
- sierra/plugins/expdef/xml/__init__.py +14 -0
- sierra/plugins/expdef/xml/plugin.py +386 -0
- sierra/{core/hpc → plugins/proc}/__init__.py +1 -1
- sierra/plugins/proc/collate/__init__.py +15 -0
- sierra/plugins/proc/collate/cmdline.py +47 -0
- sierra/plugins/proc/collate/plugin.py +271 -0
- sierra/plugins/proc/compress/__init__.py +18 -0
- sierra/plugins/proc/compress/cmdline.py +47 -0
- sierra/plugins/proc/compress/plugin.py +123 -0
- sierra/plugins/proc/decompress/__init__.py +18 -0
- sierra/plugins/proc/decompress/plugin.py +96 -0
- sierra/plugins/proc/imagize/__init__.py +15 -0
- sierra/plugins/proc/imagize/cmdline.py +49 -0
- sierra/plugins/proc/imagize/plugin.py +270 -0
- sierra/plugins/proc/modelrunner/__init__.py +16 -0
- sierra/plugins/proc/modelrunner/plugin.py +250 -0
- sierra/plugins/proc/statistics/__init__.py +15 -0
- sierra/plugins/proc/statistics/cmdline.py +64 -0
- sierra/plugins/proc/statistics/plugin.py +390 -0
- sierra/plugins/{hpc → prod}/__init__.py +1 -0
- sierra/plugins/prod/graphs/__init__.py +18 -0
- sierra/plugins/prod/graphs/cmdline.py +269 -0
- sierra/plugins/prod/graphs/collate.py +279 -0
- sierra/plugins/prod/graphs/inter/__init__.py +13 -0
- sierra/plugins/prod/graphs/inter/generate.py +83 -0
- sierra/plugins/prod/graphs/inter/heatmap.py +86 -0
- sierra/plugins/prod/graphs/inter/line.py +134 -0
- sierra/plugins/prod/graphs/intra/__init__.py +15 -0
- sierra/plugins/prod/graphs/intra/generate.py +202 -0
- sierra/plugins/prod/graphs/intra/heatmap.py +74 -0
- sierra/plugins/prod/graphs/intra/line.py +114 -0
- sierra/plugins/prod/graphs/plugin.py +103 -0
- sierra/plugins/prod/graphs/targets.py +63 -0
- sierra/plugins/prod/render/__init__.py +18 -0
- sierra/plugins/prod/render/cmdline.py +72 -0
- sierra/plugins/prod/render/plugin.py +282 -0
- sierra/plugins/storage/__init__.py +5 -0
- sierra/plugins/storage/arrow/__init__.py +18 -0
- sierra/plugins/storage/arrow/plugin.py +38 -0
- sierra/plugins/storage/csv/__init__.py +9 -0
- sierra/plugins/storage/csv/plugin.py +12 -5
- sierra/version.py +3 -2
- sierra_research-1.5.0.dist-info/METADATA +238 -0
- sierra_research-1.5.0.dist-info/RECORD +186 -0
- {sierra_research-1.3.11.dist-info → sierra_research-1.5.0.dist-info}/WHEEL +1 -2
- sierra/core/experiment/xml.py +0 -454
- sierra/core/generators/controller_generator_parser.py +0 -34
- sierra/core/generators/exp_creator.py +0 -351
- sierra/core/generators/exp_generators.py +0 -142
- sierra/core/graphs/scatterplot2D.py +0 -109
- sierra/core/graphs/stacked_line_graph.py +0 -251
- sierra/core/graphs/stacked_surface_graph.py +0 -220
- sierra/core/graphs/summary_line_graph.py +0 -371
- sierra/core/hpc/cmdline.py +0 -142
- sierra/core/models/graphs.py +0 -87
- sierra/core/pipeline/stage2/exp_runner.py +0 -286
- sierra/core/pipeline/stage3/imagizer.py +0 -149
- sierra/core/pipeline/stage3/run_collator.py +0 -317
- sierra/core/pipeline/stage3/statistics_calculator.py +0 -478
- sierra/core/pipeline/stage4/graph_collator.py +0 -320
- sierra/core/pipeline/stage4/inter_exp_graph_generator.py +0 -240
- sierra/core/pipeline/stage4/intra_exp_graph_generator.py +0 -317
- sierra/core/pipeline/stage4/model_runner.py +0 -168
- sierra/core/pipeline/stage4/rendering.py +0 -283
- sierra/core/pipeline/stage4/yaml_config_loader.py +0 -103
- sierra/core/pipeline/stage5/inter_scenario_comparator.py +0 -328
- sierra/core/pipeline/stage5/intra_scenario_comparator.py +0 -989
- sierra/core/platform.py +0 -493
- sierra/core/plugin_manager.py +0 -369
- sierra/core/root_dirpath_generator.py +0 -241
- sierra/plugins/hpc/adhoc/plugin.py +0 -125
- sierra/plugins/hpc/local/plugin.py +0 -81
- sierra/plugins/hpc/pbs/__init__.py +0 -9
- sierra/plugins/hpc/pbs/plugin.py +0 -126
- sierra/plugins/hpc/slurm/__init__.py +0 -9
- sierra/plugins/hpc/slurm/plugin.py +0 -130
- sierra/plugins/platform/__init__.py +0 -9
- sierra/plugins/platform/argos/__init__.py +0 -9
- sierra/plugins/platform/argos/generators/platform_generators.py +0 -383
- sierra/plugins/platform/argos/plugin.py +0 -337
- sierra/plugins/platform/argos/variables/arena_shape.py +0 -145
- sierra/plugins/platform/argos/variables/cameras.py +0 -243
- sierra/plugins/platform/argos/variables/constant_density.py +0 -136
- sierra/plugins/platform/argos/variables/exp_setup.py +0 -113
- sierra/plugins/platform/argos/variables/population_constant_density.py +0 -175
- sierra/plugins/platform/argos/variables/population_size.py +0 -102
- sierra/plugins/platform/argos/variables/population_variable_density.py +0 -132
- sierra/plugins/platform/argos/variables/rendering.py +0 -104
- sierra/plugins/platform/ros1gazebo/__init__.py +0 -9
- sierra/plugins/platform/ros1gazebo/cmdline.py +0 -213
- sierra/plugins/platform/ros1gazebo/generators/platform_generators.py +0 -137
- sierra/plugins/platform/ros1gazebo/plugin.py +0 -335
- sierra/plugins/platform/ros1gazebo/variables/__init__.py +0 -10
- sierra/plugins/platform/ros1gazebo/variables/population_size.py +0 -204
- sierra/plugins/platform/ros1robot/__init__.py +0 -9
- sierra/plugins/platform/ros1robot/cmdline.py +0 -175
- sierra/plugins/platform/ros1robot/generators/platform_generators.py +0 -112
- sierra/plugins/platform/ros1robot/plugin.py +0 -373
- sierra/plugins/platform/ros1robot/variables/__init__.py +0 -10
- sierra/plugins/platform/ros1robot/variables/population_size.py +0 -146
- sierra/plugins/robot/__init__.py +0 -9
- sierra/plugins/robot/turtlebot3/__init__.py +0 -9
- sierra/plugins/robot/turtlebot3/plugin.py +0 -194
- sierra_research-1.3.11.data/data/share/man/man1/sierra-cli.1 +0 -2349
- sierra_research-1.3.11.data/data/share/man/man7/sierra-examples.7 +0 -508
- sierra_research-1.3.11.data/data/share/man/man7/sierra-exec-envs.7 +0 -331
- sierra_research-1.3.11.data/data/share/man/man7/sierra-glossary.7 +0 -285
- sierra_research-1.3.11.data/data/share/man/man7/sierra-platforms.7 +0 -358
- sierra_research-1.3.11.data/data/share/man/man7/sierra-usage.7 +0 -729
- sierra_research-1.3.11.data/data/share/man/man7/sierra.7 +0 -78
- sierra_research-1.3.11.dist-info/METADATA +0 -492
- sierra_research-1.3.11.dist-info/RECORD +0 -133
- sierra_research-1.3.11.dist-info/top_level.txt +0 -1
- {sierra_research-1.3.11.dist-info → sierra_research-1.5.0.dist-info}/entry_points.txt +0 -0
- {sierra_research-1.3.11.dist-info → sierra_research-1.5.0.dist-info/licenses}/LICENSE +0 -0
@@ -2,236 +2,61 @@
|
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MIT
|
4
4
|
|
5
|
-
"""Stage 5 of the experimental pipeline: comparing deliverables.
|
6
|
-
|
7
|
-
"""
|
5
|
+
"""Stage 5 of the experimental pipeline: comparing deliverables."""
|
8
6
|
|
9
7
|
# Core packages
|
10
8
|
import logging
|
11
|
-
import
|
9
|
+
import time
|
10
|
+
import datetime
|
11
|
+
import argparse
|
12
12
|
|
13
13
|
# 3rd party packages
|
14
|
-
import yaml
|
15
14
|
|
16
15
|
# Project packages
|
17
|
-
from sierra.core
|
18
|
-
|
19
|
-
import sierra.core.root_dirpath_generator as rdg
|
20
|
-
from sierra.core import types, utils, config
|
16
|
+
from sierra.core import types
|
17
|
+
import sierra.core.plugin as pm
|
21
18
|
|
22
19
|
|
23
20
|
class PipelineStage5:
|
24
|
-
"""Compare controllers
|
25
|
-
|
26
|
-
This can be either:
|
27
|
-
|
28
|
-
#. Compare a set of controllers within the same scenario using performance
|
29
|
-
measures specified in YAML configuration.
|
30
|
-
|
31
|
-
#. Compare a single controller across a set ofscenarios using performance
|
32
|
-
measures specified in YAML configuration.
|
33
|
-
|
34
|
-
This stage is idempotent.
|
21
|
+
"""Compare generated products across controllers, scenarios, or batch criteria.
|
35
22
|
|
36
23
|
Attributes:
|
37
|
-
|
38
24
|
cmdopts: Dictionary of parsed cmdline parameters.
|
39
25
|
|
40
|
-
controllers: List of controllers to compare.
|
41
|
-
|
42
26
|
main_config: Dictionary of parsed main YAML configuration.
|
43
27
|
|
44
|
-
|
45
|
-
|
46
|
-
output_roots: Dictionary containing output directories for intra- and
|
47
|
-
inter-scenario graph generation.
|
28
|
+
stage5_roots: Dictionary containing output directories for
|
29
|
+
inter-{scenario,controller,criteria} product comparison.
|
48
30
|
|
49
31
|
"""
|
50
32
|
|
51
|
-
def __init__(
|
52
|
-
|
53
|
-
|
33
|
+
def __init__(
|
34
|
+
self,
|
35
|
+
main_config: types.YAMLDict,
|
36
|
+
cmdopts: types.Cmdopts,
|
37
|
+
) -> None:
|
54
38
|
self.cmdopts = cmdopts
|
55
39
|
self.main_config = main_config
|
56
40
|
|
57
|
-
path = pathlib.Path(self.cmdopts['project_config_root'],
|
58
|
-
config.kYAML.stage5)
|
59
|
-
|
60
|
-
with utils.utf8open(path) as f:
|
61
|
-
self.stage5_config = yaml.load(f, yaml.FullLoader)
|
62
|
-
|
63
41
|
self.logger = logging.getLogger(__name__)
|
64
42
|
|
65
|
-
|
66
|
-
|
67
|
-
self.output_roots = {
|
68
|
-
# We add the controller list to the directory path for the .csv
|
69
|
-
# and graph directories so that multiple runs of stage5 with
|
70
|
-
# different controller sets do not overwrite each other
|
71
|
-
# (i.e. make stage5 more idempotent).
|
72
|
-
'graphs': pathlib.Path(self.cmdopts['sierra_root'],
|
73
|
-
self.cmdopts['project'],
|
74
|
-
'+'.join(self.controllers) + "-cc-graphs"),
|
75
|
-
'csvs': pathlib.Path(self.cmdopts['sierra_root'],
|
76
|
-
self.cmdopts['project'],
|
77
|
-
'+'.join(self.controllers) + "-cc-csvs"),
|
78
|
-
}
|
79
|
-
|
80
|
-
else:
|
81
|
-
self.controllers = []
|
82
|
-
|
83
|
-
if self.cmdopts['scenarios_list'] is not None:
|
84
|
-
self.scenarios = self.cmdopts['scenarios_list'].split(',')
|
85
|
-
self.output_roots = {
|
86
|
-
# We add the scenario list to the directory path for the .csv
|
87
|
-
# and graph directories so that multiple runs of stage5 with
|
88
|
-
# different scenario sets do not overwrite each other (i.e. make
|
89
|
-
# stage5 idempotent).
|
90
|
-
'graphs': pathlib.Path(self.cmdopts['sierra_root'],
|
91
|
-
self.cmdopts['project'],
|
92
|
-
'+'.join(self.scenarios) + "-sc-graphs"),
|
93
|
-
'csvs': pathlib.Path(self.cmdopts['sierra_root'],
|
94
|
-
self.cmdopts['project'],
|
95
|
-
'+'.join(self.scenarios) + "-sc-csvs"),
|
96
|
-
'models': pathlib.Path(self.cmdopts['sierra_root'],
|
97
|
-
self.cmdopts['project'],
|
98
|
-
'+'.join(self.scenarios) + "-sc-models"),
|
99
|
-
}
|
100
|
-
|
101
|
-
else:
|
102
|
-
self.scenarios = []
|
103
|
-
|
104
|
-
self.project_root = pathlib.Path(self.cmdopts['sierra_root'],
|
105
|
-
self.cmdopts['project'])
|
106
|
-
|
107
|
-
def run(self, cli_args) -> None:
|
108
|
-
"""Run stage 5 of the experimental pipeline.
|
109
|
-
|
110
|
-
If ``--controller-comparison`` was passed:
|
111
|
-
|
112
|
-
#. :class:`~sierra.core.pipeline.stage5.intra_scenario_comparator.UnivarIntraScenarioComparator`
|
113
|
-
or
|
114
|
-
:class:`~sierra.core.pipeline.stage5.intra_scenario_comparator.BivarIntraScenarioComparator`
|
115
|
-
as appropriate, depending on which type of
|
116
|
-
:class:`~sierra.core.variables.batch_criteria.BatchCriteria` was
|
117
|
-
selected on the cmdline.
|
118
|
-
|
119
|
-
If ``--scenario-comparison`` was passed:
|
120
|
-
|
121
|
-
#. :class:`~sierra.core.pipeline.stage5.inter_scenario_comparator.UnivarInterScenarioComparator`
|
122
|
-
(only valid for univariate batch criteria currently).
|
123
|
-
|
124
|
-
"""
|
125
|
-
# Create directories for .csv files and graphs
|
126
|
-
for v in self.output_roots.values():
|
127
|
-
utils.dir_create_checked(v, True)
|
128
|
-
|
129
|
-
if self.cmdopts['controller_comparison']:
|
130
|
-
self._run_cc(cli_args)
|
131
|
-
elif self.cmdopts['scenario_comparison']:
|
132
|
-
self._run_sc(cli_args)
|
133
|
-
|
134
|
-
def _run_cc(self, cli_args):
|
135
|
-
# Use nice controller names on graph legends if configured
|
136
|
-
if self.cmdopts['controllers_legend'] is not None:
|
137
|
-
legend = self.cmdopts['controllers_legend'].split(',')
|
138
|
-
else:
|
139
|
-
legend = self.controllers
|
140
|
-
|
141
|
-
self._verify_comparability(self.controllers, cli_args)
|
142
|
-
|
43
|
+
def run(self, cli_args: argparse.Namespace) -> None:
|
44
|
+
spec = self.cmdopts["compare"]
|
143
45
|
self.logger.info(
|
144
|
-
"
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
cli_args,
|
162
|
-
self.main_config)
|
163
|
-
bivar(graphs=self.stage5_config['intra_scenario']['graphs'],
|
164
|
-
legend=legend,
|
165
|
-
comp_type=self.cmdopts['comparison_type'])
|
166
|
-
|
167
|
-
self.logger.info("Inter-batch controller comparison complete")
|
168
|
-
|
169
|
-
def _run_sc(self, cli_args):
|
170
|
-
# Use nice scenario names on graph legends if configured
|
171
|
-
if self.cmdopts['scenarios_legend'] is not None:
|
172
|
-
legend = self.cmdopts['scenarios_legend'].split(',')
|
173
|
-
else:
|
174
|
-
legend = self.scenarios
|
175
|
-
|
176
|
-
self.logger.info("Inter-batch comparison of %s across %s...",
|
177
|
-
self.cmdopts['controller'],
|
178
|
-
self.scenarios)
|
179
|
-
|
180
|
-
assert cli_args.bc_univar,\
|
181
|
-
"inter-scenario controller comparison only valid for univariate batch criteria"
|
182
|
-
|
183
|
-
roots = {k: self.output_roots[k] for k in ('csvs', 'graphs', 'models')}
|
184
|
-
comparator = intersc.UnivarInterScenarioComparator(self.cmdopts['controller'],
|
185
|
-
self.scenarios,
|
186
|
-
roots,
|
187
|
-
self.cmdopts,
|
188
|
-
cli_args,
|
189
|
-
self.main_config)
|
190
|
-
|
191
|
-
comparator(graphs=self.stage5_config['inter_scenario']['graphs'],
|
192
|
-
legend=legend)
|
193
|
-
|
194
|
-
self.logger.info("Inter-batch comparison of %s across %s complete",
|
195
|
-
self.cmdopts['controller'],
|
196
|
-
self.scenarios)
|
197
|
-
|
198
|
-
def _verify_comparability(self, controllers, cli_args):
|
199
|
-
"""Check if the specified controllers can be compared.
|
200
|
-
|
201
|
-
Comparable controllers have all been run on the same set of batch
|
202
|
-
experiments. If they have not, it is not `necessarily` an error, but
|
203
|
-
probably should be looked at, so it is only a warning, not fatal.
|
204
|
-
|
205
|
-
"""
|
206
|
-
for t1 in controllers:
|
207
|
-
for item in (self.project_root / t1).iterdir():
|
208
|
-
template_stem, scenario, _ = rdg.parse_batch_leaf(item.name)
|
209
|
-
batch_leaf = rdg.gen_batch_leaf(cli_args.batch_criteria,
|
210
|
-
template_stem,
|
211
|
-
scenario)
|
212
|
-
|
213
|
-
for t2 in controllers:
|
214
|
-
opts1 = rdg.regen_from_exp(sierra_rpath=self.cmdopts['sierra_root'],
|
215
|
-
project=self.cmdopts['project'],
|
216
|
-
batch_leaf=batch_leaf,
|
217
|
-
controller=t1)
|
218
|
-
opts2 = rdg.regen_from_exp(sierra_rpath=self.cmdopts['sierra_root'],
|
219
|
-
project=self.cmdopts['project'],
|
220
|
-
batch_leaf=batch_leaf,
|
221
|
-
controller=t2)
|
222
|
-
collate_root1 = opts1['batch_stat_collate_root']
|
223
|
-
collate_root2 = opts2['batch_stat_collate_root']
|
224
|
-
|
225
|
-
if scenario in str(collate_root1) and scenario not in str(collate_root2):
|
226
|
-
self.logger.warning("%s does not exist in %s",
|
227
|
-
scenario,
|
228
|
-
collate_root2)
|
229
|
-
if scenario in str(collate_root2) and scenario not in str(collate_root1):
|
230
|
-
self.logger.warning("%s does not exist in %s",
|
231
|
-
scenario,
|
232
|
-
collate_root1)
|
233
|
-
|
234
|
-
|
235
|
-
__api__ = [
|
236
|
-
'PipelineStage5'
|
237
|
-
]
|
46
|
+
"Comparing products with %s comparison plugins: %s", len(spec), spec
|
47
|
+
)
|
48
|
+
for s in spec:
|
49
|
+
module = pm.pipeline.get_plugin_module(s)
|
50
|
+
self.logger.info(
|
51
|
+
"Running %s",
|
52
|
+
s,
|
53
|
+
)
|
54
|
+
|
55
|
+
start = time.time()
|
56
|
+
module.proc_exps(self.main_config, self.cmdopts, cli_args)
|
57
|
+
elapsed = int(time.time() - start)
|
58
|
+
sec = datetime.timedelta(seconds=elapsed)
|
59
|
+
self.logger.info("Processing with %s complete in %s", s, str(sec))
|
60
|
+
|
61
|
+
|
62
|
+
__all__ = ["PipelineStage5"]
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Copyright 2021 John Harwell, All rights reserved.
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: MIT
|
4
|
+
"""
|
5
|
+
Functionality for loading configuration from YAML.
|
6
|
+
"""
|
7
|
+
# Core packages
|
8
|
+
import typing as tp
|
9
|
+
import logging
|
10
|
+
import pathlib
|
11
|
+
|
12
|
+
# 3rd party packages
|
13
|
+
import yaml
|
14
|
+
|
15
|
+
# Project packages
|
16
|
+
from sierra.core import types, utils
|
17
|
+
|
18
|
+
_logger = logging.getLogger(__name__)
|
19
|
+
|
20
|
+
|
21
|
+
def load_config(cmdopts: types.Cmdopts, name: str) -> tp.Optional[types.YAMLDict]:
|
22
|
+
"""Load YAML configuration for :term:`Project`.
|
23
|
+
|
24
|
+
Load YAML configuration for projects.
|
25
|
+
|
26
|
+
Returns:
|
27
|
+
Dictionary of loaded configuration, or None if it doesn't exist.
|
28
|
+
|
29
|
+
This function can be extended/overriden using a :term:`Project` hook. See
|
30
|
+
:ref:`tutorials/project/hooks` for details.
|
31
|
+
|
32
|
+
"""
|
33
|
+
root = pathlib.Path(cmdopts["project_config_root"])
|
34
|
+
path = root / name
|
35
|
+
|
36
|
+
if utils.path_exists(path):
|
37
|
+
_logger.info(
|
38
|
+
"Config for project %s from %s",
|
39
|
+
cmdopts["project"],
|
40
|
+
path,
|
41
|
+
)
|
42
|
+
with utils.utf8open(path) as f:
|
43
|
+
return yaml.load(f, yaml.FullLoader)
|
44
|
+
|
45
|
+
return None
|
46
|
+
|
47
|
+
|
48
|
+
__all__ = ["load_config"]
|