Skip to content

Commit bc209e2

Browse files
committed
chore: update version to 0.17.5 and enhance CLI tutorial with new file attachment features
1 parent f7cc068 commit bc209e2

File tree

14 files changed

+266
-65
lines changed

14 files changed

+266
-65
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.17.5] - 2026-02-09
9+
10+
### Added
11+
- CLI support for attaching posterior samples via `add-solution` (`--posterior-path`).
12+
- CLI commands to edit and clear solution file paths (`--posterior-path`, `--lightcurve-plot-path`, `--lens-plane-plot-path`) in `edit-solution`.
13+
14+
### Changed
15+
- Updated CLI tutorial regarding file attachments (plots and posteriors).
16+
17+
818
## [0.17.4] - 2026-02-09
919

1020
### Added

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
cff-version: 1.2.0
22
message: "If you use microlens-submit, please cite it as below."
33
title: "microlens-submit"
4-
version: "0.17.4"
4+
version: "0.17.5"
55
authors:
66
- family-names: Malpas
77
given-names: Amber
88
url: "https://github.com/AmberLee2427/microlens-submit"
9-
doi: "10.5281/zenodo.18558755"
9+
doi: "10.5281/zenodo.18580965"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ import this file directly.
160160

161161
Bibtex:
162162
```
163-
@software{malpas_2025_18558755,
163+
@software{malpas_2025_18580965,
164164
author = {Malpas, Amber},
165165
title = {microlens-submit},
166166
month = oct,
167167
year = 2025,
168168
publisher = {Zenodo},
169169
version = {v0.16.3},
170-
doi = {10.5281/zenodo.18558755},
171-
url = {https://doi.org/10.5281/zenodo.18558755},
170+
doi = {10.5281/zenodo.18580965},
171+
url = {https://doi.org/10.5281/zenodo.18580965},
172172
}
173173
```
174174

RELEASE_NOTES.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# microlens-submit v0.17.4 Release Notes
1+
# microlens-submit v0.17.5 Release Notes
22

33
**Release Date:** 2026-02-09
44

55
## Changelog
66

7-
## [0.17.4] - 2026-02-09
7+
## [0.17.5] - 2026-02-09
88

99
### Added
10-
- Added `regenerate` flag for `notebook_display_solution()` to force HTML refresh.
10+
- CLI support for attaching posterior samples via `add-solution` (`--posterior-path`).
11+
- CLI commands to edit and clear solution file paths (`--posterior-path`, `--lightcurve-plot-path`, `--lens-plane-plot-path`) in `edit-solution`.
1112

1213
### Changed
13-
- Dossier notebook rendering now inlines local plot images referenced by solution pages.
14-
- Temporary notes created without a project root now track their absolute location.
15-
16-
### Fixed
17-
- Submission save now relocates temporary notes even when the tmp file lives outside the project directory.
18-
- Conda recipe now uses the `pypi.io` source URL to avoid PyPI source 404s during build.
14+
- Updated CLI tutorial regarding file attachments (plots and posteriors).

conda/recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% set name = "microlens-submit" %}
22
{% set filename_name = name | replace("-", "_") %}
3-
{% set version = "0.17.4" %}
3+
{% set version = "0.17.5" %}
44
{% set python_min = "3.10" %}
55

66
# NOTE: This recipe is the source of truth for conda-forge. Edit it here in

docs/cli_tutorial.rst

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,15 @@ The in-depth contents of this tutorial are organized as follows:
4141
**Step-by-Step Guide**
4242
######################
4343

44-
If your terminal does not support ANSI escape codes, add ``--no-color`` to
45-
disable colored output.
44+
In this section, we will go through the complete workflow of using the
45+
``microlens-submit`` CLI to manage your Roman Microlensing Data Challenge
46+
2026 submission project. Each step includes detailed explanations, command
47+
examples, and tips for best practices.
48+
49+
.. attention:: Terminal Compatibility
50+
51+
If your terminal does not support ANSI escape codes, add ``--no-color`` to
52+
disable colored output.
4653

4754
.. tip:: **Windows PATH tip**
4855

@@ -51,7 +58,7 @@ disable colored output.
5158
microlens-submit`` and run ``py -m microlens_submit.cli --help``, or add
5259
the Scripts path shown by ``py -m pip show -f microlens-submit`` to PATH.
5360

54-
1. **Initialize your project**
61+
1. **Initialize Your Project**
5562
******************************
5663

5764
Start by creating a new submission project with your team information:
@@ -81,8 +88,10 @@ metadata.
8188
- ``--tier``: Challenge tier ("beginner" or "experienced")
8289
- Project path: Where to create the project directory
8390

84-
2. **Record repository and hardware info**
85-
******************************************
91+
.. _compute_information:
92+
93+
2. **Record Repository and Hardware Information**
94+
*************************************************
8695

8796
Before validation and export, set your repository URL and hardware details.
8897
GPU information is optional (Roman Nexus nodes are CPU-only), so omit it if
@@ -126,7 +135,7 @@ can also set solution-level hardware overrides (see
126135
`Solution-level hardware overrides <solution_hardware_overrides_>`__
127136
for details).
128137

129-
3. **Add your first solution**
138+
3. **Add Your First Solution**
130139
******************************
131140

132141
Add a microlensing solution with all required parameters:
@@ -141,6 +150,7 @@ Add a microlensing solution with all required parameters:
141150
--wall-time-hours 3.8 \
142151
--lightcurve-plot-path plots/event123_lc.png \
143152
--lens-plane-plot-path plots/event123_lens.png \
153+
--posterior-path posteriors/chain.h5 \
144154
--notes "Initial fit" \
145155
--higher-order-effect parallax,finite-source
146156
@@ -152,13 +162,14 @@ Add a microlensing solution with all required parameters:
152162

153163
.. admonition:: **Optional Metadata**
154164

155-
- Log-likelihood and data points for statistical analysis
156-
- Compute information for resource tracking
165+
- `Log-likelihood <solution_comparison_>`__ and data points for statistical analysis
166+
- `Compute information <compute_information_>`__ for resource tracking
157167
- Physical parameters (``--physical-param Mtot=0.5``)
158-
- Parameter uncertainties (``--param-uncertainty t0=[1.1,1.3]``)
168+
- `Parameter uncertainties <uncertainty_metadata_>`__ (``--param-uncertainty t0=[1.1,1.3]``)
159169
- Physical parameter uncertainties (``--physical-param-uncertainty Mtot=0.08``)
160170
- `Uncertainty metadata <uncertainty_metadata_>`__ (``--uncertainty-method mcmc_posterior --confidence-level 0.68``)
161-
- Plot paths for visualization files
171+
- `Plot paths <plots_>`__ for visualization files
172+
- `Posterior samples file <posteriors_>`__ (``--posterior-path``)
162173
- `Notes <notes_>`__ for documentation
163174
- Higher-order effects for advanced models
164175
- `Solution aliases <solution_aliases_>`__ for easier identification
@@ -218,7 +229,7 @@ cluttering the command line.
218229
**Parameter File Formats:**
219230
---------------------------
220231
221-
**Simple format (parameters only):**
232+
**Simple Format (Parameters Only):**
222233
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
223234
224235
.. code-block:: json
@@ -237,7 +248,7 @@ Or in YAML:
237248
u0: 0.1
238249
tE: 25.0
239250
240-
**Structured format (parameters + uncertainties):**
251+
**Structured Format (Parameters + Uncertainties):**
241252
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
242253
243254
.. code-block:: json
@@ -442,30 +453,30 @@ include rich documentation and visualizations in your submission dossier.
442453
=====================
443454
444455
After generating a posterior sample (e.g., an MCMC chain), store the file
445-
within your project and record its relative path using the Python API::
456+
within your project and record its relative path using the CLI:
446457
447-
>>> sub = microlens_submit.load("/path/to/project")
448-
>>> evt = sub.get_event("EVENT123")
449-
>>> sol = next(iter(evt.solutions.values()))
450-
>>> sol.posterior_path = "posteriors/chain.h5"
451-
>>> sol.lightcurve_plot_path = "plots/event123_lc.png"
452-
>>> sol.lens_plane_plot_path = "plots/event123_lens.png"
453-
>>> sub.save()
458+
.. code-block:: bash
454459
455-
.. note::
460+
microlens-submit edit-solution <solution_id> --posterior-path posteriors/chain.h5
461+
462+
.. tip::
456463
457-
The CLI does not currently have a command for attaching arbitrary files,
458-
but you can use the Python API to set any file paths you want tracked
459-
in the solution JSON or edit the JSON files directly. Just make sure to
460-
place the files within your project directory and save the relative paths.
464+
Make sure to place the files within your project directory and use the
465+
relative paths.
461466
462467
.. _plots:
463468
464469
**Plots and visualizations**
465470
============================
466471
467-
You can attach any plots or visualizations by saving them in your project and
468-
tracking their paths in the solution JSON.
472+
The submission packets are limited to two images per solution; the light-curve and lens-plane plots.
473+
You can attach any by saving them in your project and tracking their paths in the solution JSON.
474+
475+
.. code-block:: bash
476+
477+
microlens-submit edit-solution <solution_id> \
478+
--lightcurve-plot-path plots/event123_lc.png \
479+
--lens-plane-plot-path plots/event123_lens.png
469480
470481
.. _notes:
471482
@@ -685,6 +696,8 @@ Add alternative models for comparison:
685696
microlens-submit add-solution EVENT123 1S1L \
686697
--param t0=556.0 --param u0=0.2 --param tE=24.5
687698
699+
.. _solution_comparison:
700+
688701
**Solution Comparison:**
689702
========================
690703
@@ -793,6 +806,9 @@ After creating solutions, you can modify their attributes:
793806
# Add higher-order effects
794807
microlens-submit edit-solution <solution_id> --higher-order-effect parallax,finite-source
795808
809+
# Update plot paths
810+
microlens-submit edit-solution <solution_id> --lightcurve-plot-path plots/new_lc.png
811+
796812
# Clear an attribute
797813
microlens-submit edit-solution <solution_id> --clear-relative-probability
798814

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
author = "RGES-PIT"
99

1010
# The full version, including alpha/beta/rc tags
11-
release = "0.17.4"
11+
release = "0.17.5"
1212

1313
extensions = [
1414
"sphinx.ext.autodoc",

microlens_submit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
the command line interface.
66
"""
77

8-
__version__ = "0.17.4"
8+
__version__ = "0.17.5"
99

1010
from .models import Event, Solution, Submission
1111
from .utils import load

microlens_submit/cli/commands/solutions.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ def add_solution(
238238
"--lens-plane-plot-path",
239239
help="Path to lens plane plot file " "(relative to project directory) [ADVANCED]",
240240
),
241+
posterior_path: Optional[Path] = typer.Option(
242+
None,
243+
"--posterior-path",
244+
help="Path to posterior samples file " "(relative to project directory) [ADVANCED]",
245+
),
241246
alias: Optional[str] = typer.Option(
242247
None,
243248
"--alias",
@@ -316,6 +321,7 @@ def add_solution(
316321
sol.set_compute_info(cpu_hours=cpu_hours, wall_time_hours=wall_time_hours, git_dir=sub.git_dir)
317322
sol.lightcurve_plot_path = str(lightcurve_plot_path) if lightcurve_plot_path else None
318323
sol.lens_plane_plot_path = str(lens_plane_plot_path) if lens_plane_plot_path else None
324+
sol.posterior_path = str(posterior_path) if posterior_path else None
319325
# Handle notes file logic
320326
canonical_notes_path = Path(project_path) / "events" / event_id / "solutions" / f"{sol.solution_id}.md"
321327
if notes_file is not None:
@@ -343,6 +349,7 @@ def add_solution(
343349
"wall_time_hours": wall_time_hours,
344350
"lightcurve_plot_path": (str(lightcurve_plot_path) if lightcurve_plot_path else None),
345351
"lens_plane_plot_path": (str(lens_plane_plot_path) if lens_plane_plot_path else None),
352+
"posterior_path": (str(posterior_path) if posterior_path else None),
346353
"alias": alias,
347354
"notes_path": sol.notes_path,
348355
}
@@ -552,6 +559,24 @@ def edit_solution(
552559
help="Higher-order effects (replaces existing effects)",
553560
),
554561
clear_higher_order_effects: bool = typer.Option(False, help="Clear all higher-order effects"),
562+
lightcurve_plot_path: Optional[Path] = typer.Option(
563+
None,
564+
"--lightcurve-plot-path",
565+
help="Path to lightcurve plot file (relative to project directory)",
566+
),
567+
lens_plane_plot_path: Optional[Path] = typer.Option(
568+
None,
569+
"--lens-plane-plot-path",
570+
help="Path to lens plane plot file (relative to project directory)",
571+
),
572+
posterior_path: Optional[Path] = typer.Option(
573+
None,
574+
"--posterior-path",
575+
help="Path to posterior samples file (relative to project directory)",
576+
),
577+
clear_lightcurve_plot_path: bool = typer.Option(False, help="Clear lightcurve plot path"),
578+
clear_lens_plane_plot_path: bool = typer.Option(False, help="Clear lens plane plot path"),
579+
clear_posterior_path: bool = typer.Option(False, help="Clear posterior sample path"),
555580
dry_run: bool = typer.Option(
556581
False,
557582
"--dry-run",
@@ -699,6 +724,40 @@ def edit_solution(
699724
f"Update higher_order_effects: {target_solution.higher_order_effects} {arrow} {higher_order_effect}"
700725
)
701726
target_solution.higher_order_effects = higher_order_effect
727+
728+
if clear_lightcurve_plot_path:
729+
if target_solution.lightcurve_plot_path:
730+
changes.append(f"Clear lightcurve_plot_path: {target_solution.lightcurve_plot_path}")
731+
target_solution.lightcurve_plot_path = None
732+
elif lightcurve_plot_path is not None:
733+
old_val = target_solution.lightcurve_plot_path
734+
new_val = str(lightcurve_plot_path)
735+
if old_val != new_val:
736+
changes.append(f"Update lightcurve_plot_path: {old_val} {arrow} {new_val}")
737+
target_solution.lightcurve_plot_path = new_val
738+
739+
if clear_lens_plane_plot_path:
740+
if target_solution.lens_plane_plot_path:
741+
changes.append(f"Clear lens_plane_plot_path: {target_solution.lens_plane_plot_path}")
742+
target_solution.lens_plane_plot_path = None
743+
elif lens_plane_plot_path is not None:
744+
old_val = target_solution.lens_plane_plot_path
745+
new_val = str(lens_plane_plot_path)
746+
if old_val != new_val:
747+
changes.append(f"Update lens_plane_plot_path: {old_val} {arrow} {new_val}")
748+
target_solution.lens_plane_plot_path = new_val
749+
750+
if clear_posterior_path:
751+
if target_solution.posterior_path:
752+
changes.append(f"Clear posterior_path: {target_solution.posterior_path}")
753+
target_solution.posterior_path = None
754+
elif posterior_path is not None:
755+
old_val = target_solution.posterior_path
756+
new_val = str(posterior_path)
757+
if old_val != new_val:
758+
changes.append(f"Update posterior_path: {old_val} {arrow} {new_val}")
759+
target_solution.posterior_path = new_val
760+
702761
if dry_run:
703762
if changes:
704763
console.print(Panel(f"Changes for {solution_id} (event {target_event_id})", style="cyan"))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66

77
[project]
88
name = "microlens-submit"
9-
version = "0.17.4"
9+
version = "0.17.5"
1010
authors = [
1111
{ name="Amber Malpas", email="malpas.1@osu.edu" },
1212
{name = "Roman Science Platform Team", email = "roman-science-platform@stsci.edu"}

0 commit comments

Comments
 (0)