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
@@ -2,34 +2,25 @@
|
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: MIT
|
4
4
|
|
5
|
-
"""Stage 4 of the experimental pipeline: generating
|
6
|
-
|
7
|
-
"""
|
5
|
+
"""Stage 4 of the experimental pipeline: generating products."""
|
8
6
|
|
9
7
|
# Core packages
|
10
|
-
import typing as tp
|
11
8
|
import time
|
12
9
|
import datetime
|
13
10
|
import logging
|
14
11
|
import pathlib
|
15
12
|
|
16
13
|
# 3rd party packages
|
17
|
-
import yaml
|
18
14
|
|
19
15
|
# Project packages
|
20
|
-
from sierra.core.pipeline.stage4.graph_collator import GraphParallelCollator
|
21
|
-
from sierra.core.pipeline.stage4.intra_exp_graph_generator import BatchIntraExpGraphGenerator
|
22
|
-
from sierra.core.pipeline.stage4.model_runner import IntraExpModelRunner
|
23
|
-
from sierra.core.pipeline.stage4.model_runner import InterExpModelRunner
|
24
16
|
import sierra.core.variables.batch_criteria as bc
|
25
17
|
|
26
|
-
|
27
|
-
|
28
|
-
from sierra.core import types, config, utils
|
18
|
+
import sierra.core.plugin as pm
|
19
|
+
from sierra.core import types, batchroot
|
29
20
|
|
30
21
|
|
31
22
|
class PipelineStage4:
|
32
|
-
"""Generates end-result experimental
|
23
|
+
"""Generates end-result experimental products.
|
33
24
|
|
34
25
|
Delvirables can be within a single experiment (intra-experiment) and across
|
35
26
|
experiments in a batch (inter-experiment). Currently this includes:
|
@@ -41,7 +32,6 @@ class PipelineStage4:
|
|
41
32
|
This stage is idempotent.
|
42
33
|
|
43
34
|
Attributes:
|
44
|
-
|
45
35
|
cmdopts: Dictionary of parsed cmdline options.
|
46
36
|
|
47
37
|
controller_config: YAML configuration file found in
|
@@ -51,361 +41,53 @@ class PipelineStage4:
|
|
51
41
|
graphs in both inter- and intra-experiment graph
|
52
42
|
generation.
|
53
43
|
|
54
|
-
|
55
|
-
``<project_config_root>/
|
56
|
-
Contains configuration for categories of
|
57
|
-
that can potentially be generated for all controllers
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
intra_LN_config: YAML configuration file found in
|
63
|
-
``<project_config_root>/intra-graphs-line.yaml``
|
64
|
-
Contains configuration for categories of linegraphs
|
65
|
-
that can potentially be generated for all controllers
|
66
|
-
`within` each experiment in a batch. Which linegraphs
|
67
|
-
are actually generated for a given controller in each
|
68
|
-
experiment is controlled by
|
69
|
-
``<project_config_root>/controllers.yaml``.
|
70
|
-
|
71
|
-
intra_HM_config: YAML configuration file found in
|
72
|
-
``<project_config_root>/intra-graphs-hm.yaml`` Contains
|
73
|
-
configuration for categories of heatmaps that can
|
74
|
-
potentially be generated for all controllers `within`
|
75
|
-
each experiment in a batch. Which heatmaps are actually
|
76
|
-
generated for a given controller in each experiment is
|
44
|
+
graphs_config: YAML configuration file found in
|
45
|
+
``<project_config_root>/graphs.yaml``
|
46
|
+
Contains configuration for categories of graphs
|
47
|
+
that *can* potentially be generated for all controllers
|
48
|
+
*across* experiments in a batch and *within* each
|
49
|
+
experiment in a batch. Which linegraphs are
|
50
|
+
*actually* generated for a given controller is
|
77
51
|
controlled by
|
78
52
|
``<project_config_root>/controllers.yaml``.
|
79
|
-
|
80
|
-
inter_HM_config: YAML configuration file found in
|
81
|
-
``<project_config_root>/inter-graphs-hm.yaml`` Contains
|
82
|
-
configuration for categories of heatmaps that can
|
83
|
-
potentially be generated for all controllers `across`
|
84
|
-
each experiment in a batch. Which heatmaps are actually
|
85
|
-
generated for a given controller in each experiment is
|
86
|
-
controlled by
|
87
|
-
``<project_config_root>/controllers.yaml``.
|
88
|
-
|
89
53
|
"""
|
90
54
|
|
91
|
-
def __init__(
|
92
|
-
|
93
|
-
|
94
|
-
|
55
|
+
def __init__(
|
56
|
+
self,
|
57
|
+
main_config: types.YAMLDict,
|
58
|
+
cmdopts: types.Cmdopts,
|
59
|
+
pathset: batchroot.PathSet,
|
60
|
+
) -> None:
|
95
61
|
self.main_config = main_config
|
62
|
+
self.cmdopts = cmdopts
|
63
|
+
self.pathset = pathset
|
96
64
|
|
97
|
-
self.project_config_root = pathlib.Path(self.cmdopts[
|
98
|
-
controllers_yaml = self.project_config_root / config.kYAML.controllers
|
65
|
+
self.project_config_root = pathlib.Path(self.cmdopts["project_config_root"])
|
99
66
|
|
100
|
-
with utils.utf8open(controllers_yaml) as f:
|
101
|
-
self.controller_config = yaml.load(f, yaml.FullLoader)
|
102
67
|
self.logger = logging.getLogger(__name__)
|
103
68
|
|
104
69
|
# Load YAML config
|
105
|
-
loader = pm.module_load_tiered(project=self.cmdopts['project'],
|
106
|
-
path='pipeline.stage4.yaml_config_loader')
|
107
|
-
graphs_config = loader.YAMLConfigLoader()(self.cmdopts)
|
108
|
-
self.intra_LN_config = graphs_config['intra_LN']
|
109
|
-
self.intra_HM_config = graphs_config['intra_HM']
|
110
|
-
self.inter_HM_config = graphs_config['inter_HM']
|
111
|
-
self.inter_LN_config = graphs_config['inter_LN']
|
112
|
-
|
113
|
-
# Load models
|
114
|
-
if self.cmdopts['models_enable']:
|
115
|
-
self._load_models()
|
116
|
-
|
117
|
-
def run(self, criteria: bc.IConcreteBatchCriteria) -> None:
|
118
|
-
"""Run the pipeline stage.
|
119
|
-
|
120
|
-
Intra-experiment graph generation: if intra-experiment graphs should be
|
121
|
-
generated, according to cmdline configuration, the following is run:
|
122
|
-
|
123
|
-
#. Model generation for each enabled and loaded model.
|
124
|
-
|
125
|
-
#. :class:`~sierra.core.pipeline.stage4.intra_exp_graph_generator.BatchIntraExpGraphGenerator`
|
126
|
-
to generate graphs for each experiment in the batch, or a subset.
|
127
|
-
|
128
|
-
Inter-experiment graph generation: if inter-experiment graphs should be
|
129
|
-
generated according to cmdline configuration, the following is run:
|
130
|
-
|
131
|
-
#. :class:`~sierra.core.pipeline.stage4.graph_collator.UnivarGraphCollator`
|
132
|
-
or
|
133
|
-
:class:`~sierra.core.pipeline.stage4.graph_collator.BivarGraphCollator`
|
134
|
-
as appropriate (depending on which type of
|
135
|
-
:class:`~sierra.core.variables.batch_criteria.BatchCriteria` was
|
136
|
-
specified on the cmdline).
|
137
|
-
|
138
|
-
#. Model generation for each enabled and loaded model.
|
139
|
-
|
140
|
-
#. :class:`~sierra.core.pipeline.stage4.inter_exp_graph_generator.InterExpGraphGenerator`
|
141
|
-
to perform graph generation from collated CSV files.
|
142
|
-
|
143
|
-
|
144
|
-
Video generation: The following is run:
|
145
|
-
|
146
|
-
#. :class:`~sierra.core.pipeline.stage4.rendering.PlatformFramesRenderer`,
|
147
|
-
if ``--platform-vc`` was passed
|
148
|
-
|
149
|
-
#. :class:`~sierra.core.pipeline.stage4.rendering.ProjectFramesRenderer`,
|
150
|
-
if ``--project-imagizing`` was passed previously to generate frames,
|
151
|
-
and ``--project-rendering`` is passed.
|
152
|
-
|
153
|
-
#. :class:`~sierra.core.pipeline.stage4.rendering.BivarHeatmapRenderer`,
|
154
|
-
if the batch criteria was bivariate and ``--HM-rendering`` was
|
155
|
-
passed.
|
156
|
-
|
157
|
-
"""
|
158
|
-
if self.cmdopts['exp_graphs'] == 'all' or self.cmdopts['exp_graphs'] == 'intra':
|
159
|
-
if criteria.is_univar() and self.cmdopts['models_enable']:
|
160
|
-
self._run_intra_models(criteria)
|
161
|
-
|
162
|
-
self._run_intra_graph_generation(criteria)
|
163
|
-
|
164
|
-
# Collation must be after intra-experiment graph generation, so that all
|
165
|
-
# .csv files to be collated have been generated/modified according to
|
166
|
-
# parameters.
|
167
|
-
if self.cmdopts['exp_graphs'] == 'all' or self.cmdopts['exp_graphs'] == 'inter':
|
168
|
-
self._run_collation(criteria)
|
169
|
-
|
170
|
-
if criteria.is_univar() and self.cmdopts['models_enable']:
|
171
|
-
self._run_inter_models(criteria)
|
172
|
-
|
173
|
-
self._run_inter_graph_generation(criteria)
|
174
|
-
|
175
|
-
# Rendering must be after graph generation in case we should be
|
176
|
-
# rendering videos from generated graphs.
|
177
|
-
self._run_rendering(criteria)
|
178
|
-
|
179
|
-
def _load_models(self) -> None:
|
180
|
-
project_models = self.project_config_root / config.kYAML.models
|
181
|
-
self.models_intra = []
|
182
|
-
self.models_inter = []
|
183
|
-
|
184
|
-
if not utils.path_exists(project_models):
|
185
|
-
self.logger.debug("No models to load for project '%s': %s does not exist",
|
186
|
-
self.cmdopts['project'],
|
187
|
-
project_models)
|
188
|
-
return
|
189
70
|
|
190
|
-
|
191
|
-
|
71
|
+
def run(self, criteria: bc.XVarBatchCriteria) -> None:
|
72
|
+
"""Run the pipeline stage."""
|
73
|
+
spec = self.cmdopts["prod"]
|
74
|
+
self.logger.info("Generating products %s product plugins: %s", len(spec), spec)
|
192
75
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
76
|
+
for s in spec:
|
77
|
+
module = pm.pipeline.get_plugin_module(s)
|
78
|
+
self.logger.info(
|
79
|
+
"Running %s in <batchroot>/%s",
|
80
|
+
s,
|
81
|
+
self.pathset.output_root.relative_to(self.pathset.root),
|
82
|
+
)
|
197
83
|
|
198
|
-
# All models present in the .yaml file are enabled/set to run
|
199
|
-
# unconditionally
|
200
|
-
available = pm.models.available_plugins()
|
201
|
-
self.logger.debug("Project %s has %d available model plugins",
|
202
|
-
self.cmdopts['project'],
|
203
|
-
len(available))
|
204
|
-
|
205
|
-
for module_name in pm.models.available_plugins():
|
206
|
-
# No models specified--nothing to do
|
207
|
-
if self.models_config.get('models') is None:
|
208
|
-
continue
|
209
|
-
|
210
|
-
for conf in self.models_config['models']:
|
211
|
-
if conf['pyfile'] == module_name:
|
212
|
-
|
213
|
-
self.logger.debug("Model %s enabled by configuration",
|
214
|
-
module_name)
|
215
|
-
pm.models.load_plugin(module_name)
|
216
|
-
model_name = f'models.{module_name}'
|
217
|
-
module = pm.models.get_plugin_module(model_name)
|
218
|
-
self.logger.debug(("Configured model %s has %d "
|
219
|
-
"intra-experiment models"),
|
220
|
-
model_name,
|
221
|
-
len(module.available_models('intra')))
|
222
|
-
|
223
|
-
self.logger.debug(("Configured model %s has %d "
|
224
|
-
"inter-experiment models"),
|
225
|
-
model_name,
|
226
|
-
len(module.available_models('inter')))
|
227
|
-
|
228
|
-
for avail in module.available_models('intra'):
|
229
|
-
model = getattr(module, avail)(self.main_config, conf)
|
230
|
-
self.models_intra.append(model)
|
231
|
-
|
232
|
-
for avail in module.available_models('inter'):
|
233
|
-
model = getattr(module, avail)(self.main_config, conf)
|
234
|
-
self.models_inter.append(model)
|
235
|
-
else:
|
236
|
-
self.logger.debug("Model %s disabled by configuration",
|
237
|
-
module_name)
|
238
|
-
|
239
|
-
if len(self.models_intra) > 0:
|
240
|
-
self.logger.info("Loaded %s intra-experiment models for project '%s'",
|
241
|
-
len(self.models_intra),
|
242
|
-
self.cmdopts['project'])
|
243
|
-
|
244
|
-
if len(self.models_inter) > 0:
|
245
|
-
self.logger.info("Loaded %s inter-experiment models for project '%s'",
|
246
|
-
len(self.models_inter),
|
247
|
-
self.cmdopts['project'])
|
248
|
-
|
249
|
-
def _calc_inter_targets(self,
|
250
|
-
name: str,
|
251
|
-
category_prefix: str,
|
252
|
-
loaded_graphs: types.YAMLDict) -> tp.List[types.YAMLDict]:
|
253
|
-
"""Calculate what inter-experiment graphs to generate.
|
254
|
-
|
255
|
-
This also defines what CSV files need to be collated, as one graph is
|
256
|
-
always generated from one CSV file. Uses YAML configuration for
|
257
|
-
controllers and inter-experiment graphs.
|
258
|
-
|
259
|
-
"""
|
260
|
-
keys = []
|
261
|
-
for category in list(self.controller_config.keys()):
|
262
|
-
if category not in self.cmdopts['controller']:
|
263
|
-
continue
|
264
|
-
for controller in self.controller_config[category]['controllers']:
|
265
|
-
if controller['name'] not in self.cmdopts['controller']:
|
266
|
-
continue
|
267
|
-
|
268
|
-
# valid to specify no graphs, and only to inherit graphs
|
269
|
-
keys = controller.get('graphs', [])
|
270
|
-
if 'graphs_inherit' in controller:
|
271
|
-
for inherit in controller['graphs_inherit']:
|
272
|
-
keys.extend(inherit) # optional
|
273
|
-
|
274
|
-
self.logger.debug("Loaded %s inter-experiment categories: %s",
|
275
|
-
name,
|
276
|
-
keys)
|
277
|
-
|
278
|
-
filtered_keys = [k for k in loaded_graphs if category_prefix in k]
|
279
|
-
filtered_keys = [k for k in loaded_graphs if k in keys]
|
280
|
-
targets = [loaded_graphs[k] for k in filtered_keys]
|
281
|
-
|
282
|
-
self.logger.debug("Enabled %s inter-experiment categories: %s", name,
|
283
|
-
filtered_keys)
|
284
|
-
return targets
|
285
|
-
|
286
|
-
def _run_rendering(self, criteria: bc.IConcreteBatchCriteria) -> None:
|
287
|
-
"""Render captured frames and/or imagized frames into videos.
|
288
|
-
|
289
|
-
"""
|
290
|
-
if ((not self.cmdopts['platform_vc']) and
|
291
|
-
(not self.cmdopts['project_rendering']) and
|
292
|
-
(not (criteria.is_bivar() and self.cmdopts['bc_rendering']))):
|
293
|
-
return
|
294
|
-
|
295
|
-
self.logger.info("Rendering videos...")
|
296
|
-
start = time.time()
|
297
|
-
|
298
|
-
if self.cmdopts['platform_vc']:
|
299
|
-
rendering.PlatformFramesRenderer(self.main_config,
|
300
|
-
self.cmdopts)(criteria)
|
301
|
-
else:
|
302
|
-
self.logger.debug(("--platform-vc not passed--skipping rendering "
|
303
|
-
"frames captured by the platform"))
|
304
|
-
|
305
|
-
if self.cmdopts['project_rendering']:
|
306
|
-
rendering.ProjectFramesRenderer(self.main_config,
|
307
|
-
self.cmdopts)(criteria)
|
308
|
-
else:
|
309
|
-
self.logger.debug(("--project-rendering not passed--skipping "
|
310
|
-
"rendering frames captured by the project"))
|
311
|
-
|
312
|
-
if criteria.is_bivar() and self.cmdopts['bc_rendering']:
|
313
|
-
rendering.BivarHeatmapRenderer(self.main_config,
|
314
|
-
self.cmdopts)(criteria)
|
315
|
-
else:
|
316
|
-
self.logger.debug(("--bc-rendering not passed or univariate batch "
|
317
|
-
"criteria--skipping rendering generated graphs"))
|
318
|
-
|
319
|
-
elapsed = int(time.time() - start)
|
320
|
-
sec = datetime.timedelta(seconds=elapsed)
|
321
|
-
self.logger.info("Rendering complete in %s", str(sec))
|
322
|
-
|
323
|
-
def _run_intra_models(self, criteria: bc.IConcreteBatchCriteria) -> None:
|
324
|
-
self.logger.info("Running %d intra-experiment models...",
|
325
|
-
len(self.models_intra))
|
326
|
-
start = time.time()
|
327
|
-
IntraExpModelRunner(self.cmdopts,
|
328
|
-
self.models_intra)(self.main_config,
|
329
|
-
criteria)
|
330
|
-
elapsed = int(time.time() - start)
|
331
|
-
sec = datetime.timedelta(seconds=elapsed)
|
332
|
-
self.logger.info("Intra-experiment models finished in %s", str(sec))
|
333
|
-
|
334
|
-
def _run_inter_models(self, criteria: bc.IConcreteBatchCriteria) -> None:
|
335
|
-
self.logger.info("Running %d inter-experiment models...",
|
336
|
-
len(self.models_inter))
|
337
|
-
start = time.time()
|
338
|
-
|
339
|
-
runner = InterExpModelRunner(self.cmdopts, self.models_inter)
|
340
|
-
runner(self.main_config, criteria)
|
341
|
-
|
342
|
-
elapsed = int(time.time() - start)
|
343
|
-
sec = datetime.timedelta(seconds=elapsed)
|
344
|
-
self.logger.info("Inter-experiment models finished in %s", str(sec))
|
345
|
-
|
346
|
-
def _run_intra_graph_generation(self, criteria: bc.IConcreteBatchCriteria) -> None:
|
347
|
-
"""
|
348
|
-
Generate intra-experiment graphs (duh).
|
349
|
-
"""
|
350
|
-
self.logger.info("Generating intra-experiment graphs...")
|
351
|
-
start = time.time()
|
352
|
-
BatchIntraExpGraphGenerator(self.cmdopts)(self.main_config,
|
353
|
-
self.controller_config,
|
354
|
-
self.intra_LN_config,
|
355
|
-
self.intra_HM_config,
|
356
|
-
criteria)
|
357
|
-
elapsed = int(time.time() - start)
|
358
|
-
sec = datetime.timedelta(seconds=elapsed)
|
359
|
-
self.logger.info(
|
360
|
-
"Intra-experiment graph generation complete: %s", str(sec))
|
361
|
-
|
362
|
-
def _run_collation(self, criteria: bc.IConcreteBatchCriteria) -> None:
|
363
|
-
LN_targets = self._calc_inter_targets(name='linegraph',
|
364
|
-
category_prefix='LN',
|
365
|
-
loaded_graphs=self.inter_LN_config)
|
366
|
-
HM_targets = self._calc_inter_targets(name='heatmap',
|
367
|
-
category_prefix='HM',
|
368
|
-
loaded_graphs=self.inter_HM_config)
|
369
|
-
|
370
|
-
if not self.cmdopts['skip_collate']:
|
371
|
-
self.logger.info("Collating inter-experiment CSV files...")
|
372
84
|
start = time.time()
|
373
|
-
|
374
|
-
|
375
|
-
|
85
|
+
module.proc_batch_exp(
|
86
|
+
self.main_config, self.cmdopts, self.pathset, criteria
|
87
|
+
)
|
376
88
|
elapsed = int(time.time() - start)
|
377
89
|
sec = datetime.timedelta(seconds=elapsed)
|
378
|
-
self.logger.info("
|
379
|
-
str(sec))
|
380
|
-
|
381
|
-
def _run_inter_graph_generation(self, criteria: bc.IConcreteBatchCriteria) -> None:
|
382
|
-
"""
|
383
|
-
Generate inter-experiment graphs (duh).
|
384
|
-
"""
|
385
|
-
LN_targets = self._calc_inter_targets(name='linegraph',
|
386
|
-
category_prefix='LN',
|
387
|
-
loaded_graphs=self.inter_LN_config)
|
388
|
-
HM_targets = self._calc_inter_targets(name='heatmap',
|
389
|
-
category_prefix='HM',
|
390
|
-
loaded_graphs=self.inter_HM_config)
|
391
|
-
|
392
|
-
self.logger.info("Generating inter-experiment graphs...")
|
393
|
-
start = time.time()
|
394
|
-
|
395
|
-
module = pm.module_load_tiered(project=self.cmdopts['project'],
|
396
|
-
path='pipeline.stage4.inter_exp_graph_generator')
|
397
|
-
generator = module.InterExpGraphGenerator(self.main_config,
|
398
|
-
self.cmdopts,
|
399
|
-
LN_targets,
|
400
|
-
HM_targets)
|
401
|
-
generator(criteria)
|
402
|
-
elapsed = int(time.time() - start)
|
403
|
-
sec = datetime.timedelta(seconds=elapsed)
|
404
|
-
|
405
|
-
self.logger.info("Inter-experiment graph generation complete: %s",
|
406
|
-
str(sec))
|
90
|
+
self.logger.info("Generation with %s complete in %s", s, str(sec))
|
407
91
|
|
408
92
|
|
409
|
-
|
410
|
-
'PipelineStage4'
|
411
|
-
]
|
93
|
+
__all__ = ["PipelineStage4"]
|