so-campaign-manager 0.0.4__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.
Files changed (44) hide show
  1. so_campaign_manager-0.0.4.dist-info/METADATA +179 -0
  2. so_campaign_manager-0.0.4.dist-info/RECORD +44 -0
  3. so_campaign_manager-0.0.4.dist-info/WHEEL +5 -0
  4. so_campaign_manager-0.0.4.dist-info/entry_points.txt +2 -0
  5. so_campaign_manager-0.0.4.dist-info/licenses/LICENSE +24 -0
  6. so_campaign_manager-0.0.4.dist-info/top_level.txt +1 -0
  7. socm/__about__.py +34 -0
  8. socm/__init__.py +0 -0
  9. socm/__main__.py +35 -0
  10. socm/bookkeeper/__init__.py +1 -0
  11. socm/bookkeeper/bookkeeper.py +488 -0
  12. socm/configs/slurmise.toml +2 -0
  13. socm/core/__init__.py +1 -0
  14. socm/core/models.py +235 -0
  15. socm/enactor/__init__.py +3 -0
  16. socm/enactor/base.py +123 -0
  17. socm/enactor/dryrun_enactor.py +216 -0
  18. socm/enactor/rp_enactor.py +273 -0
  19. socm/execs/__init__.py +3 -0
  20. socm/execs/mapmaking.py +73 -0
  21. socm/planner/__init__.py +2 -0
  22. socm/planner/base.py +87 -0
  23. socm/planner/heft_planner.py +442 -0
  24. socm/resources/__init__.py +5 -0
  25. socm/resources/perlmutter.py +22 -0
  26. socm/resources/tiger.py +24 -0
  27. socm/resources/universe.py +18 -0
  28. socm/utils/__init__.py +0 -0
  29. socm/utils/misc.py +90 -0
  30. socm/utils/states.py +17 -0
  31. socm/workflows/__init__.py +41 -0
  32. socm/workflows/ml_mapmaking.py +111 -0
  33. socm/workflows/ml_null_tests/__init__.py +10 -0
  34. socm/workflows/ml_null_tests/base.py +117 -0
  35. socm/workflows/ml_null_tests/day_night_null_test.py +132 -0
  36. socm/workflows/ml_null_tests/direction_null_test.py +133 -0
  37. socm/workflows/ml_null_tests/elevation_null_test.py +118 -0
  38. socm/workflows/ml_null_tests/moon_close_null_test.py +165 -0
  39. socm/workflows/ml_null_tests/moonrise_set_null_test.py +151 -0
  40. socm/workflows/ml_null_tests/pwv_null_test.py +118 -0
  41. socm/workflows/ml_null_tests/sun_close_null_test.py +173 -0
  42. socm/workflows/ml_null_tests/time_null_test.py +76 -0
  43. socm/workflows/ml_null_tests/wafer_null_test.py +175 -0
  44. socm/workflows/sat_simulation.py +76 -0
@@ -0,0 +1,179 @@
1
+ Metadata-Version: 2.4
2
+ Name: so_campaign_manager
3
+ Version: 0.0.4
4
+ Summary: A campaign manager to execute SO mapmaking campaign
5
+ Author-email: Giannis Paraskevakos <iparask@princeton.edu>
6
+ Requires-Python: <3.13,>=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: numpy
10
+ Requires-Dist: pydantic>=2.0
11
+ Requires-Dist: radical.pilot; sys_platform != "darwin"
12
+ Requires-Dist: networkx
13
+ Requires-Dist: toml
14
+ Requires-Dist: click
15
+ Requires-Dist: sotodlib
16
+ Requires-Dist: astral
17
+ Requires-Dist: slurmise; sys_platform != "darwin"
18
+ Requires-Dist: humanfriendly
19
+ Provides-Extra: dev
20
+ Requires-Dist: ruff; extra == "dev"
21
+ Requires-Dist: darker; extra == "dev"
22
+ Requires-Dist: flake8; extra == "dev"
23
+ Requires-Dist: isort; extra == "dev"
24
+ Requires-Dist: pytest-cov>=2.6; extra == "dev"
25
+ Requires-Dist: coveralls>=1.5; extra == "dev"
26
+ Requires-Dist: pytest>=4.6; extra == "dev"
27
+ Requires-Dist: hypothesis; extra == "dev"
28
+ Requires-Dist: pre-commit; extra == "dev"
29
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
30
+ Requires-Dist: taskipy; extra == "dev"
31
+ Requires-Dist: types-networkx; extra == "dev"
32
+ Requires-Dist: types-pytz; extra == "dev"
33
+ Requires-Dist: types-toml; extra == "dev"
34
+ Requires-Dist: types-mock; extra == "dev"
35
+ Provides-Extra: docs
36
+ Requires-Dist: sphinx; extra == "docs"
37
+ Requires-Dist: sphinx_rtd_theme; extra == "docs"
38
+ Requires-Dist: sphinxcontrib-napoleon; extra == "docs"
39
+ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
40
+ Requires-Dist: myst-parser; extra == "docs"
41
+ Dynamic: license-file
42
+
43
+ [![PyPI - Version](https://img.shields.io/pypi/v/so_campaign_manager.svg)](https://pypi.org/project/so_campaign_manager)
44
+ [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/so_campaign_manager.svg)](https://pypi.org/project/so_campaign_manager)
45
+ ![CI workflow](https://github.com/simonsobs/so_campaign_manager/actions/workflows/test.yaml/badge.svg)
46
+ [![Coverage Status](https://coveralls.io/repos/github/simonsobs/so_campaign_manager/badge.svg?branch=main)](https://coveralls.io/github/simonsobs/so_campaign_manager?branch=main)
47
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15784156.svg)](https://doi.org/10.5281/zenodo.15784156)
48
+ [![Docs Status](https://readthedocs.org/projects/so-campaign-manager/badge/?version=latest&style=flat)](https://so-campaign-manager.readthedocs.io)
49
+
50
+
51
+ ## SO Campaign Manager
52
+
53
+ This repository holds the code of the software tools that will run the mapmaking campaign on Tiger 3.
54
+
55
+ The project has three big aspects:
56
+ 1. Providing a method to submit new workflows, update existing ones and delete via configuration or a series of commands
57
+ 2. Based on the workflow configuration set the resource requirement accordingly and submit it to SLURM. Resource configuration can be based on:
58
+ 1. Total size of observations and their file distribution
59
+ 2. A specific observation mapping between processes and files
60
+ 3. Node memory and node processor performance.
61
+ 3. Use a workflow management tool to execute all workflows in the minimum amount of time.
62
+
63
+ ## Documentation
64
+
65
+ 📚 **[Full Documentation](docs/index.rst)** - Complete documentation including:
66
+
67
+ - [Installation Guide](docs/installation.rst) - Setup and installation instructions
68
+ - [Quick Start](docs/quickstart.rst) - Get started quickly with examples
69
+ - [User Guide](docs/user_guide.rst) - Comprehensive usage guide
70
+ - [API Reference](docs/api.rst) - Complete API documentation
71
+ - [Workflow Guide](docs/workflows.rst) - Available workflows and how to use them
72
+ - [Developer Guide](docs/developer_guide.rst) - Contributing and development setup
73
+
74
+ ### Building Documentation
75
+
76
+ To build the HTML documentation locally:
77
+
78
+ ```bash
79
+ cd docs
80
+ pip install sphinx sphinx-rtd-theme
81
+ make html
82
+ ```
83
+
84
+ The documentation will be available in `docs/_build/html/index.html`.
85
+
86
+ ## Quick Start
87
+
88
+ Install the package:
89
+
90
+ ```bash
91
+ pip install so_campaign_manager
92
+ ```
93
+
94
+ Create a configuration file (`campaign.toml`):
95
+
96
+ ```toml
97
+ [campaign]
98
+ deadline = "2d"
99
+
100
+ [campaign.resources]
101
+ nodes = 4
102
+ cores-per-node = 112
103
+
104
+ [campaign.ml-mapmaking]
105
+ context = "file:///path/to/context.yaml"
106
+ output_dir = "/path/to/output"
107
+ bands = "f090"
108
+ # ... other parameters
109
+ ```
110
+
111
+ Run your campaign:
112
+
113
+ ```bash
114
+ socm -t campaign.toml
115
+ ```
116
+
117
+ For detailed examples and configuration options, see the [documentation](docs/).
118
+
119
+ ---
120
+
121
+ ## Development guide
122
+
123
+ ### Branching model
124
+
125
+ * the latest development is in the `main` branch.
126
+ * bug fixes:
127
+ * branch of `main`, naming convention: `fix/issue_1234` (reference github issue). `hotfix/issue_1234` if it is a major issue that needs resolution as soon as possible.
128
+ * fix in that branch, and test
129
+ * create pull request toward `main`
130
+ * code review, then merge
131
+ * major development activities go into feature branches
132
+ * branch `main` into `feature/feature_name`
133
+ * work on that feature branch
134
+ * on completion, merge `main` into the feature branch.
135
+ * test the feature branch
136
+ * create a pull request for merging the feature branch into `main` (that should be a fast-forward now)
137
+ * merging of feature branches into `main` should be only after code review
138
+ * documentation changes are handled like fix or feature branches, depending on size and impact, similar to code changes
139
+
140
+ #### Branch Naming
141
+
142
+ * `main`: *never* commit directly
143
+ * `feature/abc`: development of new features
144
+ * `fix/abc_123`: referring to ticket 123
145
+ * `hotfix/abc_123`: referring to ticket 123, to be released right after merge to master
146
+ * `tmp/abc`: temporary branch, will be deleted soon
147
+ * `test/abc`: test some integration, like a merge of two feature branches
148
+
149
+ For the latter: assume you want to test how `feature/a` works in combination with `feature/b`, then:
150
+ * `git checkout feature/a`
151
+ * `git checkout -b test/a_b`
152
+ * `git merge feature/b`
153
+ * do tests
154
+
155
+ #### Branching Policies
156
+
157
+ All branches are short living. To support this, only a limited number of branches should be open at any point in time. Only `N` branches for fixes and `M << N` branches for features should be open for each developer - other features / issues have to wait.
158
+
159
+
160
+ ### Ensure PEP8 compliance (mandatory) and format your code with Darker (optional)
161
+
162
+ `darker` is a *partial formatting* tool that helps to reformat new or modified code lines so the codebase progressively adapts a code style instead of doing a full reformat, which would be a big commitment. It was designed with the ``black`` formatter in mind, hence the name.
163
+
164
+ In this repo **we only require PEP8 compliance**, so if you want to make sure that your PR passes the darker bot, you'll need both darker and `flake8`:
165
+
166
+ pip install darker flake8
167
+
168
+
169
+ You'll also need the original codebase so darker can first get a diff between the current ``develop`` branch and your code.
170
+ After making your changes to your local branch, check your modifications on the package:
171
+
172
+ darker --diff -r origin/develop package/src -L flake8
173
+
174
+ Darker will first suggest changes so that the new code lines comply with ``black``'s rules, and then show flake8 errors and warnings.
175
+
176
+ You are free to skip the diffs and then manually fix the PEP8 faults.
177
+ Or if you're ok with the suggested formatting changes, just apply the suggested fixes: ::
178
+
179
+ darker -r origin/develop package/scr -L flake8
@@ -0,0 +1,44 @@
1
+ so_campaign_manager-0.0.4.dist-info/licenses/LICENSE,sha256=7DW9JsCHGLGy8TJS98-KWlrac-3hTg5bPi16w5Lmxmk,1307
2
+ socm/__about__.py,sha256=QlXZ5JTjE_pgpDaeHk0GTExkc75xUZFmd0hA7kGYCJ0,704
3
+ socm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ socm/__main__.py,sha256=iNmFCkZS5ejtfFM6aL9k0xwXHSViDuf8oCZ0H2aYvJc,1014
5
+ socm/bookkeeper/__init__.py,sha256=lGB8K4JnDwTWZyb8fCO82EMVqIBJcfFy68cJFy7M1Oc,49
6
+ socm/bookkeeper/bookkeeper.py,sha256=rex-sZ-5eSeFuFCp5NLX-koNvO4sNCyJ0CSc2D4YNyI,20290
7
+ socm/configs/slurmise.toml,sha256=2rSr4is8zbq4FPWyyc1iPrkCJ9G3dqAGx1Sw-btP2L4,83
8
+ socm/core/__init__.py,sha256=uqKK2fu3-5HYXQa6xjSuzHH68UrHOYUVFG1MFFZ74JE,74
9
+ socm/core/models.py,sha256=BvG7CUnBstYS62xYHkCZaRe9GezqVRr6MfKXsxr7V38,9249
10
+ socm/enactor/__init__.py,sha256=uXqLBcZWpYx9cbk4AcB8OO9l8X2q47PkADEYLcG-XBc,144
11
+ socm/enactor/base.py,sha256=ncqw52B_p_hkun8oneFYLmVmnpExoVggNkPsk5Ru6kI,4092
12
+ socm/enactor/dryrun_enactor.py,sha256=iVlD0xB2O33PvhCUrXXIMTbSRoIS-SlpA_JJRDCExUo,8720
13
+ socm/enactor/rp_enactor.py,sha256=scgPRlgcTR0v8PwlKd7WxlyYK0NF7t71Qcj6kWmA_CE,11344
14
+ socm/execs/__init__.py,sha256=F2fZ8uQcxSaXxkiSht_olwXh76vJzSiKQI8GTUbS9ek,68
15
+ socm/execs/mapmaking.py,sha256=Dz37qocv5wkpTDxO2IRNwtpB0KwVWWPuD_hl8v9wd9s,2770
16
+ socm/planner/__init__.py,sha256=FSeIb_Qo1pElU4CZ1g2vlieCNlJogNkdwfftEvMr7fI,103
17
+ socm/planner/base.py,sha256=3PK-FTmmQlnwBg4TlkEoWcKW0ywjMtPTBDWrb5faoBo,2999
18
+ socm/planner/heft_planner.py,sha256=cEfWTK5M6KXaL2wPtW6BmVbzvXxkz4GepQ1cRdCN6nA,16863
19
+ socm/resources/__init__.py,sha256=hJP9euCuUd7xJ9ekmcn-4V6AF4hQUqjpcbw3jzV8HhQ,271
20
+ socm/resources/perlmutter.py,sha256=m2Qb5tgSON4f7T4XxBLDx8Yq9Qx0Ip_f-gyJtKBeopk,885
21
+ socm/resources/tiger.py,sha256=p_yRSxKARdtuWgPVmXZaBXfdqJpSzkTINLwL5ZwMAX8,1026
22
+ socm/resources/universe.py,sha256=B9ULdan2zaUoWOp0tdk_Og9qB0ZUZPwFGZ-FwoD4qOQ,557
23
+ socm/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
+ socm/utils/misc.py,sha256=Tjyu3EPYP2QFiaEwXLQpLoUd4STpP6Ub0VCGLKStShg,3217
25
+ socm/utils/states.py,sha256=pws0-BdCokuoHpMTk1E0uARCKN-Kwg5OtlqbmTOlf8s,618
26
+ socm/workflows/__init__.py,sha256=S54_Q54sT22NRJLZLi9OsUm_pfLQn1gPq7mgjPNvfzY,1421
27
+ socm/workflows/ml_mapmaking.py,sha256=bYQE27vO_jbYMPycpajBo3yQi4Tdw0GCQpt4GMqGKQ0,3711
28
+ socm/workflows/sat_simulation.py,sha256=TgtqgeKVRL2nd2EAliPUuO1EmGSTOIudf1h46eMI-Ag,2589
29
+ socm/workflows/ml_null_tests/__init__.py,sha256=se6_7OqqmXUkZDqVF4Ba5XJOW4yIdIP4U--jcBETi24,686
30
+ socm/workflows/ml_null_tests/base.py,sha256=mk7QU2KU7LW7Ve--jZ2KAHB7xSGxDGTvSlNiSO2DdL8,4156
31
+ socm/workflows/ml_null_tests/day_night_null_test.py,sha256=mI83eLnh_av_Ei4kTvNGgt7IiQVXttWNqy7YmzFatwE,5228
32
+ socm/workflows/ml_null_tests/direction_null_test.py,sha256=crXB943jt7B5YQr2Zf7zrS9ZFFn4uw_P0RtYyUT7Jwg,5336
33
+ socm/workflows/ml_null_tests/elevation_null_test.py,sha256=tAYlcp3edEefgYxGBOMTNs7mQpa2TovaduU0pnI8Tmg,4716
34
+ socm/workflows/ml_null_tests/moon_close_null_test.py,sha256=e0RZYGMQ5goiIt-bmLcv1Ij83MMEi9C0nnsDOfWY7_c,6612
35
+ socm/workflows/ml_null_tests/moonrise_set_null_test.py,sha256=iwOV--qh25RvyCsDhWBOEkotfMfo-Tl_6CRRUgVvKTg,6154
36
+ socm/workflows/ml_null_tests/pwv_null_test.py,sha256=IFGD27ya_ABgfDpMW6LJf8LND8BjRzS_1jjVjB6CNHI,4660
37
+ socm/workflows/ml_null_tests/sun_close_null_test.py,sha256=2OXYAwDezHtQu4flm7p3VpGwsgrDbwwyyW_cvqvhorE,6910
38
+ socm/workflows/ml_null_tests/time_null_test.py,sha256=CvJs2c2__3SPwCpNOsnjsjdP7GAlsR9XAAs-uCGeWL8,2948
39
+ socm/workflows/ml_null_tests/wafer_null_test.py,sha256=TyYikNz2R5MQpn8nA-qtqL-S_kRqJBEGV9Bpp0VYQPI,5924
40
+ so_campaign_manager-0.0.4.dist-info/METADATA,sha256=vQReZHgGLbQ4PG1QZoSxUOjePP3uT9_3xCbbmYxHeaQ,7158
41
+ so_campaign_manager-0.0.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
42
+ so_campaign_manager-0.0.4.dist-info/entry_points.txt,sha256=AOCAMD2Hlow7ANjC7x-y-hoIjpK0ZJHlzSlge1G8rbE,44
43
+ so_campaign_manager-0.0.4.dist-info/top_level.txt,sha256=ZwRffSGa60j_n2D5eKpZYecNFY61dmaLEH98Ks_p7O0,5
44
+ so_campaign_manager-0.0.4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ socm = socm.__main__:main
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2025, Simons Observatory
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ socm
socm/__about__.py ADDED
@@ -0,0 +1,34 @@
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 = '0.0.4'
32
+ __version_tuple__ = version_tuple = (0, 0, 4)
33
+
34
+ __commit_id__ = commit_id = None
socm/__init__.py ADDED
File without changes
socm/__main__.py ADDED
@@ -0,0 +1,35 @@
1
+ from argparse import ArgumentParser, Namespace
2
+
3
+ from socm.execs import SUBCOMMANDS
4
+
5
+
6
+ def get_parser() -> ArgumentParser:
7
+ """Create and return the argument parser for the SO campaign."""
8
+ parser = ArgumentParser(description="Run the SO campaign.")
9
+ # Make sure all args here are redirected to vars starting with
10
+ # '_'. We are going to clean those off before passing to the
11
+ # subcommand.
12
+ sps = parser.add_subparsers(dest='_pipemod', required=True)
13
+
14
+ for name, module in SUBCOMMANDS.items():
15
+ sp = sps.add_parser(name)
16
+ module.get_parser(sp)
17
+
18
+ return parser
19
+
20
+
21
+ def main() -> None:
22
+ parser = get_parser()
23
+ args = parser.parse_args()
24
+
25
+ # Extract top-level args ...
26
+ top_args = {k: v for k, v in vars(args).items()
27
+ if k[0] == '_'}
28
+ for k in top_args:
29
+ delattr(args, k)
30
+ top_args = Namespace(**top_args)
31
+
32
+ module = SUBCOMMANDS[top_args._pipemod]
33
+ _main = getattr(module, '_main', None)
34
+ if _main is not None:
35
+ _main(args)
@@ -0,0 +1 @@
1
+ from .bookkeeper import Bookkeeper # noqa: F401