Skip to content

feat: osiris wrapper#279

Open
physicistphil wants to merge 22 commits into
ergodicio:mainfrom
physicistphil:osiris-wrapper
Open

feat: osiris wrapper#279
physicistphil wants to merge 22 commits into
ergodicio:mainfrom
physicistphil:osiris-wrapper

Conversation

@physicistphil

Copy link
Copy Markdown

Todo:

  1. Merge outputs into a single file (xarray) instead of uploading h5
  2. Build reasonable diagnostic / plots (mimicking what we have for vlasov). Right now it's just a few useful plots

physicistphil and others added 15 commits May 26, 2026 13:01
functions (should probably be moved to another branch). Added density
and temperature profiles. Fixed LaTeX issues
regenerates from the saved NetCDF artifacts alone — no rerun, no raw
MS/ tree. Made list_diagnostics/load_series/load_hist_energy dispatch
between the MS/ HDF5 tree and a binary/ NetCDF dir, made field-energy
source-agnostic, and now persist HIST/energy.nc in save_run_datasets.
Added 3 tests
- regen harness: rebuild the full canned plot set from saved NetCDFs (no rerun)
- f(p) and delta-f lineouts; temperature profile from phase-space Maxwellian fits
- number-density profiles (initial/final/late-mean); 2-panel equal-aspect omega-k
- phase-space & spacetime: space on x-axis, cropped to box, log-contrast floor
- proper-LaTeX titles (prose vs math)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ion+reflection plot (should probably be moved to osiris-lpi repo)
sync-up.sh script doesn't delete ongoing osiris runs
@joglekara

Copy link
Copy Markdown
Member

is this ready to go?

@physicistphil

Copy link
Copy Markdown
Author

Gave it a read through; should be good to go. Idk if the tests are actually all that useful but I left them in ¯_(ツ)_/¯

@physicistphil physicistphil marked this pull request as ready for review June 17, 2026 00:00
BaseOsiris.write_units() previously returned {} so OSIRIS runs logged an empty units.yaml. Derive the physical reference scales (wp0, tp0, n0, v0, x0, c_light, beta, box_length, sim_duration) from the deck's simulation.n0 (density) or simulation.omega_p0 (frequency); when both are present, n0 wins, as in OSIRIS. This mirrors the canonical key set the other adept solvers emit so OSIRIS runs are comparable in MLflow.

Adds skin_depth_normalization and skin_depth_normalization_from_frequency to normalization.py. OSIRIS has no single global reference temperature (species carry per-species thermal momenta), so the temperature-dependent keys (T0/nuee/logLambda_ee) are omitted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@physicistphil

Copy link
Copy Markdown
Author

test-pip-install failure — not caused by this PR

The test-pip-install failure is a pre-existing break on main (started 2026-06-15, runs #287/#288; green on 2026-06-10). This branch just inherited it.

Root cause: unpinned dependency drift between matplotlib and scienceplots.

  • import adeptadept/_lpse2d/helpers.py does import scienceplots
  • scienceplots 2.2.1 (latest) calls plt.style.core.read_style_directory(...) at import time
  • matplotlib 3.11.0 removed the matplotlib.style.core attribute, so the import raises:
AttributeError: module 'matplotlib.style' has no attribute 'core'

pyproject.toml pins neither package, and test-pip-install does a clean, unconstrained install — so it picked up the freshly released matplotlib 3.11.0. The other test jobs use a constrained environment, which is why only this check is red. No fixed scienceplots release exists yet (2.2.1 is latest and still references the removed attribute).

Suggested fix: pin matplotlib<3.11 in pyproject.toml until scienceplots ships a compatible release. Probably best as a small standalone PR against main rather than folded in here.

@joglekara

Copy link
Copy Markdown
Member

Read through this — looks good to merge from my side. The wrapper architecture is clean, the security surface on the subprocess runner is fine (list-form Popen, no shell), and the synthesized-fixture tests (deck roundtrip / post / plots / units) give real CI coverage. One thing I'd like fixed before it goes in:

Hardcoded local paths in the example configs. configs/osiris/twostream-1d.yaml and twostream-1d-short.yaml both point deck: and binary: at /home/phil/Desktop/pic/..., so the shipped examples won't run for anyone else. Since this PR already adds in-repo example decks under tests/test_osiris/decks/, could you repoint the configs at those (e.g. deck: tests/test_osiris/decks/two-stream-1d) and drop the hardcoded binary: in favor of the OSIRIS_BIN / OSIRIS_BIN_<dim>D env fallback the runner already supports? That makes the examples runnable out of the box.

Otherwise LGTM — nice work on the docstrings and the NetCDF regen path. (Separately: the test-pip-install red is the pre-existing matplotlib/scienceplots break on main, not this PR.)

@physicistphil

Copy link
Copy Markdown
Author

Fixed the hardcoded paths. Also updated the docs/ markdown file (osiris-adept-usage.md). Another note: the canned plots were written for 1D sims, so 2D may cause issues (I haven't tried any 2D runs), but I figure we can cross that bridge when we get to it. Otherwise it should be good to go

@joglekara joglekara self-requested a review June 22, 2026 22:05

@joglekara joglekara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants