microlens-submit 0.12.1__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.
- microlens_submit/__init__.py +163 -0
- microlens_submit/api.py +1274 -0
- microlens_submit/assets/github-desktop_logo.png +0 -0
- microlens_submit/assets/rges-pit_logo.png +0 -0
- microlens_submit/cli.py +1803 -0
- microlens_submit/dossier.py +1443 -0
- microlens_submit/validate_parameters.py +639 -0
- microlens_submit-0.12.1.dist-info/METADATA +159 -0
- microlens_submit-0.12.1.dist-info/RECORD +13 -0
- microlens_submit-0.12.1.dist-info/WHEEL +5 -0
- microlens_submit-0.12.1.dist-info/entry_points.txt +2 -0
- microlens_submit-0.12.1.dist-info/licenses/LICENSE +21 -0
- microlens_submit-0.12.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: microlens-submit
|
|
3
|
+
Version: 0.12.1
|
|
4
|
+
Summary: A stateful submission toolkit for the Microlensing Data Challenge.
|
|
5
|
+
Author-email: Amber Malpas <malpas.1@osu.edu>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/AmberLee2427/microlens-submit
|
|
8
|
+
Project-URL: Repository, https://github.com/AmberLee2427/microlens-submit
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
14
|
+
Requires-Python: >=3.8
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: typer[all]>=0.9.0
|
|
18
|
+
Requires-Dist: pydantic>=2.0
|
|
19
|
+
Requires-Dist: rich>=13.0
|
|
20
|
+
Requires-Dist: PyYAML>=6.0
|
|
21
|
+
Requires-Dist: markdown>=3.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
25
|
+
Requires-Dist: build; extra == "dev"
|
|
26
|
+
Requires-Dist: twine; extra == "dev"
|
|
27
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
28
|
+
Requires-Dist: black; extra == "dev"
|
|
29
|
+
Requires-Dist: isort; extra == "dev"
|
|
30
|
+
Requires-Dist: sphinx; extra == "dev"
|
|
31
|
+
Requires-Dist: sphinx_rtd_theme; extra == "dev"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<a href="https://github.com/AmberLee2427/microlens-submit">
|
|
36
|
+
<img src="./microlens_submit/assets/rges-pit_logo.png" alt="logo" width="300"/>
|
|
37
|
+
</a>
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
<h1 align="center">microlens-submit</h1>
|
|
41
|
+
|
|
42
|
+
*A stateful submission toolkit for the RGES-PIT Microlensing Data Challenge.*
|
|
43
|
+
|
|
44
|
+
[](https://pypi.org/project/microlens-submit/)
|
|
45
|
+
[](https://github.com/AmberLee2427/microlens-submit/actions/workflows/ci.yml)
|
|
46
|
+
[](https://opensource.org/licenses/MIT)
|
|
47
|
+
|
|
48
|
+
<br>
|
|
49
|
+
|
|
50
|
+
`microlens-submit` provides a robust, version-controlled workflow for managing, validating, and packaging your challenge submission over a long period. It supports both a programmatic Python API and a full-featured Command Line Interface (CLI) for language-agnostic use.
|
|
51
|
+
|
|
52
|
+
Full documentation is hosted on [Read the Docs](https://microlens-submit.readthedocs.io/en/latest/). A comprehensive tutorial notebook is available at `docs/Submission_Tool_Tutorial.ipynb`. Challenge participants who prefer not to use this tool can consult [SUBMISSION_MANUAL.md](SUBMISSION_MANUAL.md) for the manual submission format.
|
|
53
|
+
|
|
54
|
+
## Key Features
|
|
55
|
+
|
|
56
|
+
* **Persistent Projects:** Treat your submission as a local project that you can load, edit, and save over weeks or months.
|
|
57
|
+
* **Python API & CLI:** Use the tool directly in your Python analysis scripts or via the command line.
|
|
58
|
+
* **Solution Management:** Easily add, update, and deactivate degenerate solutions for any event without losing your work history.
|
|
59
|
+
* **Active Solution Control:** Quickly list just the active solutions or mark
|
|
60
|
+
all solutions inactive in one call.
|
|
61
|
+
* **Automatic Validation:** Aggressive data validation powered by Pydantic ensures your submission is always compliant with the challenge rules.
|
|
62
|
+
* **Parameter Validation:** Centralized validation logic checks parameter completeness, types, and physical consistency based on model type and higher-order effects.
|
|
63
|
+
* **Rich Documentation:** Notes field supports Markdown formatting for creating detailed, structured documentation and submission dossiers.
|
|
64
|
+
* **Environment Capture:** Automatically records your Python dependencies for each specific model fit, ensuring reproducibility.
|
|
65
|
+
* **Optional Posterior Storage:** Record the path to posterior samples for any solution.
|
|
66
|
+
* **Simple Export:** Packages all your active solutions into a clean, standardized `.zip` archive for final submission.
|
|
67
|
+
|
|
68
|
+
## Installation
|
|
69
|
+
|
|
70
|
+
This package is pre-release. It is currently available on TestPyPI:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple microlens-submit==0.12.0-dev
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The package will be available on PyPI:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pip install microlens-submit
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Quickstart Using the Command Line Interface (CLI)
|
|
83
|
+
|
|
84
|
+
The CLI is the recommended way to interact with your submission project.
|
|
85
|
+
|
|
86
|
+
You can pass ``--no-color`` to any command if your terminal does not support ANSI colors.
|
|
87
|
+
|
|
88
|
+
1. Initialize your project: `microlens-submit init --team-name "Planet Pounders" --tier "advanced"`
|
|
89
|
+
2. Add a new solution to an event:
|
|
90
|
+
```bash
|
|
91
|
+
microlens-submit add-solution ogle-2025-blg-0042 1S2L \
|
|
92
|
+
--param t0=555.5 \
|
|
93
|
+
--param u0=0.1 \
|
|
94
|
+
--param tE=25.0 \
|
|
95
|
+
--notes "This is a great fit!"
|
|
96
|
+
```
|
|
97
|
+
Model types must be one of `1S1L`, `1S2L`, `2S1L`, `2S2L`, `1S3L`, `2S3L`, or `other`.
|
|
98
|
+
This will create a new solution and print its unique `solution_id`.
|
|
99
|
+
You can run the same command with `--dry-run` first to verify the
|
|
100
|
+
parsed input without saving anything.
|
|
101
|
+
3. Deactivate a solution that didn't work out: `microlens-submit deactivate <solution_id>`
|
|
102
|
+
4. List all solutions for an event: `microlens-submit list-solutions ogle-2025-blg-0042`
|
|
103
|
+
5. Validate solutions and check for issues: `microlens-submit validate-solution <solution_id>`
|
|
104
|
+
6. Export your final submission: `microlens-submit export final_submission.zip`
|
|
105
|
+
|
|
106
|
+
**Note:** When you add a solution, it's automatically validated and any warnings are displayed. Use `--dry-run` to check validation without saving.
|
|
107
|
+
|
|
108
|
+
### Using the Python API
|
|
109
|
+
|
|
110
|
+
For those who want to integrate the tool directly into their Python analysis pipeline.
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import microlens_submit
|
|
114
|
+
|
|
115
|
+
# Load or create the project
|
|
116
|
+
sub = microlens_submit.load(project_path="./my_challenge_submission")
|
|
117
|
+
sub.team_name = "Planet Pounders"
|
|
118
|
+
sub.tier = "advanced"
|
|
119
|
+
|
|
120
|
+
# Get an event and add a solution
|
|
121
|
+
evt = sub.get_event("ogle-2025-blg-0042")
|
|
122
|
+
params = {"t0": 555.5, "u0": 0.1, "tE": 25.0}
|
|
123
|
+
sol = evt.add_solution(model_type="1S2L", parameters=params)
|
|
124
|
+
|
|
125
|
+
# Record compute info for this specific run
|
|
126
|
+
sol.set_compute_info(cpu_hours=15.5)
|
|
127
|
+
sol.notes = "This fit was generated from our Python script."
|
|
128
|
+
|
|
129
|
+
# Save progress to disk
|
|
130
|
+
sub.save()
|
|
131
|
+
|
|
132
|
+
# When ready, export the final package
|
|
133
|
+
sub.export("final_submission.zip")
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Development
|
|
137
|
+
|
|
138
|
+
The full development plan can be found in agents.md. Contributions are welcome!
|
|
139
|
+
|
|
140
|
+
To build and test this project, the development environment needs the following Python libraries. You can provide these to Codex or set up a `requirements-dev.txt` file.
|
|
141
|
+
|
|
142
|
+
### Core Dependencies:
|
|
143
|
+
* **`typer[all]`**: For building the powerful command-line interface. The `[all]` extra ensures shell completion support is included.
|
|
144
|
+
* **`pydantic`**: For aggressive data validation and settings management.
|
|
145
|
+
|
|
146
|
+
### Testing Dependencies:
|
|
147
|
+
* **`pytest`**: The standard framework for testing Python code.
|
|
148
|
+
* **`pytest-cov`**: To measure test coverage.
|
|
149
|
+
|
|
150
|
+
### Packaging & Distribution Dependencies:
|
|
151
|
+
* **`build`**: For building the package from the `pyproject.toml` file.
|
|
152
|
+
* **`twine`**: For uploading the final package to PyPI.
|
|
153
|
+
|
|
154
|
+
## Citation
|
|
155
|
+
|
|
156
|
+
If you use **microlens-submit** in your research, please cite the project using
|
|
157
|
+
the metadata provided in the `CITATION.cff` file. Most reference managers can
|
|
158
|
+
import this file directly.
|
|
159
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
microlens_submit/__init__.py,sha256=hBD9NA-AbajbMaVGS8_5xNvvWsLGBON0bXIK3kDK-jA,5869
|
|
2
|
+
microlens_submit/api.py,sha256=p_EqHPBA7kkOMa1GzPj1_fTy4J63uyzkI41l1O3_IlA,53885
|
|
3
|
+
microlens_submit/cli.py,sha256=SpO3d8v2_SswFNZFDkNQ4K0Oj-EXkDYmR5309123D6o,78718
|
|
4
|
+
microlens_submit/dossier.py,sha256=tvWSh0JaSrPK5O7c_xULDkKNxCxBnUfaUgm9dFMUsrA,65415
|
|
5
|
+
microlens_submit/validate_parameters.py,sha256=GNma6rIl_VompJ7eyGJnT3nQ0v_PFJW1pZVBqVj5UTA,30767
|
|
6
|
+
microlens_submit/assets/github-desktop_logo.png,sha256=pb4rallKrYQPHt6eC0TmJe_UyyMtf1IrP8_OWK19nH8,479821
|
|
7
|
+
microlens_submit/assets/rges-pit_logo.png,sha256=45AJypXCymvt3lMeK7MHt1SBhwPpnKCMj6S000Cejtc,537645
|
|
8
|
+
microlens_submit-0.12.1.dist-info/licenses/LICENSE,sha256=cy1qkVR-kGxD6FXVsparmU2vHJXYeoyAAHv6SgT67sw,1069
|
|
9
|
+
microlens_submit-0.12.1.dist-info/METADATA,sha256=qoO8paDd7MhdTpuJNbPI09i8Ij20RUlee27me7if5Uc,7177
|
|
10
|
+
microlens_submit-0.12.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
microlens_submit-0.12.1.dist-info/entry_points.txt,sha256=kA85yhxYrpQnUvVZCRS2giz52gaf1ZOfZFjY4RHIZ2s,62
|
|
12
|
+
microlens_submit-0.12.1.dist-info/top_level.txt,sha256=uJ9_bADYRySlhEpP-8vTm90ZLV2SrKEzutAaRx8WF0k,17
|
|
13
|
+
microlens_submit-0.12.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Amber Malpas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
microlens_submit
|