ceci 2.1__tar.gz → 2.2__tar.gz
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.
- {ceci-2.1 → ceci-2.2}/PKG-INFO +1 -1
- {ceci-2.1 → ceci-2.2}/ceci/_version.py +2 -2
- {ceci-2.1 → ceci-2.2}/ceci/config.py +41 -0
- {ceci-2.1 → ceci-2.2}/ceci/pipeline.py +10 -5
- {ceci-2.1 → ceci-2.2}/ceci/stage.py +19 -19
- {ceci-2.1 → ceci-2.2}/ceci.egg-info/PKG-INFO +1 -1
- {ceci-2.1 → ceci-2.2}/tests/test_stage.py +1 -1
- {ceci-2.1 → ceci-2.2}/.coveragerc +0 -0
- {ceci-2.1 → ceci-2.2}/.github/workflows/ci.yml +0 -0
- {ceci-2.1 → ceci-2.2}/.github/workflows/publish.yml +0 -0
- {ceci-2.1 → ceci-2.2}/.gitignore +0 -0
- {ceci-2.1 → ceci-2.2}/.pylintrc +0 -0
- {ceci-2.1 → ceci-2.2}/LICENSE +0 -0
- {ceci-2.1 → ceci-2.2}/README.md +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/__init__.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/__main__.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/errors.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/main.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/minirunner.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/monitor.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/sites/__init__.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/sites/ccin2p3.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/sites/local.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/sites/nersc.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/sites/site.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/tools/__init__.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/tools/ancestors.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/update_pipelines_for_ceci_2.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci/utils.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci.egg-info/SOURCES.txt +0 -0
- {ceci-2.1 → ceci-2.2}/ceci.egg-info/dependency_links.txt +0 -0
- {ceci-2.1 → ceci-2.2}/ceci.egg-info/entry_points.txt +0 -0
- {ceci-2.1 → ceci-2.2}/ceci.egg-info/requires.txt +0 -0
- {ceci-2.1 → ceci-2.2}/ceci.egg-info/top_level.txt +0 -0
- {ceci-2.1 → ceci-2.2}/ceci.png +0 -0
- {ceci-2.1 → ceci-2.2}/ceci_example/__init__.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci_example/__main__.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci_example/example_stages.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci_example/types.py +0 -0
- {ceci-2.1 → ceci-2.2}/ceci_example_namespace/example_stages.py +0 -0
- {ceci-2.1 → ceci-2.2}/do_cover.sh +0 -0
- {ceci-2.1 → ceci-2.2}/docs/Makefile +0 -0
- {ceci-2.1 → ceci-2.2}/docs/conf.py +0 -0
- {ceci-2.1 → ceci-2.2}/docs/config.rst +0 -0
- {ceci-2.1 → ceci-2.2}/docs/config2.rst +0 -0
- {ceci-2.1 → ceci-2.2}/docs/index.rst +0 -0
- {ceci-2.1 → ceci-2.2}/docs/installation.rst +0 -0
- {ceci-2.1 → ceci-2.2}/docs/launchers.rst +0 -0
- {ceci-2.1 → ceci-2.2}/docs/logo.png +0 -0
- {ceci-2.1 → ceci-2.2}/docs/overview.rst +0 -0
- {ceci-2.1 → ceci-2.2}/docs/sites.rst +0 -0
- {ceci-2.1 → ceci-2.2}/docs/stages.rst +0 -0
- {ceci-2.1 → ceci-2.2}/docs/tutorial.rst +0 -0
- {ceci-2.1 → ceci-2.2}/nb/ceci_interactive_example.ipynb +0 -0
- {ceci-2.1 → ceci-2.2}/pyproject.toml +0 -0
- {ceci-2.1 → ceci-2.2}/setup.cfg +0 -0
- {ceci-2.1 → ceci-2.2}/setup.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/__init__.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/config.yml +0 -0
- {ceci-2.1 → ceci-2.2}/tests/config_nm.yml +0 -0
- {ceci-2.1 → ceci-2.2}/tests/create_registry_entries.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/inputs/dm.txt +0 -0
- {ceci-2.1 → ceci-2.2}/tests/inputs/fiducial_cosmology.txt +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test.hdf5 +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test.yml +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_cmd.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_dask.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_dataregistry.yml +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_executables.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_flow_chart.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_helpers.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_interactive.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_main.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_minirunner.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_monitor.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_namespace.yml +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_pipeline.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_python_paths.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_site.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_snapshot.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_update_script.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/test_utils.py +0 -0
- {ceci-2.1 → ceci-2.2}/tests/update_test_files/config.yml +0 -0
- {ceci-2.1 → ceci-2.2}/tests/update_test_files/pipeline1.yml +0 -0
- {ceci-2.1 → ceci-2.2}/tests/update_test_files/pipeline2.yml +0 -0
{ceci-2.1 → ceci-2.2}/PKG-INFO
RENAMED
|
@@ -88,6 +88,10 @@ class StageParameter:
|
|
|
88
88
|
self._required = self._default is None
|
|
89
89
|
self._value = cast_value(self._dtype, self._default)
|
|
90
90
|
|
|
91
|
+
def __repr__(self):
|
|
92
|
+
req_str = 'required' if self.required else 'optional'
|
|
93
|
+
return f"Parameter({self.msg}, type: {self.dtype}, default: {self.default} [{req_str}])"
|
|
94
|
+
|
|
91
95
|
@property
|
|
92
96
|
def value(self):
|
|
93
97
|
"""Return the value"""
|
|
@@ -138,6 +142,27 @@ class StageParameter:
|
|
|
138
142
|
self._default = default
|
|
139
143
|
self.set_to_default()
|
|
140
144
|
|
|
145
|
+
def numpy_style_help_text(self):
|
|
146
|
+
"""Create a docstring followwing numpy style guidelines"""
|
|
147
|
+
s = ""
|
|
148
|
+
if self._dtype is None:
|
|
149
|
+
s += "[type not specified] "
|
|
150
|
+
else:
|
|
151
|
+
s += f"[{self._dtype.__name__}] "
|
|
152
|
+
if self._required:
|
|
153
|
+
s += "(required)"
|
|
154
|
+
else:
|
|
155
|
+
# truncate long dicts
|
|
156
|
+
if isinstance(self._default, dict) and len(self._default) > 10:
|
|
157
|
+
s += "(default={...})"
|
|
158
|
+
# truncate long lists
|
|
159
|
+
elif isinstance(self._default, list) and len(self._default) > 10:
|
|
160
|
+
s += "(default=[...])"
|
|
161
|
+
else:
|
|
162
|
+
s += f"default={self._default}"
|
|
163
|
+
s += f"\n {self._help}"
|
|
164
|
+
return s
|
|
165
|
+
|
|
141
166
|
|
|
142
167
|
class StageConfig(dict):
|
|
143
168
|
"""A small class to manage a dictionary of configuration parameters with basic type checking"""
|
|
@@ -279,3 +304,19 @@ class StageConfig(dict):
|
|
|
279
304
|
if isinstance(attr, StageParameter):
|
|
280
305
|
return attr.dtype
|
|
281
306
|
return type(attr)
|
|
307
|
+
|
|
308
|
+
def numpy_style_help_text(self):
|
|
309
|
+
"""Create a docstring followwing numpy style guidelines"""
|
|
310
|
+
if not self:
|
|
311
|
+
return "<This class has no configuration options>"
|
|
312
|
+
s = []
|
|
313
|
+
for key, val in dict.items(self):
|
|
314
|
+
if isinstance(val, StageConfig):
|
|
315
|
+
val = val[key]
|
|
316
|
+
if isinstance(val, StageParameter):
|
|
317
|
+
s.append(f"{key}: {val.numpy_style_help_text()}")
|
|
318
|
+
elif isinstance(val, type):
|
|
319
|
+
s.append(f"{key}: {val.__name__}] (required)")
|
|
320
|
+
else:
|
|
321
|
+
s.append(f"{key}: {type(val).__name__}] (default={val})")
|
|
322
|
+
return '\n\n'.join(s)
|
|
@@ -524,18 +524,23 @@ class Pipeline:
|
|
|
524
524
|
else:
|
|
525
525
|
raise ValueError("Must specify either id or name in registry lookup")
|
|
526
526
|
|
|
527
|
+
# Whatever the lookup, we always require a dataset which has not beed deleted or replaced
|
|
528
|
+
status_filter = registry.Query.gen_filter("dataset.status", "==", 1)
|
|
529
|
+
|
|
527
530
|
# Main finder method
|
|
528
|
-
results = registry.Query.find_datasets(["dataset.dataset_id"], [filter])
|
|
531
|
+
results = registry.Query.find_datasets(["dataset.dataset_id"], [filter, status_filter])
|
|
529
532
|
|
|
530
533
|
# Check that we find exactly one dataset matching the query
|
|
531
|
-
|
|
532
|
-
if len(results) == 0:
|
|
534
|
+
if not results:
|
|
533
535
|
raise ValueError(f"Could not find any dataset matching {info} in registry")
|
|
534
|
-
|
|
536
|
+
|
|
537
|
+
results = results['dataset.dataset_id']
|
|
538
|
+
|
|
539
|
+
if len(results) > 1:
|
|
535
540
|
raise ValueError(f"Found multiple datasets matching {info} in registry")
|
|
536
541
|
|
|
537
542
|
# Get the absolute path
|
|
538
|
-
return registry.Query.get_dataset_absolute_path(results[0]
|
|
543
|
+
return registry.Query.get_dataset_absolute_path(results[0])
|
|
539
544
|
|
|
540
545
|
|
|
541
546
|
def process_overall_inputs(self, inputs):
|
|
@@ -153,13 +153,13 @@ class PipelineStage:
|
|
|
153
153
|
Subclasses must implemented this method.
|
|
154
154
|
"""
|
|
155
155
|
raise NotImplementedError("run")
|
|
156
|
-
|
|
156
|
+
|
|
157
157
|
def validate(self):
|
|
158
158
|
"""Check that the inputs actually have the data needed for execution,
|
|
159
159
|
This is called before the run method. It is an optional stage, meant
|
|
160
160
|
for checking that the input to the stage is actual in the form and
|
|
161
161
|
shape needed before an expensive run is executed."""
|
|
162
|
-
pass
|
|
162
|
+
pass
|
|
163
163
|
|
|
164
164
|
def load_configs(self, args):
|
|
165
165
|
"""
|
|
@@ -356,11 +356,11 @@ class PipelineStage:
|
|
|
356
356
|
if stage_is_complete and cls.config_options:
|
|
357
357
|
config_text = cls._describe_configuration_text()
|
|
358
358
|
if cls.__doc__ is None:
|
|
359
|
-
cls.__doc__ = f"Stage {cls.name}\n\
|
|
359
|
+
cls.__doc__ = f"Stage {cls.name}\n\nParameters\n----------\n{config_text}"
|
|
360
360
|
else:
|
|
361
361
|
# strip any existing configuration text from parent classes that is at the end of the doctring
|
|
362
|
-
cls.__doc__ = cls.__doc__.split("
|
|
363
|
-
cls.__doc__ += f"\n\
|
|
362
|
+
cls.__doc__ = cls.__doc__.split("Parameters")[0]
|
|
363
|
+
cls.__doc__ += f"\n\nParameters\n----------\n{config_text}"
|
|
364
364
|
|
|
365
365
|
# Register the class
|
|
366
366
|
if stage_is_complete:
|
|
@@ -436,24 +436,24 @@ class PipelineStage:
|
|
|
436
436
|
s = []
|
|
437
437
|
if cls.config_options is None:
|
|
438
438
|
return "<This class has no configuration options>"
|
|
439
|
+
|
|
439
440
|
for name, val in cls.config_options.items():
|
|
441
|
+
if isinstance(val, StageConfig):
|
|
442
|
+
val = val[name]
|
|
440
443
|
if isinstance(val, StageParameter):
|
|
441
|
-
|
|
442
|
-
if val.dtype is None:
|
|
443
|
-
txt = f"[type not specified]: {val._help} (required)"
|
|
444
|
-
else:
|
|
445
|
-
txt = f"[{val.dtype.__name__}]: {val._help} (required)"
|
|
446
|
-
else:
|
|
447
|
-
if val.dtype is None:
|
|
448
|
-
txt = f"[type not specified]: {val._help} (default={val.default})"
|
|
449
|
-
else:
|
|
450
|
-
txt = f"[{val.dtype.__name__}]: {val._help} (default={val.default})"
|
|
444
|
+
s.append(f"{name}: {val.numpy_style_help_text()}")
|
|
451
445
|
elif isinstance(val, type):
|
|
452
|
-
|
|
446
|
+
s.append(f"{name}: {val.__name__}] (required)")
|
|
453
447
|
else:
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
448
|
+
s.append(f"{name}: {type(val).__name__}] (default={val})")
|
|
449
|
+
|
|
450
|
+
for input_ in cls.inputs:
|
|
451
|
+
s.append(f"{input_[0]}: {input_[1].__name__} (INPUT)")
|
|
452
|
+
for output_ in cls.outputs:
|
|
453
|
+
s.append(f"{output_[0]}: {output_[1].__name__} (OUTPUT)")
|
|
454
|
+
|
|
455
|
+
return '\n\n'.join(s)
|
|
456
|
+
|
|
457
457
|
|
|
458
458
|
@classmethod
|
|
459
459
|
def usage(cls): # pragma: no cover
|
|
@@ -149,7 +149,7 @@ def test_parameter():
|
|
|
149
149
|
assert stage_1.config.b == 'puffins are not extinct?'
|
|
150
150
|
assert 1 in stage_1.config.c
|
|
151
151
|
assert len(stage_1.config.d) == 0
|
|
152
|
-
assert "
|
|
152
|
+
assert "[list] default=[1, 2, 3]" in stage_1.__doc__
|
|
153
153
|
stage_1.describe_configuration()
|
|
154
154
|
|
|
155
155
|
cmd = "TestStage", "--a", "6", "--b", "puffins are not extinct?", "--inp", "dummy"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ceci-2.1 → ceci-2.2}/.gitignore
RENAMED
|
File without changes
|
{ceci-2.1 → ceci-2.2}/.pylintrc
RENAMED
|
File without changes
|
{ceci-2.1 → ceci-2.2}/LICENSE
RENAMED
|
File without changes
|
{ceci-2.1 → ceci-2.2}/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ceci-2.1 → ceci-2.2}/ceci.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ceci-2.1 → ceci-2.2}/setup.cfg
RENAMED
|
File without changes
|
{ceci-2.1 → ceci-2.2}/setup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|