A tool for managing and submitting microlensing solutions
Project description
microlens-submit
A stateful submission toolkit for the RGES-PIT Microlensing Data Challenge.
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.
Full documentation is hosted on Read the Docs. A comprehensive tutorial notebook is available at docs/Submission_Tool_Tutorial.ipynb. Challenge participants who prefer not to use this tool can consult the Submission Manual for the manual submission format.
Key Features
- Persistent Projects: Treat your submission as a local project that you can load, edit, and save over weeks or months.
- Python API & CLI: Use the tool directly in your Python analysis scripts or via the command line.
- Solution Management: Easily add, update, and deactivate degenerate solutions for any event without losing your work history.
- Active Solution Control: Quickly list just the active solutions or mark all solutions inactive in one call.
- Automatic Validation: Aggressive data validation powered by Pydantic ensures your submission is always compliant with the challenge rules.
- Parameter Validation: Centralized validation logic checks parameter completeness, types, and physical consistency based on model type and higher-order effects.
- Rich Documentation: Notes field supports Markdown formatting for creating detailed, structured documentation and submission dossiers.
- Environment Capture: Automatically records your Python dependencies for each specific model fit, ensuring reproducibility.
- Optional Posterior Storage: Record the path to posterior samples for any solution.
- Simple Export: Packages all your active solutions into a clean, standardized
.ziparchive for final submission. - Bulk Import: Import multiple solutions at once from a CSV file using the
import-solutionsCLI command. Supports column mapping, alias handling, duplicate handling, notes, dry-run, and validation options.
Installation
The package is available on PyPI:
pip install microlens-submit
Quickstart Using the Command Line Interface (CLI)
The CLI is the recommended way to interact with your submission project.
You can pass --no-color to any command if your terminal does not support ANSI colors.
Windows note: If microlens-submit is not found after pip install, your Python Scripts folder is likely missing from PATH.
Try py -m pip install microlens-submit and run py -m microlens_submit.cli --help, or add the Scripts path shown by
py -m pip show -f microlens-submit to PATH.
-
Initialize your project:
microlens-submit init --team-name "Planet Pounders" --tier "experienced" ./my_submission cd ./my_submission
If you prefer to initialize inside an existing folder, run
microlens-submit initwithout a path aftercdinto it.To pass validation, you need to have provided a
repo_urlandhardware_infoto the project and have a git project initialized in your sumission-project directory. On Roman Nexus, you can usemicrolens-submit nexus-initto auto-populate hardware info.microlens-submit set-repo-url <url> ./ microlens-submit set-hardware-info --cpu-details "intel i7 xxx" --ram-gb 32 ./ # if your git repo lives elsewhere: microlens-submit set-git-dir /path/to/repo ./
-
Add a new solution to an event:
microlens-submit add-solution ogle-2025-blg-0042 1S2L \ --param t0=555.5 \ --param u0=0.1 \ --param tE=25.0 \ --notes "This is a great fit!"
Model types must be one of
1S1L,1S2L,2S1L,2S2L,1S3L,2S3L, orother. This will create a new solution and print its uniquesolution_id.You can run the same command with
--dry-runfirst to verify the parsed input without saving anything. -
Bulk import multiple solutions from a CSV file:
microlens-submit import-solutions tests/data/test_import.csv --dry-run
See the file
tests/data/test_import.csvfor a comprehensive example covering all features and edge cases. You can use this file as a template for your own imports. -
Deactivate a solution that didn't work out:
microlens-submit deactivate <solution_id> -
List all solutions for an event:
microlens-submit list-solutions ogle-2025-blg-0042 -
Validate solutions and check for issues:
microlens-submit validate-solution <solution_id> -
Export your final submission:
microlens-submit export final_submission.zip
Note: When you add a solution, it's automatically validated and any warnings are displayed. Use --dry-run to check validation without saving.
Using the Python API
For those who want to integrate the tool directly into their Python analysis pipeline.
import microlens_submit
# Load or create the project
sub = microlens_submit.load(project_path="./my_challenge_submission")
sub.team_name = "Planet Pounders"
sub.tier = "experienced"
# Get an event and add a solution
evt = sub.get_event("ogle-2025-blg-0042")
params = {"t0": 555.5, "u0": 0.1, "tE": 25.0}
sol = evt.add_solution(model_type="1S2L", parameters=params)
# Record compute info for this specific run
sol.set_compute_info(cpu_hours=15.5)
sol.notes = "This fit was generated from our Python script."
# Save progress to disk
sub.save()
# When ready, export the final package
sub.export("final_submission.zip")
Development
The full development plan can be found in agents.md. Contributions are welcome!
To build and test this project, install the development dependencies using either pip install -e .[dev] or pip install -r requirements-dev.txt. These packages are required to run the test suite and are listed in requirements-dev.txt.
After installing the dependencies, run pre-commit install to set up the Git hooks for automatic formatting and linting. The development environment needs the following Python libraries.
Core Dependencies:
typer[all]: For building the powerful command-line interface. The[all]extra ensures shell completion support is included.pydantic: For aggressive data validation and settings management.
Testing Dependencies:
pytest: The standard framework for testing Python code.pytest-cov: To measure test coverage.
Packaging & Distribution Dependencies:
build: For building the package from thepyproject.tomlfile.twine: For uploading the final package to PyPI.
Test Data
A comprehensive test CSV file is provided at tests/data/test_import.csv. This file is used in the test suite and can be copied or adapted for your own bulk imports or for development/testing purposes.
Citation
If you use microlens-submit in your research, please cite the project using
the metadata provided in the CITATION.cff file. Most reference managers can
import this file directly.
Bibtex:
@software{malpas_2025_18601472,
author = {Malpas, Amber},
title = {microlens-submit},
month = oct,
year = 2025,
publisher = {Zenodo},
version = {v0.16.3},
doi = {10.5281/zenodo.18601472},
url = {https://doi.org/10.5281/zenodo.18601472},
}
Cite without version: Malpas, A. (2025). microlens-submit. Zenodo. https://doi.org/10.5281/zenodo.17459752
Cite current version: Malpas, A. (2025). microlens-submit (v0.16.3). Zenodo. https://doi.org/10.5281/zenodo.17468488
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microlens_submit-0.17.6.tar.gz.
File metadata
- Download URL: microlens_submit-0.17.6.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f62b04130af68adc04ee105174aef76fce310b6f12b74238e1944312479c1882
|
|
| MD5 |
29570e8afc97518364bfab621fe6b0f9
|
|
| BLAKE2b-256 |
e4f2326ba4be2215fd3c5abac7d6f2be2d6e360ca29cd11dd19ce2486e2b407f
|
Provenance
The following attestation bundles were made for microlens_submit-0.17.6.tar.gz:
Publisher:
release.yml on AmberLee2427/microlens-submit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
microlens_submit-0.17.6.tar.gz -
Subject digest:
f62b04130af68adc04ee105174aef76fce310b6f12b74238e1944312479c1882 - Sigstore transparency entry: 938217733
- Sigstore integration time:
-
Permalink:
AmberLee2427/microlens-submit@6a994a1e8df6419cf5c7b5f8301c82c62073dbff -
Branch / Tag:
refs/tags/v0.17.6 - Owner: https://github.com/AmberLee2427
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6a994a1e8df6419cf5c7b5f8301c82c62073dbff -
Trigger Event:
push
-
Statement type:
File details
Details for the file microlens_submit-0.17.6-py3-none-any.whl.
File metadata
- Download URL: microlens_submit-0.17.6-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e789aab23c7399d403b0ffabbdb76548f7c959d3a75e718fe470d937a7182d7f
|
|
| MD5 |
6be8b46de64d3867b68a3bfd2ce3fc2a
|
|
| BLAKE2b-256 |
dbb4be8f153400bf507b52b505d494f6af50176c01097c36499610f4a7c9b7ce
|
Provenance
The following attestation bundles were made for microlens_submit-0.17.6-py3-none-any.whl:
Publisher:
release.yml on AmberLee2427/microlens-submit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
microlens_submit-0.17.6-py3-none-any.whl -
Subject digest:
e789aab23c7399d403b0ffabbdb76548f7c959d3a75e718fe470d937a7182d7f - Sigstore transparency entry: 938217746
- Sigstore integration time:
-
Permalink:
AmberLee2427/microlens-submit@6a994a1e8df6419cf5c7b5f8301c82c62073dbff -
Branch / Tag:
refs/tags/v0.17.6 - Owner: https://github.com/AmberLee2427
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6a994a1e8df6419cf5c7b5f8301c82c62073dbff -
Trigger Event:
push
-
Statement type: