sierra-research 1.3.6__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.6.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 -249
- sierra/core/graphs/stacked_surface_graph.py +0 -220
- sierra/core/graphs/summary_line_graph.py +0 -369
- 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 -319
- 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.6.data/data/share/man/man1/sierra-cli.1 +0 -2349
- sierra_research-1.3.6.data/data/share/man/man7/sierra-examples.7 +0 -488
- sierra_research-1.3.6.data/data/share/man/man7/sierra-exec-envs.7 +0 -331
- sierra_research-1.3.6.data/data/share/man/man7/sierra-glossary.7 +0 -285
- sierra_research-1.3.6.data/data/share/man/man7/sierra-platforms.7 +0 -358
- sierra_research-1.3.6.data/data/share/man/man7/sierra-usage.7 +0 -725
- sierra_research-1.3.6.data/data/share/man/man7/sierra.7 +0 -78
- sierra_research-1.3.6.dist-info/METADATA +0 -500
- sierra_research-1.3.6.dist-info/RECORD +0 -133
- sierra_research-1.3.6.dist-info/top_level.txt +0 -1
- {sierra_research-1.3.6.dist-info → sierra_research-1.5.0.dist-info}/entry_points.txt +0 -0
- {sierra_research-1.3.6.dist-info → sierra_research-1.5.0.dist-info/licenses}/LICENSE +0 -0
sierra/core/cmdline.py
CHANGED
@@ -10,20 +10,22 @@ import sys
|
|
10
10
|
import typing as tp
|
11
11
|
|
12
12
|
# 3rd party packages
|
13
|
+
import psutil
|
13
14
|
|
14
15
|
# Project packages
|
15
16
|
import sierra.version
|
16
17
|
from sierra.core import utils
|
17
18
|
|
18
|
-
kVersionMsg = (
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
kVersionMsg = (
|
20
|
+
"reSearch pIpEline for Reproducibility, Reusability and "
|
21
|
+
f"Automation (SIERRA) v{sierra.version.__version__}.\n"
|
22
|
+
"License: MIT.\n"
|
23
|
+
"This is free software: you are free to change and redistribute it.\n"
|
24
|
+
"SIERRA comes with no warranty.\n\n"
|
25
|
+
"See the documentation at "
|
26
|
+
"https://sierra.readthedocs.io/en/master/,\n"
|
27
|
+
"or 'man sierra' for details.\n"
|
28
|
+
)
|
27
29
|
|
28
30
|
|
29
31
|
class ArgumentParser(argparse.ArgumentParser):
|
@@ -34,16 +36,16 @@ class ArgumentParser(argparse.ArgumentParser):
|
|
34
36
|
|
35
37
|
"""
|
36
38
|
|
37
|
-
kHelpMsg = (
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
kHelpMsg = (
|
40
|
+
"Usage:\n\nsierra-cli [-v | --version] [OPTION]...\n\n"
|
41
|
+
"What command line options SIERRA accepts depends on the loaded\n"
|
42
|
+
"plugin set. 'man sierra-cli' will give you the full set of options\n"
|
43
|
+
"that comes with SIERRA.\n\n"
|
44
|
+
)
|
42
45
|
|
43
46
|
def error(self, message):
|
44
47
|
self.print_usage(sys.stderr)
|
45
|
-
|
46
|
-
self.exit(2, '{0}: error: {1}\n'.format(self.prog, message))
|
48
|
+
self.exit(2, f"{self.prog}: error: {message}\n")
|
47
49
|
|
48
50
|
def print_help(self, file=None):
|
49
51
|
if file is None:
|
@@ -58,25 +60,39 @@ class BaseCmdline:
|
|
58
60
|
|
59
61
|
"""
|
60
62
|
|
63
|
+
def __init__(self) -> None:
|
64
|
+
self.multistage_desc = (
|
65
|
+
"Multi-stage options",
|
66
|
+
"Options which are used in multiple pipeline stages",
|
67
|
+
)
|
68
|
+
self.stage1_desc = "Stage 1 options", "Options for generating experiments"
|
69
|
+
self.stage2_desc = "Stage 2 options", "Options for running experiments"
|
70
|
+
self.stage3_desc = (
|
71
|
+
"Stage 3 options",
|
72
|
+
"Options for processing experiment results",
|
73
|
+
)
|
74
|
+
self.stage4_desc = "Stage 4 options", "Options for generating products"
|
75
|
+
self.stage5_desc = "Stage 5 options", "Options for product comparison"
|
76
|
+
|
61
77
|
@staticmethod
|
62
|
-
def stage_usage_doc(stages: tp.List[int],
|
63
|
-
omitted: str = "If omitted: N/A.") -> str:
|
78
|
+
def stage_usage_doc(stages: tp.List[int], omitted: str = "If omitted: N/A.") -> str:
|
64
79
|
lst = ",".join(map(str, stages))
|
65
|
-
header = "\n.. TIP:: Used by stage {
|
66
|
-
lst
|
80
|
+
header = "\n.. TIP:: Used by stage {0}; can be omitted otherwise. {1}\n".format(
|
81
|
+
lst, omitted
|
82
|
+
)
|
67
83
|
return header
|
68
84
|
|
69
85
|
@staticmethod
|
70
86
|
def bc_applicable_doc(criteria: tp.List[str]) -> str:
|
71
87
|
lst = "".join(map(lambda bc: " - " + bc + "\n", criteria))
|
72
|
-
return "\n.. TIP:: Applicable batch criteria:\n\n
|
88
|
+
return f"\n.. TIP:: Applicable batch criteria:\n\n{lst}\n"
|
73
89
|
|
74
90
|
@staticmethod
|
75
91
|
def graphs_applicable_doc(graphs: tp.List[str]) -> str:
|
76
|
-
lst = "".join(
|
77
|
-
|
78
|
-
|
79
|
-
return "\n.. TIP:: Applicable graphs:\n\n
|
92
|
+
lst = "".join(
|
93
|
+
map(lambda graph: " - " + utils.sphinx_ref(graph) + "\n", graphs)
|
94
|
+
)
|
95
|
+
return f"\n.. TIP:: Applicable graphs:\n\n{lst}\n"
|
80
96
|
|
81
97
|
|
82
98
|
class BootstrapCmdline(BaseCmdline):
|
@@ -85,145 +101,317 @@ class BootstrapCmdline(BaseCmdline):
|
|
85
101
|
"""
|
86
102
|
|
87
103
|
def __init__(self) -> None:
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
bootstrap.add_argument(
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
104
|
+
super().__init__()
|
105
|
+
|
106
|
+
self.parser = ArgumentParser(add_help=True, allow_abbrev=False)
|
107
|
+
|
108
|
+
bootstrap = self.parser.add_argument_group(
|
109
|
+
"Bootstrap options", "Bare-bones options for bootstrapping SIERRA"
|
110
|
+
)
|
111
|
+
|
112
|
+
bootstrap.add_argument(
|
113
|
+
"--project",
|
114
|
+
help="""
|
115
|
+
Specify which :term:`Project` to load.
|
116
|
+
"""
|
117
|
+
+ self.stage_usage_doc([1, 2, 3, 4, 5]),
|
118
|
+
)
|
119
|
+
|
120
|
+
bootstrap.add_argument(
|
121
|
+
"--version",
|
122
|
+
"-v",
|
123
|
+
help="""
|
124
|
+
Display SIERRA version information on stdout and then exit.
|
125
|
+
""",
|
126
|
+
action="store_true",
|
127
|
+
)
|
128
|
+
|
129
|
+
bootstrap.add_argument(
|
130
|
+
"--log-level",
|
131
|
+
choices=["ERROR", "INFO", "WARNING", "DEBUG", "TRACE"],
|
132
|
+
help="""
|
133
|
+
The level of logging to use when running SIERRA.
|
134
|
+
"""
|
135
|
+
+ self.stage_usage_doc([1, 2, 3, 4, 5]),
|
136
|
+
default="INFO",
|
137
|
+
)
|
138
|
+
|
139
|
+
bootstrap.add_argument(
|
140
|
+
"--engine",
|
141
|
+
help="""
|
142
|
+
This argument defines the :term:`Engine` you want to run
|
143
|
+
experiments on.
|
144
|
+
|
145
|
+
The value of this argument determines the execution environment
|
146
|
+
for experiments; different engines (e.g., simulator, real
|
147
|
+
robots) will have different configuration options.
|
148
|
+
|
149
|
+
Valid values can be any folder name inside a folder on the
|
150
|
+
:envvar:`SIERRA_PLUGIN_PATH` (with ``/`` replaced with ``.`` as
|
151
|
+
you would expect for using path names to address python
|
152
|
+
packages). The engines which come with SIERRA are:
|
153
|
+
|
154
|
+
- ``engine.argos`` - This directs SIERRA to run experiments
|
155
|
+
using the :term:`ARGoS` simulator. Selecting this engine
|
156
|
+
assumes your code has been developed and configured for
|
157
|
+
ARGoS.
|
158
|
+
|
159
|
+
- ``engine.ros1gazebo`` - This directs SIERRA to run
|
160
|
+
experiments using the :term:`Gazebo` simulator and
|
161
|
+
:term:`ROS1`. Selecting this engine assumes your code
|
162
|
+
has been developed and configured for Gazebo and ROS1.
|
163
|
+
|
164
|
+
- ``engine.ros1robot`` - This directs SIERRA to run
|
165
|
+
experiments using :term:`ROS1` on a real robot of your
|
166
|
+
choosing. Selecting this engine assumes your code has
|
167
|
+
been developed and configured for ROS1.
|
168
|
+
""",
|
169
|
+
default="engine.argos",
|
170
|
+
)
|
171
|
+
|
172
|
+
bootstrap.add_argument(
|
173
|
+
"--skip-pkg-checks",
|
174
|
+
help="""
|
175
|
+
Skip the usual startup package checks. Only do this if you are
|
176
|
+
SURE you will never use the SIERRA functionality which requires
|
177
|
+
packages you don't have installed/can't install.
|
178
|
+
""",
|
179
|
+
action="store_true",
|
180
|
+
)
|
181
|
+
|
182
|
+
bootstrap.add_argument(
|
183
|
+
"--execenv",
|
184
|
+
help="""
|
185
|
+
This argument defines `how` experiments are going to be run,
|
186
|
+
using the ``--engine`` you have selected.
|
187
|
+
|
188
|
+
Valid values can be any folder name inside a folder on the
|
189
|
+
:envvar:`SIERRA_PLUGIN_PATH` (with ``/`` replaced with ``.`` as
|
190
|
+
you would expect for using path names to address python
|
191
|
+
packages). The execution environments which come with SIERRA
|
192
|
+
are:
|
193
|
+
|
194
|
+
- ``hpc.local`` - This directs SIERRA to run experiments on
|
195
|
+
the local machine. See :ref:`plugins/execenv/hpc/local`
|
196
|
+
for a detailed description.
|
197
|
+
|
198
|
+
- ``hpc.pbs`` - The directs SIERRA to run experiments
|
199
|
+
spread across multiple allocated nodes in an HPC
|
200
|
+
computing environment managed by TORQUE-PBS. See
|
201
|
+
:ref:`plugins/execenv/hpc/pbs` for a detailed
|
202
|
+
description.
|
203
|
+
|
204
|
+
- ``hpc.slurm`` - The directs SIERRA to run experiments
|
205
|
+
spread across multiple allocated nodes in an HPC
|
206
|
+
computing environment managed by SLURM. See
|
207
|
+
:ref:`plugins/execenv/hpc/slurm` for a detailed
|
208
|
+
description.
|
209
|
+
|
210
|
+
- ``hpc.adhoc`` - This will direct SIERRA to run
|
211
|
+
experiments on an ad-hoc network of computers. See
|
212
|
+
:ref:`plugins/execenv/hpc/adhoc` for a detailed
|
213
|
+
description.
|
214
|
+
|
215
|
+
- ``prefectserver.local`` - This will direct SIERRA to run
|
216
|
+
experiments locally using a spun-up :term:`Prefect` job
|
217
|
+
scheduler/server. See
|
218
|
+
:ref:`plugins/execenv/prefectserver/local` for a
|
219
|
+
detailed description.
|
220
|
+
|
221
|
+
- ``prefectserver.dockerremote`` - This will direct SIERRA
|
222
|
+
to run experiments remote using a :term:`Prefect` job
|
223
|
+
scheduler/server in docker containers. See
|
224
|
+
:ref:`plugins/execenv/prefectserver/dockerremote` for a
|
225
|
+
detailed description.
|
226
|
+
|
227
|
+
- ``robot.turtlebot3`` - This will direct SIERRA to run
|
228
|
+
experiments on real Turtlebots.
|
229
|
+
|
230
|
+
Not all engines support all execution environments.
|
231
|
+
"""
|
232
|
+
+ self.stage_usage_doc([1, 2]),
|
233
|
+
default="hpc.local",
|
234
|
+
)
|
235
|
+
|
236
|
+
bootstrap.add_argument(
|
237
|
+
"--expdef",
|
238
|
+
help="""
|
239
|
+
Specify the experiment definition format, so that SIERRA can
|
240
|
+
select an appropriate plugin to read/write files of that
|
241
|
+
format, and manipulate in-memory representations to create
|
242
|
+
runnable experiments. Any plugin on
|
243
|
+
:envvar:`SIERRA_PLUGIN_PATH` can be used, but the ones that
|
244
|
+
come with SIERRA are:
|
245
|
+
|
246
|
+
- ``expdef.xml`` - Experimental definitions are created
|
247
|
+
from XML files. This causes ``--expdef-template`` to be
|
248
|
+
parsed as XML.
|
249
|
+
|
250
|
+
- ``expdef.json`` - Experimental definitions are created
|
251
|
+
from json files. This causes ``--expdef-template`` to be
|
252
|
+
parsed as JSON.
|
253
|
+
"""
|
254
|
+
+ self.stage_usage_doc([1, 4, 5]),
|
255
|
+
default="expdef.xml",
|
256
|
+
)
|
257
|
+
bootstrap.add_argument(
|
258
|
+
"--storage",
|
259
|
+
help="""
|
260
|
+
Specify the storage medium for :term:`Experimental Run`
|
261
|
+
outputs, so that SIERRA can select an appropriate plugin to
|
262
|
+
read them. Any plugin on :envvar:`SIERRA_PLUGIN_PATH`, but the
|
263
|
+
ones that come with SIERRA are:
|
264
|
+
|
265
|
+
- ``storage.csv`` - Experimental run outputs are stored in
|
266
|
+
a per-run directory as one or more CSV files.
|
267
|
+
|
268
|
+
- ``storage.arrow`` - Experimental run outputs are stored
|
269
|
+
in a per-run directory as one or more apache arrow files.
|
270
|
+
|
271
|
+
Regardless of the value of this option, SIERRA always generates
|
272
|
+
CSV files as it runs and averages outputs, generates graphs,
|
273
|
+
etc.
|
274
|
+
"""
|
275
|
+
+ self.stage_usage_doc([3]),
|
276
|
+
default="storage.csv",
|
277
|
+
)
|
278
|
+
|
279
|
+
bootstrap.add_argument(
|
280
|
+
"--proc",
|
281
|
+
help="""
|
282
|
+
Specify the set of plugins to run during stage 3 for data
|
283
|
+
processing. The plugins are executed IN ORDER of appearance,
|
284
|
+
so make sure to handle dependencies. Any plugin on
|
285
|
+
:envvar:`SIERRA_PLUGIN_PATH` can be used, but the ones that
|
286
|
+
come with SIERRA are:
|
287
|
+
|
288
|
+
- ``proc.statistics`` - Generate statistics from all
|
289
|
+
:term:`Raw Output Data` files.
|
290
|
+
|
291
|
+
- ``proc.imagize`` - :term:`Imagize` :term:`Raw Output
|
292
|
+
Data` files.
|
293
|
+
|
294
|
+
- ``proc.collate`` - Performs :term:`Data Collation` on
|
295
|
+
:term:`Raw Output Data` files.
|
296
|
+
|
297
|
+
- ``proc.compress`` - Performs data compression on all
|
298
|
+
:term:`Raw Output Data` files.
|
299
|
+
|
300
|
+
- ``proc.decompress`` - Performs data decompression on all
|
301
|
+
:term:`Raw Output Data` files previously compresed with
|
302
|
+
``proc.compress``.
|
303
|
+
"""
|
304
|
+
+ self.stage_usage_doc([3]),
|
305
|
+
nargs="+",
|
306
|
+
default=["proc.statistics", "proc.collate"],
|
307
|
+
)
|
308
|
+
|
309
|
+
bootstrap.add_argument(
|
310
|
+
"--prod",
|
311
|
+
help="""
|
312
|
+
Specify the set of plugins to run during stage 4 for
|
313
|
+
product/deliverable generation. The plugins are executed IN
|
314
|
+
ORDER of appearance, so make sure to handle dependencies. Any
|
315
|
+
plugin on :envvar:`SIERRA_PLUGIN_PATH` can be used, but the
|
316
|
+
ones that come with SIERRA are:
|
317
|
+
|
318
|
+
- ``prod.graphs`` - Generate graphs :term:`Processed Output
|
319
|
+
Data` files.
|
320
|
+
|
321
|
+
- ``prod.render`` - Render previously :term:`imagized
|
322
|
+
<Imagize>` files into videos.
|
323
|
+
"""
|
324
|
+
+ self.stage_usage_doc([4]),
|
325
|
+
nargs="+",
|
326
|
+
default=["prod.graphs"],
|
327
|
+
)
|
328
|
+
|
329
|
+
bootstrap.add_argument(
|
330
|
+
"--compare",
|
331
|
+
help="""
|
332
|
+
Specify the set of plugins to run during stage 5 for
|
333
|
+
product/deliverable comparison. The plugins are executed IN
|
334
|
+
ORDER of appearance, so make sure to handle dependencies. Any
|
335
|
+
plugin on :envvar:`SIERRA_PLUGIN_PATH` can be used, but the
|
336
|
+
ones that come with SIERRA are:
|
337
|
+
|
338
|
+
- ``compare.graphs`` - Combine previously generated graphs
|
339
|
+
onto a single plot.
|
340
|
+
"""
|
341
|
+
+ self.stage_usage_doc([5]),
|
342
|
+
nargs="+",
|
343
|
+
default=["compare.graphs"],
|
344
|
+
)
|
345
|
+
bootstrap.add_argument(
|
346
|
+
"--rcfile",
|
347
|
+
help="""
|
348
|
+
Specify the rcfile SIERRA should read additional cmdline
|
349
|
+
arguments from. Any rcfile arguments overriden by cmdline
|
350
|
+
args, if both are present. See also :envvar:`SIERRA_RCFILE`.
|
351
|
+
"""
|
352
|
+
+ self.stage_usage_doc([1, 2, 3, 4, 5]),
|
353
|
+
)
|
210
354
|
|
211
355
|
|
212
356
|
class CoreCmdline(BaseCmdline):
|
213
|
-
"""Defines the core command line arguments for SIERRA using :class:`argparse`.
|
357
|
+
"""Defines the core command line arguments for SIERRA using :class:`argparse`."""
|
214
358
|
|
215
|
-
|
359
|
+
def __init__(
|
360
|
+
self, parents: tp.Optional[tp.List[ArgumentParser]], stages: tp.List[int]
|
361
|
+
) -> None:
|
362
|
+
super().__init__()
|
216
363
|
|
217
|
-
def __init__(self,
|
218
|
-
parents: tp.Optional[tp.List[ArgumentParser]],
|
219
|
-
stages: tp.List[int]) -> None:
|
220
364
|
self.scaffold_cli(parents)
|
221
365
|
self.init_cli(stages)
|
222
366
|
|
367
|
+
def scaffold_cli(self, parents: tp.Optional[tp.List[ArgumentParser]]) -> None:
|
368
|
+
"""
|
369
|
+
Scaffold CLI by defining the parser and common argument groups.
|
370
|
+
"""
|
371
|
+
if parents is not None:
|
372
|
+
self.parser = ArgumentParser(
|
373
|
+
prog="sierra-cli", parents=parents, add_help=False, allow_abbrev=False
|
374
|
+
)
|
375
|
+
else:
|
376
|
+
self.parser = ArgumentParser(
|
377
|
+
prog="sierra-cli", add_help=False, allow_abbrev=False
|
378
|
+
)
|
379
|
+
|
380
|
+
self.multistage = self.parser.add_argument_group(
|
381
|
+
self.multistage_desc[0], self.multistage_desc[1]
|
382
|
+
)
|
383
|
+
self.stage1 = self.parser.add_argument_group(
|
384
|
+
self.stage1_desc[0], self.stage1_desc[1]
|
385
|
+
)
|
386
|
+
self.stage2 = self.parser.add_argument_group(
|
387
|
+
self.stage2_desc[0], self.stage2_desc[1]
|
388
|
+
)
|
389
|
+
self.stage3 = self.parser.add_argument_group(
|
390
|
+
self.stage3_desc[0], self.stage3_desc[1]
|
391
|
+
)
|
392
|
+
self.stage4 = self.parser.add_argument_group(
|
393
|
+
self.stage4_desc[0], self.stage4_desc[1]
|
394
|
+
)
|
395
|
+
self.stage5 = self.parser.add_argument_group(
|
396
|
+
self.stage5_desc[0], self.stage5_desc[1]
|
397
|
+
)
|
398
|
+
self.shortforms = self.parser.add_argument_group(
|
399
|
+
title="Shortform aliases",
|
400
|
+
description="""
|
401
|
+
Most cmdline options to SIERRA are longform (i.e.,
|
402
|
+
``--option``), but some families of options have
|
403
|
+
shortforms (i.e., ``-o`` for ``--option``) as well.
|
404
|
+
Shortform arguments behave the same as their longform
|
405
|
+
counterparts. If both are passed, the the shortform
|
406
|
+
overrides.
|
407
|
+
""",
|
408
|
+
)
|
409
|
+
|
223
410
|
def init_cli(self, stages: tp.List[int]) -> None:
|
224
411
|
"""Define cmdline arguments for stages 1-5."""
|
225
412
|
if -1 in stages:
|
226
413
|
self.init_multistage()
|
414
|
+
self.init_shortforms()
|
227
415
|
|
228
416
|
if 1 in stages:
|
229
417
|
self.init_stage1()
|
@@ -240,956 +428,392 @@ class CoreCmdline(BaseCmdline):
|
|
240
428
|
if 5 in stages:
|
241
429
|
self.init_stage5()
|
242
430
|
|
243
|
-
def
|
244
|
-
parents: tp.Optional[tp.List[ArgumentParser]]) -> None:
|
431
|
+
def init_shortforms(self) -> None:
|
245
432
|
"""
|
246
|
-
|
433
|
+
Define cmdline shortform arguments for all pipeline stages.
|
247
434
|
"""
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
self.
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
435
|
+
self.shortforms.add_argument(
|
436
|
+
"-p",
|
437
|
+
action="append",
|
438
|
+
nargs="+",
|
439
|
+
help="""
|
440
|
+
Alias of ``--plot-``; any number of ``--plot-XX`` option can be
|
441
|
+
passed with separate ``-p`` arguments . If the argument to
|
442
|
+
``-p`` does not map to a valid ``plot-XX`` option it is
|
443
|
+
ignored.
|
444
|
+
|
445
|
+
.. versionadded:: 1.3.14
|
446
|
+
""",
|
447
|
+
)
|
448
|
+
|
449
|
+
self.shortforms.add_argument(
|
450
|
+
"-e",
|
451
|
+
action="append",
|
452
|
+
nargs="+",
|
453
|
+
help="""
|
454
|
+
Alias of ``--exp-``; any number of ``--exp-XX`` option can be
|
455
|
+
passed with separate ``-e`` arguments . If the argument to
|
456
|
+
``-e`` does not map to a valid ``exp-XX`` option it is ignored.
|
457
|
+
|
458
|
+
.. versionadded:: 1.3.14
|
459
|
+
""",
|
460
|
+
)
|
461
|
+
|
462
|
+
self.shortforms.add_argument(
|
463
|
+
"-x",
|
464
|
+
action="append",
|
465
|
+
nargs="+",
|
466
|
+
help="""
|
467
|
+
Alias of ``--exec-``; any number of ``--exec-XX`` option can be
|
468
|
+
passed with separate ``-x`` arguments . If the argument to
|
469
|
+
``-x`` does not map to a valid ``exec-XX`` option it is
|
470
|
+
ignored.
|
471
|
+
|
472
|
+
.. versionadded:: 1.3.14
|
473
|
+
""",
|
474
|
+
)
|
475
|
+
|
476
|
+
self.shortforms.add_argument(
|
477
|
+
"-s",
|
478
|
+
action="append",
|
479
|
+
nargs="+",
|
480
|
+
help="""
|
481
|
+
Alias of ``--skip``; any number of ``--skip-XX`` option can be
|
482
|
+
passed with separate ``-s`` arguments . If the argument to
|
483
|
+
``-s`` does not map to a valid ``skip-XX`` option it is
|
484
|
+
ignored.
|
485
|
+
|
486
|
+
.. versionadded:: 1.3.14
|
487
|
+
""",
|
488
|
+
)
|
268
489
|
|
269
490
|
def init_multistage(self) -> None:
|
270
491
|
"""
|
271
492
|
Define cmdline arguments which are used in multiple pipeline stages.
|
272
493
|
"""
|
273
|
-
self.multistage.add_argument(
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
If ``--platform`` is a simulator and
|
444
|
-
``--exec-env`` is something other than
|
445
|
-
``hpc.local`` then this may be be used to
|
446
|
-
determine the concurrency of experimental
|
447
|
-
runs.
|
448
|
-
|
449
|
-
""" + self.stage_usage_doc([1, 2]))
|
450
|
-
|
451
|
-
self.multistage.add_argument("--skip-collate",
|
452
|
-
help="""
|
453
|
-
|
454
|
-
Specify that no collation of data across
|
455
|
-
experiments within a batch (stage 4) or
|
456
|
-
across runs within an experiment (stage 3)
|
457
|
-
should be performed. Useful if collation
|
458
|
-
takes a long time and multiple types of
|
459
|
-
stage 4 outputs are desired. Collation is
|
460
|
-
generally idempotent unless you change the
|
461
|
-
stage3 options (YMMV).
|
462
|
-
|
463
|
-
""" + self.stage_usage_doc([3, 4]),
|
464
|
-
action='store_true')
|
465
|
-
# Plotting options
|
466
|
-
self.multistage.add_argument("--plot-log-xscale",
|
467
|
-
help="""
|
468
|
-
|
469
|
-
Place the set of X values used to generate intra- and
|
470
|
-
inter-experiment graphs into the logarithmic
|
471
|
-
space. Mainly useful when the batch criteria involves
|
472
|
-
large system sizes, so that the plots are more
|
473
|
-
readable.
|
474
|
-
|
475
|
-
""" +
|
476
|
-
|
477
|
-
self.graphs_applicable_doc([':class:`~sierra.core.graphs.summary_line_graph.SummaryLineGraph`']) +
|
478
|
-
self.stage_usage_doc([4, 5]),
|
479
|
-
action='store_true')
|
480
|
-
|
481
|
-
self.multistage.add_argument("--plot-enumerated-xscale",
|
482
|
-
help="""
|
483
|
-
|
484
|
-
Instead of using the values generated by a
|
485
|
-
given batch criteria for the X values, use
|
486
|
-
an enumerated list[0, ..., len(X value) -
|
487
|
-
1]. Mainly useful when the batch criteria
|
488
|
-
involves large system sizes, so that the
|
489
|
-
plots are more readable.
|
490
|
-
|
491
|
-
""" +
|
492
|
-
|
493
|
-
self.graphs_applicable_doc([':class:`~sierra.core.graphs.summary_line_graph.SummaryLineGraph`']) +
|
494
|
-
self.stage_usage_doc([4, 5]),
|
495
|
-
action='store_true')
|
496
|
-
|
497
|
-
self.multistage.add_argument("--plot-log-yscale",
|
498
|
-
help="""
|
499
|
-
|
500
|
-
Place the set of Y values used to generate
|
501
|
-
intra - and inter-experiment graphs into
|
502
|
-
the logarithmic space. Mainly useful when
|
503
|
-
the batch criteria involves large system
|
504
|
-
sizes, so that the plots are more readable.
|
505
|
-
|
506
|
-
""" +
|
507
|
-
|
508
|
-
self.graphs_applicable_doc([':class:`~sierra.core.graphs.summary_line_graph.SummaryLineGraph`',
|
509
|
-
':class:`~sierra.core.graphs.stacked_line_graph.StackedLineGraph`']) +
|
510
|
-
self.stage_usage_doc([4, 5]),
|
511
|
-
action='store_true')
|
512
|
-
|
513
|
-
self.multistage.add_argument("--plot-regression-lines",
|
514
|
-
help="""
|
515
|
-
|
516
|
-
For all 2D generated scatterplots, plot a
|
517
|
-
linear regression line and the equation of
|
518
|
-
the line to the legend. """ +
|
519
|
-
|
520
|
-
self.graphs_applicable_doc([':class:`~sierra.core.graphs.summary_line_graph.SummaryLineGraph`']) +
|
521
|
-
self.stage_usage_doc([4, 5]))
|
522
|
-
|
523
|
-
self.multistage.add_argument("--plot-primary-axis",
|
524
|
-
type=int,
|
525
|
-
help="""
|
526
|
-
|
527
|
-
|
528
|
-
This option allows you to override the
|
529
|
-
primary axis, which is normally is computed
|
530
|
-
based on the batch criteria.
|
531
|
-
|
532
|
-
For example, in a bivariate batch criteria
|
533
|
-
composed of
|
534
|
-
|
535
|
-
- :ref:`ln-sierra-platform-argos-bc-population-size`
|
536
|
-
on the X axis (rows)
|
537
|
-
|
538
|
-
- Another batch criteria which does not
|
539
|
-
affect system size (columns)
|
540
|
-
|
541
|
-
Metrics will be calculated by `computing`
|
542
|
-
across .csv rows and `projecting` down the
|
543
|
-
columns by default, since system size will
|
544
|
-
only vary within a row. Passing a value of 1
|
545
|
-
to this option will override this
|
546
|
-
calculation, which can be useful in
|
547
|
-
bivariate batch criteria in which you are
|
548
|
-
interested in the effect of the OTHER
|
549
|
-
non-size criteria on various performance
|
550
|
-
measures.
|
551
|
-
|
552
|
-
0=criteria of interest varies across `rows`.
|
553
|
-
|
554
|
-
1=criteria of interest varies across
|
555
|
-
`columns`.
|
556
|
-
|
557
|
-
This option only affects generating graphs
|
558
|
-
from bivariate batch criteria.
|
559
|
-
|
560
|
-
"""
|
561
|
-
+
|
562
|
-
self.graphs_applicable_doc([':class:`~sierra.core.graphs.heatmap.Heatmap`',
|
563
|
-
':class:`~sierra.core.graphs.staced_line_graph.StackedLineGraph`']) +
|
564
|
-
self.stage_usage_doc([4, 5]),
|
565
|
-
default=None)
|
566
|
-
|
567
|
-
self.multistage.add_argument("--plot-large-text",
|
568
|
-
help="""
|
569
|
-
|
570
|
-
This option specifies that the title, X/Y
|
571
|
-
axis labels/tick labels should be larger
|
572
|
-
than the SIERRA default. This is useful when
|
573
|
-
generating graphs suitable for two column
|
574
|
-
paper format where the default text size for
|
575
|
-
rendered graphs will be too small to see
|
576
|
-
easily. The SIERRA defaults are generally
|
577
|
-
fine for the one column/journal paper
|
578
|
-
format.
|
579
|
-
|
580
|
-
""" + self.stage_usage_doc([4, 5]),
|
581
|
-
action='store_true')
|
582
|
-
|
583
|
-
self.multistage.add_argument("--plot-transpose-graphs",
|
584
|
-
help="""
|
585
|
-
|
586
|
-
Transpose the X, Y axes in generated
|
587
|
-
graphs. Useful as a general way to tweak
|
588
|
-
graphs for best use of space within a paper.
|
589
|
-
|
590
|
-
.. versionchanged:: 1.2.20
|
591
|
-
|
592
|
-
Renamed from ``--transpose-graphs`` to
|
593
|
-
make its relation to other plotting
|
594
|
-
options clearer.
|
595
|
-
|
596
|
-
""" +
|
597
|
-
self.graphs_applicable_doc([':class:`~sierra.core.graphs.heatmap.Heatmap`']) +
|
598
|
-
self.stage_usage_doc([4, 5]),
|
599
|
-
action='store_true')
|
494
|
+
self.multistage.add_argument(
|
495
|
+
"--expdef-template",
|
496
|
+
metavar="filepath",
|
497
|
+
help="""
|
498
|
+
The template ``.xml`` input file for the batch experiment.
|
499
|
+
Beyond the requirements for the specific ``--engine``, the
|
500
|
+
content of the file can be anything valid for the format, with
|
501
|
+
the exception of the SIERRA requirements detailed in
|
502
|
+
:ref:`plugins/expdef`.
|
503
|
+
"""
|
504
|
+
+ self.stage_usage_doc([1, 2, 3, 4]),
|
505
|
+
)
|
506
|
+
|
507
|
+
self.multistage.add_argument(
|
508
|
+
"--exp-overwrite",
|
509
|
+
help="""
|
510
|
+
When SIERRA calculates the batch experiment root (or any child
|
511
|
+
path in the batch experiment root) during stage {1, 2}, if the
|
512
|
+
calculated path already exists it is treated as a fatal error
|
513
|
+
and no modifications to the filesystem are performed. This
|
514
|
+
flag overwrides the default behavior. Provided to avoid
|
515
|
+
accidentally overwrite input/output files for an experiment,
|
516
|
+
forcing the user to be explicit with potentially dangerous
|
517
|
+
actions.
|
518
|
+
"""
|
519
|
+
+ self.stage_usage_doc([1, 2]),
|
520
|
+
action="store_true",
|
521
|
+
)
|
522
|
+
|
523
|
+
self.multistage.add_argument(
|
524
|
+
"--sierra-root",
|
525
|
+
metavar="dirpath",
|
526
|
+
help="""
|
527
|
+
Root directory for all SIERRA generated and created files.
|
528
|
+
|
529
|
+
Subdirectories for controllers, scenarios,
|
530
|
+
experiment/experimental run inputs/outputs will be created in
|
531
|
+
this directory as needed. Can persist between invocations of
|
532
|
+
SIERRA.
|
533
|
+
"""
|
534
|
+
+ self.stage_usage_doc([1, 2, 3, 4, 5]),
|
535
|
+
default="<home directory>/exp",
|
536
|
+
)
|
537
|
+
|
538
|
+
self.multistage.add_argument(
|
539
|
+
"--batch-criteria",
|
540
|
+
metavar="[<category>.<definition>,...]",
|
541
|
+
help="""
|
542
|
+
Definition of criteria(s) to use to define the experiment.
|
543
|
+
|
544
|
+
Specified as a list of 0 or 1 space separated strings, each
|
545
|
+
with the following general structure:
|
546
|
+
|
547
|
+
``<category>.<definition>``
|
548
|
+
|
549
|
+
``<category>`` must be a filename from the ``core/variables/``
|
550
|
+
or from a ``--project`` ``<project>/variables/`` directory, and
|
551
|
+
``<definition>`` must be a parsable namne (according to the
|
552
|
+
requirements of the criteria defined by the parser for
|
553
|
+
``<category>``).
|
554
|
+
"""
|
555
|
+
+ self.stage_usage_doc([1, 2, 3, 4, 5]),
|
556
|
+
nargs="+",
|
557
|
+
default=[],
|
558
|
+
)
|
559
|
+
|
560
|
+
self.multistage.add_argument(
|
561
|
+
"--pipeline",
|
562
|
+
help="""
|
563
|
+
Define which stages of the experimental pipeline to run:
|
564
|
+
|
565
|
+
- Stage1 - Generate the experiment definition from the
|
566
|
+
template input file, batch criteria, and other command
|
567
|
+
line options. Part of default pipeline.
|
568
|
+
|
569
|
+
- Stage2 - Run a previously generated experiment. Part of
|
570
|
+
default pipeline.
|
571
|
+
|
572
|
+
- Stage3 - Post-process experimental results after running
|
573
|
+
the batch experiment; some parts of this can be done in
|
574
|
+
parallel. Part of default pipeline.
|
575
|
+
|
576
|
+
- Stage4 - Perform deliverable/product generation after
|
577
|
+
processing results for a batch experiment, which can
|
578
|
+
include shiny graphs and videos. Part of default
|
579
|
+
pipeline.
|
580
|
+
|
581
|
+
- Stage5 - Compare generated products.
|
582
|
+
""",
|
583
|
+
type=int,
|
584
|
+
nargs="*",
|
585
|
+
default=[1, 2, 3, 4],
|
586
|
+
)
|
587
|
+
self.multistage.add_argument(
|
588
|
+
"--exp-range",
|
589
|
+
help="""
|
590
|
+
Set the experiment numbers from the batch to run, average,
|
591
|
+
generate intra-experiment graphs from, or generate
|
592
|
+
inter-experiment graphs from (0 based). Specified in the form
|
593
|
+
``min_exp_num:max_exp_num`` (closed interval/inclusive). If
|
594
|
+
omitted, runs, averages, and generates intra-experiment and
|
595
|
+
inter-experiment performance measure graphs for all experiments
|
596
|
+
in the batch (default behavior).
|
597
|
+
|
598
|
+
This is useful to re-run part of a batch experiment in HPC
|
599
|
+
environments if SIERRA gets killed before it finishes running
|
600
|
+
all experiments in the batch, or to redo a single experiment
|
601
|
+
with real robots which failed for some reason.
|
602
|
+
"""
|
603
|
+
+ self.stage_usage_doc([2, 3, 4]),
|
604
|
+
)
|
605
|
+
|
606
|
+
self.multistage.add_argument(
|
607
|
+
"--engine-vc",
|
608
|
+
help="""
|
609
|
+
For applicable ``--engines``, enable visual capturing of
|
610
|
+
run-time data during stage 2. This data can be frames (i.e.,
|
611
|
+
.png files), or rendering videos, depending on the engine. If
|
612
|
+
the captured data was frames, then SIERRA can render the
|
613
|
+
captured frames into videos during stage 4. If the selected
|
614
|
+
``--engine`` does not support visual capture, then this option
|
615
|
+
has no effect. See :ref:`plugins/prod/render` for more
|
616
|
+
details.
|
617
|
+
"""
|
618
|
+
+ self.stage_usage_doc([1, 4]),
|
619
|
+
action="store_true",
|
620
|
+
)
|
621
|
+
|
622
|
+
self.multistage.add_argument(
|
623
|
+
"--processing-parallelism",
|
624
|
+
type=int,
|
625
|
+
help="""
|
626
|
+
The level of parallelism to use in results processing/graph
|
627
|
+
generation producer-consumer queue. This value is used to
|
628
|
+
allocate consumers and produces in a 3:1 ratio. If you are
|
629
|
+
doing a LOT of processing, you may want to oversubscribe your
|
630
|
+
machine by passing a higher than default value to overcome
|
631
|
+
slowdown with high disk I/O.
|
632
|
+
"""
|
633
|
+
+ self.stage_usage_doc([3, 4]),
|
634
|
+
default=psutil.cpu_count(),
|
635
|
+
)
|
636
|
+
self.multistage.add_argument(
|
637
|
+
"--exec-parallelism-paradigm",
|
638
|
+
choices=["per-batch", "per-exp", "per-run", None],
|
639
|
+
default=None,
|
640
|
+
help="""
|
641
|
+
The level of parallelism to use when executing experiments in
|
642
|
+
stage 2. This should generall be set by
|
643
|
+
:py:func:`~sierra.core.experiment.bindings.IExpConfigurer.parallelism_paradigm()`
|
644
|
+
in your selected :term:`Engine`; this option is provided as an override.
|
645
|
+
"""
|
646
|
+
+ self.stage_usage_doc([1, 2]),
|
647
|
+
)
|
648
|
+
|
649
|
+
self.multistage.add_argument(
|
650
|
+
"--n-runs",
|
651
|
+
type=int,
|
652
|
+
default=1,
|
653
|
+
help="""
|
654
|
+
The # of experimental runs that will be executed and their
|
655
|
+
results processed to form the result of a single experiment
|
656
|
+
within a batch.
|
657
|
+
|
658
|
+
If ``--engine`` is a simulator and ``--execenv`` is something
|
659
|
+
other than ``hpc.local`` then this may be be used to determine
|
660
|
+
the concurrency of experimental runs.
|
661
|
+
"""
|
662
|
+
+ self.stage_usage_doc([1, 2]),
|
663
|
+
)
|
600
664
|
|
601
665
|
def init_stage1(self) -> None:
|
602
666
|
"""
|
603
667
|
Define cmdline arguments for stage 1.
|
604
668
|
"""
|
605
|
-
self.stage1.add_argument(
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
dest='preserve_seeds',
|
626
|
-
action='store_false')
|
669
|
+
self.stage1.add_argument(
|
670
|
+
"--preserve-seeds",
|
671
|
+
help="""
|
672
|
+
Preserve previously generated random seeds for experiments (the
|
673
|
+
default). Useful for regenerating experiments when you change
|
674
|
+
parameters/python code that don't affects experimental outputs
|
675
|
+
(e.g., paths). Preserving/overwriting random seeds is not
|
676
|
+
affected by ``--exp-overwrite``.
|
677
|
+
""",
|
678
|
+
default=True,
|
679
|
+
)
|
680
|
+
|
681
|
+
self.stage1.add_argument(
|
682
|
+
"--no-preserve-seeds",
|
683
|
+
help="""
|
684
|
+
Opposite of ``--preserve-seeds``.
|
685
|
+
""",
|
686
|
+
dest="preserve_seeds",
|
687
|
+
action="store_false",
|
688
|
+
)
|
627
689
|
|
628
690
|
def init_stage2(self) -> None:
|
629
691
|
"""
|
630
692
|
Define cmdline arguments for stage 2.
|
631
693
|
"""
|
632
|
-
self.stage2.add_argument(
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
are supplied.
|
644
|
-
|
645
|
-
""")
|
694
|
+
self.stage2.add_argument(
|
695
|
+
"--nodefile",
|
696
|
+
help="""
|
697
|
+
Specify a list of compute nodes which SIERpRA will use to run
|
698
|
+
jobs. For simulator :term:`Engines <Engine>`, these are HPC
|
699
|
+
resource nodes. For real robot engines, these are robot
|
700
|
+
hostnames/IP addresses. This information can also be supplied
|
701
|
+
via the :envvar:`SIERRA_NODEFILE` environment variable; this
|
702
|
+
argument takes priority if both are supplied.
|
703
|
+
""",
|
704
|
+
)
|
646
705
|
|
647
706
|
def init_stage3(self) -> None:
|
648
707
|
"""
|
649
708
|
Define cmdline arguments for stage 3.
|
650
709
|
"""
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
- ``all`` - Generate all possible statistics,
|
724
|
-
and plot all possible statistics on graphs.
|
725
|
-
"""
|
726
|
-
+
|
727
|
-
self.graphs_applicable_doc([':class:`~sierra.core.graphs.summary_line_graph.SummaryLineGraph`',
|
728
|
-
':class:`~sierra.core.graphs.stacked_line_graph.StackedLineGraph`'])
|
729
|
-
+ self.stage_usage_doc([3, 4]),
|
730
|
-
default='none')
|
731
|
-
|
732
|
-
self.stage3.add_argument("--processing-mem-limit",
|
733
|
-
type=int,
|
734
|
-
help="""
|
735
|
-
|
736
|
-
|
737
|
-
Specify, as a percent in [0, 100], how much
|
738
|
-
memory SIERRA should try to limit itself to
|
739
|
-
using. This is useful on systems with limited
|
740
|
-
memory, or on systems which are shared with
|
741
|
-
other users without per-user memory
|
742
|
-
restrictions.
|
743
|
-
|
744
|
-
""" + self.stage_usage_doc([3, 4]),
|
745
|
-
default=90)
|
746
|
-
|
747
|
-
self.stage3.add_argument("--df-homogenize",
|
748
|
-
help="""
|
749
|
-
|
750
|
-
SIERRA generally assumes/relies on all
|
751
|
-
dataframes with the same name having the same #
|
752
|
-
of columns which are of equivalent length
|
753
|
-
across: term: `Experimental Runs < Experimental
|
754
|
-
Run >` (different columns within a dataframe
|
755
|
-
can of course have different lengths). This is
|
756
|
-
checked during stage 3 unless
|
757
|
-
``--df-skip-verify`` is passed. If strict
|
758
|
-
verification is skipped, then SIERRA provides
|
759
|
-
the following options when processing
|
760
|
-
dataframes during stage {3, 4} to to homogenize
|
761
|
-
them:
|
762
|
-
|
763
|
-
- ``none`` - Don't do anything. This may or may
|
764
|
-
not produce crashes during stage 4, depending
|
765
|
-
on what you are doing.
|
766
|
-
|
767
|
-
- ``pad`` - Project last valid value in columns
|
768
|
-
which are too short down the column to make
|
769
|
-
it match those which are longer.
|
770
|
-
|
771
|
-
Note that this may result in invalid
|
772
|
-
data/graphs if the filled columns are
|
773
|
-
intervallic, interval average, or cumulative
|
774
|
-
average data. If the data is a cumulative
|
775
|
-
count of something, then this policy will
|
776
|
-
have no ill effects.
|
777
|
-
|
778
|
-
- ``zero`` - Same as ``pad``, but always fill
|
779
|
-
with zeroes.
|
780
|
-
|
781
|
-
Homogenization is performed just before writing
|
782
|
-
dataframes to the specified storage
|
783
|
-
medium. Useful with real robot experiments if
|
784
|
-
the number of datapoints captured per-robot is
|
785
|
-
slightly different, depending on when they
|
786
|
-
started executing relative to when the
|
787
|
-
experiment started.
|
788
|
-
|
789
|
-
""",
|
790
|
-
default='none')
|
710
|
+
self.stage3.add_argument(
|
711
|
+
"--df-verify",
|
712
|
+
help="""
|
713
|
+
SIERRA generally assumes/relies on all dataframes with the same
|
714
|
+
name having the same # of columns which are of equivalent
|
715
|
+
length across :term:`Experimental Runs <Experimental Run>`
|
716
|
+
(different columns within a dataframe can of course have
|
717
|
+
different lengths). However this is not checked by default.
|
718
|
+
|
719
|
+
If passed, then the verification step not be skipped, and will
|
720
|
+
be executed during experimental results processing, and outputs
|
721
|
+
will be averaged directly.
|
722
|
+
|
723
|
+
If not all the corresponding CSV files in all experiments
|
724
|
+
generated the same # rows, then SIERRA will (probably) crash
|
725
|
+
during experiments exist and/or have the stage4. Verification
|
726
|
+
can take a long time with large # of runs and/or dataframes per
|
727
|
+
experiment.
|
728
|
+
"""
|
729
|
+
+ self.stage_usage_doc([3]),
|
730
|
+
action="store_true",
|
731
|
+
default=False,
|
732
|
+
)
|
733
|
+
|
734
|
+
self.stage3.add_argument(
|
735
|
+
"--processing-mem-limit",
|
736
|
+
type=int,
|
737
|
+
help="""
|
738
|
+
Specify, as a percent in [0, 100], how much memory SIERRA
|
739
|
+
should try to limit itself to using. This is useful on systems
|
740
|
+
with limited memory, or on systems which are shared with other
|
741
|
+
users without per-user memory restrictions.
|
742
|
+
"""
|
743
|
+
+ self.stage_usage_doc([3, 4]),
|
744
|
+
default=90,
|
745
|
+
)
|
746
|
+
|
747
|
+
self.stage3.add_argument(
|
748
|
+
"--df-homogenize",
|
749
|
+
help="""
|
750
|
+
SIERRA generally assumes/relies on all dataframes with the same
|
751
|
+
name having the same # of columns which are of equivalent
|
752
|
+
length across: term: `Experimental Runs < Experimental Run >`
|
753
|
+
(different columns within a dataframe can of course have
|
754
|
+
different lengths). This not checked unless ``--df-verify`` is
|
755
|
+
passed. If strict verification is skipped, then SIERRA
|
756
|
+
provides the following options when processing dataframes
|
757
|
+
during stage {3, 4} to to homogenize them:
|
758
|
+
|
759
|
+
- ``none`` - Don't do anything. This may or may not
|
760
|
+
produce crashes during stage 4, depending on what you are
|
761
|
+
doing.
|
762
|
+
|
763
|
+
- ``pad`` - Project last valid value in columns which are
|
764
|
+
too short down the column to make it match those which
|
765
|
+
are longer.
|
766
|
+
|
767
|
+
Note that this may result in invalid data/graphs if the filled
|
768
|
+
columns are intervallic, interval average, or cumulative
|
769
|
+
average data. If the data is a cumulative count of something,
|
770
|
+
then this policy will have no ill effects.
|
771
|
+
|
772
|
+
- ``zero`` - Same as ``pad``, but always fill with zeroes.
|
773
|
+
|
774
|
+
Homogenization is performed just before writing dataframes to
|
775
|
+
the specified storage medium. Useful with real robot
|
776
|
+
experiments if the number of datapoints captured per-robot is
|
777
|
+
slightly different, depending on when they started executing
|
778
|
+
relative to when the experiment started.
|
779
|
+
""",
|
780
|
+
default="none",
|
781
|
+
)
|
791
782
|
|
792
783
|
def init_stage4(self) -> None:
|
793
784
|
"""
|
794
785
|
Define cmdline arguments for stage 4.
|
795
786
|
"""
|
796
|
-
self.stage4.add_argument("--exp-graphs",
|
797
|
-
choices=['intra', 'inter', 'all', 'none'],
|
798
|
-
help="""
|
799
|
-
|
800
|
-
Specify which types of graphs should be
|
801
|
-
generated from experimental results:
|
802
|
-
|
803
|
-
- ``intra`` - Generate intra-experiment graphs
|
804
|
-
from the results of a single experiment
|
805
|
-
within a batch, for each experiment in the
|
806
|
-
batch(this can take a long time with large
|
807
|
-
batch experiments). If any intra-experiment
|
808
|
-
models are defined and enabled, those are run
|
809
|
-
and the results placed on appropriate graphs.
|
810
|
-
|
811
|
-
- ``inter`` - Generate inter-experiment graphs
|
812
|
-
_across_ the results of all experiments in a
|
813
|
-
batch. These are very fast to generate,
|
814
|
-
regardless of batch experiment size. If any
|
815
|
-
inter-experiment models are defined and
|
816
|
-
enabled, those are run and the results placed
|
817
|
-
on appropriate graphs.
|
818
|
-
|
819
|
-
- ``all`` - Generate all types of graphs.
|
820
|
-
|
821
|
-
- ``none`` - Skip graph generation; provided to
|
822
|
-
skip graph generation if only video outputs
|
823
|
-
are desired.
|
824
|
-
|
825
|
-
""" + self.stage_usage_doc([4]),
|
826
|
-
default='all')
|
827
|
-
|
828
|
-
self.stage4.add_argument("--project-no-LN",
|
829
|
-
help="""
|
830
|
-
|
831
|
-
Specify that the intra-experiment and
|
832
|
-
inter-experiment linegraphs defined in project
|
833
|
-
YAML configuration should not be
|
834
|
-
generated. Useful if you are working on
|
835
|
-
something which results in the generation of
|
836
|
-
other types of graphs, and the generation of
|
837
|
-
those linegraphs is not currently needed only
|
838
|
-
slows down your development cycle.
|
839
|
-
|
840
|
-
Model linegraphs are still generated, if
|
841
|
-
applicable.
|
842
|
-
|
843
|
-
""",
|
844
|
-
action='store_true')
|
845
|
-
|
846
|
-
self.stage4.add_argument("--project-no-HM",
|
847
|
-
help="""
|
848
|
-
|
849
|
-
Specify that the intra-experiment heatmaps
|
850
|
-
defined in project YAML configuration should
|
851
|
-
not be generated. Useful if:
|
852
|
-
|
853
|
-
- You are working on something which results in
|
854
|
-
the generation of other types of graphs, and
|
855
|
-
the generation of heatmaps only slows down
|
856
|
-
your development cycle.
|
857
|
-
|
858
|
-
- You are working on stage5 comparison graphs
|
859
|
-
for bivariate batch criteria, and
|
860
|
-
re-generating many heatmaps during stage4 is
|
861
|
-
taking too long.
|
862
|
-
|
863
|
-
Model heatmaps are still generated, if
|
864
|
-
applicable.
|
865
|
-
|
866
|
-
.. versionadded:: 1.2.20
|
867
|
-
|
868
|
-
""",
|
869
|
-
action='store_true')
|
870
|
-
|
871
|
-
# Model options
|
872
|
-
models = self.parser.add_argument_group('Models')
|
873
|
-
models.add_argument('--models-enable',
|
874
|
-
help="""
|
875
|
-
|
876
|
-
Enable running of all models; otherwise, no models
|
877
|
-
are run, even if they appear in the project config
|
878
|
-
file. The logic behind having models disabled by
|
879
|
-
default is that most users won't have them.
|
880
|
-
|
881
|
-
""",
|
882
|
-
action="store_true")
|
883
|
-
|
884
|
-
# Rendering options
|
885
|
-
rendering = self.parser.add_argument_group(
|
886
|
-
'Stage4: Rendering (see also stage1 rendering options)')
|
887
|
-
|
888
|
-
rendering.add_argument("--render-cmd-opts",
|
889
|
-
help="""
|
890
|
-
|
891
|
-
Specify the: program: `ffmpeg` options to appear
|
892
|
-
between the specification of the input image
|
893
|
-
files and the specification of the output
|
894
|
-
file. The default is suitable for use with ARGoS
|
895
|
-
frame grabbing set to a frames size of 1600x1200
|
896
|
-
to output a reasonable quality video.
|
897
|
-
|
898
|
-
""" + self.stage_usage_doc([4]),
|
899
|
-
default="-r 10 -s:v 800x600 -c:v libx264 -crf 25 -filter:v scale=-2:956 -pix_fmt yuv420p")
|
900
|
-
|
901
|
-
rendering.add_argument("--project-imagizing",
|
902
|
-
help="""
|
903
|
-
|
904
|
-
Enable generation of image files from CSV files
|
905
|
-
captured during stage 2 and averaged during stage
|
906
|
-
3 for each experiment. See
|
907
|
-
:ref:`ln-sierra-usage-rendering-project` for
|
908
|
-
details and restrictions.
|
909
|
-
|
910
|
-
""" + self.stage_usage_doc([3, 4]),
|
911
|
-
action='store_true')
|
912
|
-
|
913
|
-
rendering.add_argument("--project-rendering",
|
914
|
-
help="""
|
915
|
-
|
916
|
-
Enable generation of videos from imagized CSV
|
917
|
-
files created as a result of
|
918
|
-
``--project-imagizing``. See
|
919
|
-
:ref:`ln-sierra-usage-rendering-project` for
|
920
|
-
details.
|
921
|
-
|
922
|
-
""" + self.stage_usage_doc([4]),
|
923
|
-
action='store_true')
|
924
|
-
|
925
|
-
rendering.add_argument("--bc-rendering",
|
926
|
-
help="""
|
927
|
-
|
928
|
-
Enable generation of videos from generated
|
929
|
-
graphs, such as heatmaps. Bivariate batch
|
930
|
-
criteria only.
|
931
|
-
|
932
|
-
.. versionadded: 1.2.20
|
933
|
-
|
934
|
-
""" + self.stage_usage_doc([4]),
|
935
|
-
action='store_true')
|
936
787
|
|
937
788
|
def init_stage5(self) -> None:
|
938
789
|
"""
|
939
790
|
Define cmdline arguments for stage 5.
|
940
791
|
"""
|
941
|
-
self.stage5.add_argument("--controllers-list",
|
942
|
-
help="""
|
943
|
-
|
944
|
-
Comma separated list of controllers to compare
|
945
|
-
within ``--sierra-root``.
|
946
|
-
|
947
|
-
The first controller in this list will be used
|
948
|
-
for as the controller of primary interest if ``--comparison-type`` is passed.
|
949
|
-
|
950
|
-
""" + self.stage_usage_doc([5]))
|
951
|
-
|
952
|
-
self.stage5.add_argument("--controllers-legend",
|
953
|
-
help="""
|
954
|
-
|
955
|
-
Comma separated list of names to use on the
|
956
|
-
legend for the generated comparison graphs,
|
957
|
-
specified in the same order as the
|
958
|
-
``--controllers-list``.
|
959
|
-
|
960
|
-
""" + self.stage_usage_doc([5],
|
961
|
-
"If omitted: the raw controller names will be used."))
|
962
|
-
|
963
|
-
self.stage5.add_argument("--scenarios-list",
|
964
|
-
help="""
|
965
|
-
|
966
|
-
Comma separated list of scenarios to compare
|
967
|
-
``--controller`` across within
|
968
|
-
``--sierra-root``.
|
969
|
-
|
970
|
-
""" + self.stage_usage_doc([5]))
|
971
|
-
|
972
|
-
self.stage5.add_argument("--scenarios-legend",
|
973
|
-
help="""
|
974
|
-
|
975
|
-
Comma separated list of names to use on the
|
976
|
-
legend for the generated inter-scenario
|
977
|
-
controller comparison graphs(if applicable),
|
978
|
-
specified in the same order as the
|
979
|
-
``--scenarios-list``.
|
980
|
-
|
981
|
-
""" + self.stage_usage_doc([5],
|
982
|
-
"If omitted: the raw scenario names will be used."))
|
983
|
-
self.stage5.add_argument("--scenario-comparison", help="""
|
984
|
-
|
985
|
-
Perform a comparison of ``--controller`` across
|
986
|
-
``--scenarios-list`` (univariate batch criteria
|
987
|
-
only). """
|
988
|
-
+ self.stage_usage_doc([5],
|
989
|
-
"""Either ``--scenario-comparison`` or ``--controller-comparison`` must be
|
990
|
-
passed."""), action='store_true')
|
991
|
-
|
992
|
-
self.stage5.add_argument("--controller-comparison",
|
993
|
-
help="""
|
994
|
-
|
995
|
-
Perform a comparison of ``--controllers-list``
|
996
|
-
across all scenarios at least one controller
|
997
|
-
has been run on. """ + self.stage_usage_doc([5],
|
998
|
-
"Either ``--scenario-comparison`` or ``--controller-comparison`` must be passed."),
|
999
|
-
action='store_true')
|
1000
|
-
|
1001
|
-
self.stage5.add_argument("--comparison-type",
|
1002
|
-
choices=['LNraw',
|
1003
|
-
'HMraw', 'HMdiff', 'HMscale',
|
1004
|
-
'SUraw', 'SUscale', 'SUdiff'],
|
1005
|
-
help="""
|
1006
|
-
|
1007
|
-
Specify how controller comparisons should be
|
1008
|
-
performed.
|
1009
|
-
|
1010
|
-
If the batch criteria is univariate, the
|
1011
|
-
options are:
|
1012
|
-
|
1013
|
-
- ``LNraw`` - Output raw 1D performance
|
1014
|
-
measures using a single """ +
|
1015
|
-
|
1016
|
-
utils.sphinx_ref(':class:`~sierra.core.graphs.summary_line_graph.SummaryLineGraph`') +
|
1017
|
-
|
1018
|
-
""" for each measure, with all ``--controllers-list`` controllers shown on the
|
1019
|
-
same graph.
|
1020
|
-
|
1021
|
-
If the batch criteria is bivariate, the options
|
1022
|
-
are:
|
1023
|
-
|
1024
|
-
- ``LNraw`` - Output raw performance measures
|
1025
|
-
as a set of """ +
|
1026
|
-
|
1027
|
-
utils.sphinx_ref(':class:`~sierra.core.graphs.summary_line_graph.SummaryLineGraph`') +
|
1028
|
-
|
1029
|
-
r"""s, where each
|
1030
|
-
line graph is constructed from the i-th
|
1031
|
-
row/column for the 2D dataframe for the
|
1032
|
-
performance results for all controllers.
|
1033
|
-
|
1034
|
-
.. NOTE:: SIERRA cannot currently plot
|
1035
|
-
statistics on the linegraphs built from
|
1036
|
-
slices of the 2D CSVs/heatmaps generated
|
1037
|
-
during stage4, because statistics
|
1038
|
-
generation is limited to stage3. This
|
1039
|
-
limitation may be removed in a future
|
1040
|
-
release.
|
1041
|
-
|
1042
|
-
- ``HMraw`` - Output raw 2D performance
|
1043
|
-
measures as a set of dual heatmaps comparing
|
1044
|
-
all controllers against the controller of
|
1045
|
-
primary interest(one per pair).
|
1046
|
-
|
1047
|
-
- ``HMdiff`` - Subtract the performance measure
|
1048
|
-
of the controller of primary interest against
|
1049
|
-
all other controllers, pairwise, outputting
|
1050
|
-
one 2D heatmap per comparison.
|
1051
|
-
|
1052
|
-
- ``HMscale`` - Scale controller performance
|
1053
|
-
measures against those of the controller of
|
1054
|
-
primary interest by dividing, outputing one
|
1055
|
-
2D heatmap per comparison.
|
1056
|
-
|
1057
|
-
- ``SUraw`` - Output raw 3D performance
|
1058
|
-
measures as a single, stacked 3D surface
|
1059
|
-
plots comparing all controllers(identical
|
1060
|
-
plots, but viewed from different angles).
|
1061
|
-
|
1062
|
-
- ``SUscale`` - Scale controller performance
|
1063
|
-
measures against those of the controller of
|
1064
|
-
primary interest by dividing. This results in
|
1065
|
-
a single stacked 3D surface plots comparing
|
1066
|
-
all controllers(identical plots, but viewed
|
1067
|
-
from different angles).
|
1068
|
-
|
1069
|
-
- ``SUdiff`` - Subtract the performance measure
|
1070
|
-
of the controller of primary interest from
|
1071
|
-
each controller(including the primary). This
|
1072
|
-
results in a set single stacked 3D surface
|
1073
|
-
plots comparing all controllers(identical
|
1074
|
-
plots, but viewed from different angles), in
|
1075
|
-
which the controller of primary interest
|
1076
|
-
forms an(X, Y) plane at Z=0.
|
1077
|
-
|
1078
|
-
|
1079
|
-
For all comparison types,
|
1080
|
-
``--controllers-legend`` is used if passed for
|
1081
|
-
legend.
|
1082
|
-
|
1083
|
-
""" + self.stage_usage_doc([5]))
|
1084
|
-
|
1085
|
-
self.stage5.add_argument("--bc-univar",
|
1086
|
-
help="""
|
1087
|
-
|
1088
|
-
Specify that the batch criteria is
|
1089
|
-
univariate. This cannot be deduced from the
|
1090
|
-
command line ``--batch-criteria`` argument in
|
1091
|
-
all cases because we are comparing controllers
|
1092
|
-
`across` scenarios, and each scenario
|
1093
|
-
(potentially) has a different batch criteria
|
1094
|
-
definition, which will result in (potentially)
|
1095
|
-
erroneous comparisons if we don't re-generate
|
1096
|
-
the batch criteria for each scenaro we compare
|
1097
|
-
controllers within.
|
1098
|
-
|
1099
|
-
""" + self.stage_usage_doc([5]),
|
1100
|
-
action='store_true')
|
1101
|
-
|
1102
|
-
self.stage5.add_argument("--bc-bivar",
|
1103
|
-
help="""
|
1104
|
-
|
1105
|
-
Specify that the batch criteria is
|
1106
|
-
bivariate. This cannot be deduced from the
|
1107
|
-
command line ``--batch-criteria`` argument in
|
1108
|
-
all cases because we are comparing controllers
|
1109
|
-
`across` scenarios, and each
|
1110
|
-
scenario(potentially) has a different batch
|
1111
|
-
criteria definition, which will result in
|
1112
|
-
(potentially) erroneous comparisons if we don't
|
1113
|
-
re-generate the batch criteria for each scenaro
|
1114
|
-
we compare controllers in .
|
1115
|
-
|
1116
|
-
""" + self.stage_usage_doc([5]),
|
1117
|
-
action='store_true')
|
1118
|
-
|
1119
|
-
|
1120
|
-
class CoreCmdlineValidator():
|
1121
|
-
"""Validate the core command line arguments.
|
1122
|
-
|
1123
|
-
This ensures that the pipeline will work properly in all stages, given the
|
1124
|
-
options that were passed.
|
1125
|
-
|
1126
|
-
"""
|
1127
|
-
|
1128
|
-
def __call__(self, args: argparse.Namespace) -> None:
|
1129
|
-
self._check_bc(args)
|
1130
|
-
self._check_pipeline(args)
|
1131
|
-
|
1132
|
-
assert args.sierra_root is not None,\
|
1133
|
-
'--sierra-root is required for all stages'
|
1134
|
-
|
1135
|
-
def _check_bc(self, args: argparse.Namespace) -> None:
|
1136
|
-
assert len(args.batch_criteria) <= 2,\
|
1137
|
-
"Too many batch criteria passed"
|
1138
|
-
|
1139
|
-
if len(args.batch_criteria) == 2:
|
1140
|
-
assert args.batch_criteria[0] != args.batch_criteria[1], \
|
1141
|
-
"Duplicate batch criteria passed"
|
1142
|
-
|
1143
|
-
assert isinstance(args.batch_criteria, list), \
|
1144
|
-
'Batch criteria not passed as list on cmdline'
|
1145
|
-
|
1146
|
-
def _check_pipeline(self, args: argparse.Namespace) -> None:
|
1147
|
-
if any(stage in args.pipeline for stage in [1]) in args.pipeline:
|
1148
|
-
assert args.n_runs is not None,\
|
1149
|
-
'--n-runs is required for running stage 1'
|
1150
|
-
assert args.template_input_file is not None,\
|
1151
|
-
'--template-input-file is required for running stage 1'
|
1152
|
-
assert args.scenario is not None, \
|
1153
|
-
'--scenario is required for running stage 1'
|
1154
|
-
|
1155
|
-
assert all(stage in [1, 2, 3, 4, 5] for stage in args.pipeline),\
|
1156
|
-
'Only 1-5 are valid pipeline stages'
|
1157
|
-
|
1158
|
-
if any(stage in args.pipeline for stage in [1, 2, 3, 4]):
|
1159
|
-
assert len(args.batch_criteria) > 0,\
|
1160
|
-
'--batch-criteria is required for running stages 1-4'
|
1161
|
-
assert args.controller is not None,\
|
1162
|
-
'--controller is required for running stages 1-4'
|
1163
|
-
|
1164
|
-
if 5 in args.pipeline:
|
1165
|
-
assert args.bc_univar or args.bc_bivar, \
|
1166
|
-
'--bc-univar or --bc-bivar is required for stage 5'
|
1167
|
-
assert args.scenario_comparison or args.controller_comparison,\
|
1168
|
-
'--scenario-comparison or --controller-comparison required for stage 5'
|
1169
|
-
if args.scenario_comparison:
|
1170
|
-
assert args.controller is not None,\
|
1171
|
-
'--controller is required for --scenario-comparison'
|
1172
792
|
|
1173
793
|
|
1174
794
|
def sphinx_cmdline_multistage():
|
1175
795
|
return CoreCmdline([BootstrapCmdline().parser], [-1]).parser
|
1176
796
|
|
1177
797
|
|
798
|
+
def sphinx_cmdline_stage1():
|
799
|
+
return CoreCmdline([], [1]).parser
|
800
|
+
|
801
|
+
|
1178
802
|
def sphinx_cmdline_stage3():
|
1179
|
-
return CoreCmdline(
|
803
|
+
return CoreCmdline([], [3]).parser
|
1180
804
|
|
1181
805
|
|
1182
806
|
def sphinx_cmdline_stage4():
|
1183
|
-
return CoreCmdline(
|
807
|
+
return CoreCmdline([], [4]).parser
|
1184
808
|
|
1185
809
|
|
1186
810
|
def sphinx_cmdline_stage5():
|
1187
|
-
return CoreCmdline(
|
811
|
+
return CoreCmdline([], [5]).parser
|
1188
812
|
|
1189
813
|
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
814
|
+
__all__ = [
|
815
|
+
"ArgumentParser",
|
816
|
+
"BaseCmdline",
|
817
|
+
"BootstrapCmdline",
|
818
|
+
"CoreCmdline",
|
1195
819
|
]
|