ceci 2.4__tar.gz → 2.5__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.
Files changed (102) hide show
  1. {ceci-2.4 → ceci-2.5}/.github/workflows/ci.yml +1 -1
  2. {ceci-2.4 → ceci-2.5}/PKG-INFO +1 -1
  3. ceci-2.5/ceci/_version.py +24 -0
  4. {ceci-2.4 → ceci-2.5}/ceci/file_types.py +25 -6
  5. {ceci-2.4 → ceci-2.5}/ceci/stage.py +9 -2
  6. {ceci-2.4 → ceci-2.5}/ceci.egg-info/PKG-INFO +1 -1
  7. {ceci-2.4 → ceci-2.5}/ceci.egg-info/SOURCES.txt +1 -0
  8. ceci-2.5/tests/test_io.py +24 -0
  9. ceci-2.4/ceci/_version.py +0 -34
  10. {ceci-2.4 → ceci-2.5}/.coveragerc +0 -0
  11. {ceci-2.4 → ceci-2.5}/.github/workflows/publish.yml +0 -0
  12. {ceci-2.4 → ceci-2.5}/.gitignore +0 -0
  13. {ceci-2.4 → ceci-2.5}/.pylintrc +0 -0
  14. {ceci-2.4 → ceci-2.5}/.readthedocs.yml +0 -0
  15. {ceci-2.4 → ceci-2.5}/LICENSE +0 -0
  16. {ceci-2.4 → ceci-2.5}/README.md +0 -0
  17. {ceci-2.4 → ceci-2.5}/ceci/__init__.py +0 -0
  18. {ceci-2.4 → ceci-2.5}/ceci/__main__.py +0 -0
  19. {ceci-2.4 → ceci-2.5}/ceci/config.py +0 -0
  20. {ceci-2.4 → ceci-2.5}/ceci/errors.py +0 -0
  21. {ceci-2.4 → ceci-2.5}/ceci/main.py +0 -0
  22. {ceci-2.4 → ceci-2.5}/ceci/minirunner.py +0 -0
  23. {ceci-2.4 → ceci-2.5}/ceci/monitor.py +0 -0
  24. {ceci-2.4 → ceci-2.5}/ceci/pipeline/__init__.py +0 -0
  25. {ceci-2.4 → ceci-2.5}/ceci/pipeline/dry_run.py +0 -0
  26. {ceci-2.4 → ceci-2.5}/ceci/pipeline/file_manager.py +0 -0
  27. {ceci-2.4 → ceci-2.5}/ceci/pipeline/flow_chart.py +0 -0
  28. {ceci-2.4 → ceci-2.5}/ceci/pipeline/graph.py +0 -0
  29. {ceci-2.4 → ceci-2.5}/ceci/pipeline/mini.py +0 -0
  30. {ceci-2.4 → ceci-2.5}/ceci/pipeline/parsl.py +0 -0
  31. {ceci-2.4 → ceci-2.5}/ceci/pipeline/pipeline.py +0 -0
  32. {ceci-2.4 → ceci-2.5}/ceci/pipeline/sec.py +0 -0
  33. {ceci-2.4 → ceci-2.5}/ceci/pipeline/templates.py +0 -0
  34. {ceci-2.4 → ceci-2.5}/ceci/sites/__init__.py +0 -0
  35. {ceci-2.4 → ceci-2.5}/ceci/sites/ccin2p3.py +0 -0
  36. {ceci-2.4 → ceci-2.5}/ceci/sites/local.py +0 -0
  37. {ceci-2.4 → ceci-2.5}/ceci/sites/nersc.py +0 -0
  38. {ceci-2.4 → ceci-2.5}/ceci/sites/site.py +0 -0
  39. {ceci-2.4 → ceci-2.5}/ceci/tools/__init__.py +0 -0
  40. {ceci-2.4 → ceci-2.5}/ceci/tools/ancestors.py +0 -0
  41. {ceci-2.4 → ceci-2.5}/ceci/update_pipelines_for_ceci_2.py +0 -0
  42. {ceci-2.4 → ceci-2.5}/ceci/utils.py +0 -0
  43. {ceci-2.4 → ceci-2.5}/ceci.egg-info/dependency_links.txt +0 -0
  44. {ceci-2.4 → ceci-2.5}/ceci.egg-info/entry_points.txt +0 -0
  45. {ceci-2.4 → ceci-2.5}/ceci.egg-info/requires.txt +0 -0
  46. {ceci-2.4 → ceci-2.5}/ceci.egg-info/top_level.txt +0 -0
  47. {ceci-2.4 → ceci-2.5}/ceci.png +0 -0
  48. {ceci-2.4 → ceci-2.5}/ceci_example/__init__.py +0 -0
  49. {ceci-2.4 → ceci-2.5}/ceci_example/__main__.py +0 -0
  50. {ceci-2.4 → ceci-2.5}/ceci_example/example_stages.py +0 -0
  51. {ceci-2.4 → ceci-2.5}/ceci_example/types.py +0 -0
  52. {ceci-2.4 → ceci-2.5}/ceci_example_namespace/example_stages.py +0 -0
  53. {ceci-2.4 → ceci-2.5}/do_cover.sh +0 -0
  54. {ceci-2.4 → ceci-2.5}/docs/Makefile +0 -0
  55. {ceci-2.4 → ceci-2.5}/docs/conf.py +0 -0
  56. {ceci-2.4 → ceci-2.5}/docs/config.rst +0 -0
  57. {ceci-2.4 → ceci-2.5}/docs/config2.rst +0 -0
  58. {ceci-2.4 → ceci-2.5}/docs/index.rst +0 -0
  59. {ceci-2.4 → ceci-2.5}/docs/installation.rst +0 -0
  60. {ceci-2.4 → ceci-2.5}/docs/launchers.rst +0 -0
  61. {ceci-2.4 → ceci-2.5}/docs/logo.png +0 -0
  62. {ceci-2.4 → ceci-2.5}/docs/overview.rst +0 -0
  63. {ceci-2.4 → ceci-2.5}/docs/requirements.txt +0 -0
  64. {ceci-2.4 → ceci-2.5}/docs/sites.rst +0 -0
  65. {ceci-2.4 → ceci-2.5}/docs/stages.rst +0 -0
  66. {ceci-2.4 → ceci-2.5}/docs/tutorial.rst +0 -0
  67. {ceci-2.4 → ceci-2.5}/nb/ceci_interactive_example.ipynb +0 -0
  68. {ceci-2.4 → ceci-2.5}/pyproject.toml +0 -0
  69. {ceci-2.4 → ceci-2.5}/setup.cfg +0 -0
  70. {ceci-2.4 → ceci-2.5}/setup.py +0 -0
  71. {ceci-2.4 → ceci-2.5}/tests/__init__.py +0 -0
  72. {ceci-2.4 → ceci-2.5}/tests/config.yml +0 -0
  73. {ceci-2.4 → ceci-2.5}/tests/config_nm.yml +0 -0
  74. {ceci-2.4 → ceci-2.5}/tests/create_registry_entries.py +0 -0
  75. {ceci-2.4 → ceci-2.5}/tests/inputs/dm.txt +0 -0
  76. {ceci-2.4 → ceci-2.5}/tests/inputs/fiducial_cosmology.txt +0 -0
  77. {ceci-2.4 → ceci-2.5}/tests/north.yml +0 -0
  78. {ceci-2.4 → ceci-2.5}/tests/template.yml +0 -0
  79. {ceci-2.4 → ceci-2.5}/tests/test.hdf5 +0 -0
  80. {ceci-2.4 → ceci-2.5}/tests/test.yml +0 -0
  81. {ceci-2.4 → ceci-2.5}/tests/test_cmd.py +0 -0
  82. {ceci-2.4 → ceci-2.5}/tests/test_dask.py +0 -0
  83. {ceci-2.4 → ceci-2.5}/tests/test_dataregistry.yml +0 -0
  84. {ceci-2.4 → ceci-2.5}/tests/test_executables.py +0 -0
  85. {ceci-2.4 → ceci-2.5}/tests/test_flow_chart.py +0 -0
  86. {ceci-2.4 → ceci-2.5}/tests/test_graph.py +0 -0
  87. {ceci-2.4 → ceci-2.5}/tests/test_helpers.py +0 -0
  88. {ceci-2.4 → ceci-2.5}/tests/test_interactive.py +0 -0
  89. {ceci-2.4 → ceci-2.5}/tests/test_main.py +0 -0
  90. {ceci-2.4 → ceci-2.5}/tests/test_minirunner.py +0 -0
  91. {ceci-2.4 → ceci-2.5}/tests/test_monitor.py +0 -0
  92. {ceci-2.4 → ceci-2.5}/tests/test_namespace.yml +0 -0
  93. {ceci-2.4 → ceci-2.5}/tests/test_pipeline.py +0 -0
  94. {ceci-2.4 → ceci-2.5}/tests/test_python_paths.py +0 -0
  95. {ceci-2.4 → ceci-2.5}/tests/test_site.py +0 -0
  96. {ceci-2.4 → ceci-2.5}/tests/test_snapshot.py +0 -0
  97. {ceci-2.4 → ceci-2.5}/tests/test_stage.py +0 -0
  98. {ceci-2.4 → ceci-2.5}/tests/test_update_script.py +0 -0
  99. {ceci-2.4 → ceci-2.5}/tests/test_utils.py +0 -0
  100. {ceci-2.4 → ceci-2.5}/tests/update_test_files/config.yml +0 -0
  101. {ceci-2.4 → ceci-2.5}/tests/update_test_files/pipeline1.yml +0 -0
  102. {ceci-2.4 → ceci-2.5}/tests/update_test_files/pipeline2.yml +0 -0
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  strategy:
17
17
  matrix:
18
- python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
18
+ python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
19
19
 
20
20
  steps:
21
21
  - name: Checkout repository
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ceci
3
- Version: 2.4
3
+ Version: 2.5
4
4
  Summary: Lightweight pipeline engine for LSST DESC
5
5
  Author: Joe Zuntz
6
6
  License: BSD 3-Clause License
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '2.5'
22
+ __version_tuple__ = version_tuple = (2, 5)
23
+
24
+ __commit_id__ = commit_id = 'gfccc21033'
@@ -39,6 +39,11 @@ class DataFile:
39
39
  self.path = path
40
40
  self.mode = mode
41
41
 
42
+ # store whether we are in parallel mode
43
+ # for later use.
44
+ self.parallel = kwargs.get("parallel", False)
45
+ self.comm = kwargs.get("comm", None)
46
+
42
47
  if mode not in ["r", "w"]:
43
48
  raise ValueError(f"File 'mode' argument must be 'r' or 'w' not '{mode}'")
44
49
 
@@ -343,15 +348,24 @@ class YamlFile(DataFile):
343
348
 
344
349
  class Directory(DataFile):
345
350
  suffix = ""
351
+ supports_parallel_write = True
346
352
 
347
353
  @classmethod
348
- def open(self, path, mode):
354
+ def open(self, path, mode, comm=None, parallel=False):
349
355
  p = pathlib.Path(path)
350
356
 
351
357
  if mode == "w":
352
- if p.exists():
353
- shutil.rmtree(p)
354
- p.mkdir(parents=True)
358
+ # Make it so that only one process
359
+ # tries to create the directory if running
360
+ # in parallel
361
+ if (not parallel) or (parallel and comm.rank == 0):
362
+ if p.exists():
363
+ shutil.rmtree(p)
364
+ p.mkdir(parents=True)
365
+ # Then once that one process as done it all the others
366
+ # should wait to avoid race conditions.
367
+ if parallel:
368
+ comm.Barrier()
355
369
  else:
356
370
  if not p.is_dir():
357
371
  raise ValueError(f"Directory input {path} does not exist")
@@ -365,8 +379,13 @@ class Directory(DataFile):
365
379
  Write provenance information to a new group,
366
380
  called 'provenance'
367
381
  """
368
- # This method *must* be called by all the processes in a parallel
369
- # run.
382
+ # Directories can be opened in parallel, but only
383
+ # the rank 0 process should write the provenance.
384
+ # This is unlike HDF5 where all the processes have to
385
+ # cooperate to write it.
386
+ if (self.comm is not None) and (self.comm.rank != 0):
387
+ return
388
+
370
389
  if self.mode == "r":
371
390
  raise UnsupportedOperation(f"Cannot write provenance to a directory opened in read-only mode ({self.mode})")
372
391
 
@@ -16,6 +16,7 @@ from . import errors
16
16
  from .monitor import MemoryMonitor
17
17
  from .config import StageParameter, StageConfig, cast_to_streamable
18
18
  from .utils import activate_tracing
19
+ from . import file_types
19
20
 
20
21
  SERIAL = "serial"
21
22
  MPI_PARALLEL = "mpi"
@@ -1131,13 +1132,19 @@ I currently know about these stages:
1131
1132
  path = self.get_output(tag, final_name=final_name)
1132
1133
  output_class = self.get_output_type(tag)
1133
1134
 
1134
- # HDF files can be opened for parallel writing
1135
+ # HDF files and directory outputs can be opened for parallel writing
1135
1136
  # under MPI. This checks if:
1136
1137
  # - we have been told to open in parallel
1137
1138
  # - we are actually running under MPI
1138
1139
  # and adds the flags required if all these are true
1139
1140
  run_parallel = kwargs.pop("parallel", False) and self.is_mpi()
1140
- if run_parallel:
1141
+ if run_parallel and issubclass(output_class, file_types.Directory):
1142
+ kwargs["parallel"] = True
1143
+ kwargs["comm"] = self.comm
1144
+
1145
+ # otherwise must be HDF5. Ideally we would check more carefully
1146
+ # here, but I don't want to mess up any RAIL HDF stuff by accident.
1147
+ elif run_parallel:
1141
1148
  kwargs["driver"] = "mpio"
1142
1149
  kwargs["comm"] = self.comm
1143
1150
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ceci
3
- Version: 2.4
3
+ Version: 2.5
4
4
  Summary: Lightweight pipeline engine for LSST DESC
5
5
  Author: Joe Zuntz
6
6
  License: BSD 3-Clause License
@@ -80,6 +80,7 @@ tests/test_flow_chart.py
80
80
  tests/test_graph.py
81
81
  tests/test_helpers.py
82
82
  tests/test_interactive.py
83
+ tests/test_io.py
83
84
  tests/test_main.py
84
85
  tests/test_minirunner.py
85
86
  tests/test_monitor.py
@@ -0,0 +1,24 @@
1
+ import ceci.file_types as file_types
2
+ import tempfile
3
+ import os
4
+ import mockmpi
5
+
6
+
7
+ def _test_directory_parallel(comm, tmpdir):
8
+ print(comm.rank, tmpdir)
9
+ d = file_types.Directory(tmpdir + "/test_dir", "w", parallel=True, comm=comm)
10
+ comm.Barrier()
11
+ assert d.path == tmpdir + "/test_dir"
12
+ assert os.path.exists(tmpdir + "/test_dir/provenance.yml")
13
+
14
+
15
+ def test_directory():
16
+ with tempfile.TemporaryDirectory() as tmpdir:
17
+ d = file_types.Directory(tmpdir + "/test_dir", "w", parallel=False)
18
+ assert d.path == tmpdir + "/test_dir"
19
+ assert os.path.exists(tmpdir + "/test_dir/provenance.yml")
20
+
21
+
22
+ def test_directory_parallel():
23
+ with tempfile.TemporaryDirectory() as tmpdir:
24
+ mockmpi.mock_mpiexec(2, _test_directory_parallel, tmpdir)
ceci-2.4/ceci/_version.py DELETED
@@ -1,34 +0,0 @@
1
- # file generated by setuptools-scm
2
- # don't change, don't track in version control
3
-
4
- __all__ = [
5
- "__version__",
6
- "__version_tuple__",
7
- "version",
8
- "version_tuple",
9
- "__commit_id__",
10
- "commit_id",
11
- ]
12
-
13
- TYPE_CHECKING = False
14
- if TYPE_CHECKING:
15
- from typing import Tuple
16
- from typing import Union
17
-
18
- VERSION_TUPLE = Tuple[Union[int, str], ...]
19
- COMMIT_ID = Union[str, None]
20
- else:
21
- VERSION_TUPLE = object
22
- COMMIT_ID = object
23
-
24
- version: str
25
- __version__: str
26
- __version_tuple__: VERSION_TUPLE
27
- version_tuple: VERSION_TUPLE
28
- commit_id: COMMIT_ID
29
- __commit_id__: COMMIT_ID
30
-
31
- __version__ = version = '2.4'
32
- __version_tuple__ = version_tuple = (2, 4)
33
-
34
- __commit_id__ = commit_id = 'g727f0fadf'
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
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
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