Skip to content

Export playground setups as Python scripts; release 2.3.1 - #33

Merged
ZeyuXuAudio merged 2 commits into
mainfrom
playground/python-export
Sep 19, 2026
Merged

ZeyuXuAudio merged 2 commits into
mainfrom
playground/python-export

Conversation

@ZeyuXuAudio

Copy link
Copy Markdown
Collaborator

Summary

  • Playground: export Python scripts. The run card gains Set up and Last run buttons. Set up writes an editable script for the validated current controls without running; Last run writes the settings captured when the last successful run was dispatched, unaffected by later edits, preset changes or failed runs.
  • The script rebuilds the simulation through the public DEISM API: room geometry (convex wall centers keep their material rows; vertices are world coordinates, the rotation only turns the acoustic frames), per-wall materials, sampled directivities resolved to the original MAT files (DATA_DIR / DEISM_DATA_DIR, never downloaded), frequency settings, optional fluctuations and RTF/RIR output. Running it computes the result in memory and plots it; it writes no files.
  • deism-playground saves exports through a new POST /export-script endpoint into playground/scripts/ (git-ignored) as deism_setup.py / deism_lastrun.py, numbering repeats so nothing is overwritten. The page shows the saved path in a wrapping status line and the console prints it. The standalone demo.html cannot write to a project folder and says so.
  • Unfixed fluctuation seeds are drawn on the page before a run is dispatched, so the seed used is recorded in the result archive and in the Last run export.
  • Version bumped to 2.3.1 with a changelog section. DATASET_RELEASE stays v2.3.0 (the MAT assets live there) and the JavaScript engine (2.3.0-js) is untouched.

Test plan

  • npm test in playground/: 53 passed (engine, presentation, workflow, export snapshot and save-endpoint tests)
  • pytest tests/test_playground_python_export.py tests/test_playground_result_storage.py --require-directivity-data: 64 passed, including the 32-case MIX matrix (shoebox/convex × RTF/RIR × fluctuations × source/receiver directivity) with seed reproducibility in both workflows
  • demo.html / native.html rebuilt from the sources with tools/playground_build.py (byte-identical to the committed bundles)
  • Long saved paths verified to wrap inside the run card in the browser
  • docs/changelog.rst parses cleanly with docutils (a pre-existing missing blank line before the 2.2.1.16 heading is fixed)
  • CI: playground-tests (node + datasets) and critical tests on ubuntu/macos/windows

After merge

Tag the merge commit v2.3.1 and create the GitHub release (no assets needed); publishing the release triggers the wheel build and PyPI upload.

🤖 Generated with Claude Code

ZeyuXuAudio and others added 2 commits September 19, 2026 17:05
Add "Set up" and "Last run" export buttons to the run card. Both write
an editable script that rebuilds the simulation through the public DEISM
API: geometry and per-wall materials (convex wall centers keep their
material rows), sampled directivities resolved to the original MAT
files, frequency settings, optional fluctuations, and RTF/RIR output.
"Set up" exports the validated current controls; "Last run" exports the
snapshot captured when the last successful run was dispatched, so later
edits or failed runs do not change it.

The local launcher gains a POST /export-script endpoint that saves the
script under playground/scripts/ (git-ignored) with exclusive-create
names and returns the path, which the page shows in a wrapping status
line; the standalone demo reports that the launcher is required. Unfixed
fluctuations now draw their seed on the page before dispatch, so the
seed is recorded in both the export and the result archive.

Running an exported script computes the RTF/RIR in memory and plots it;
it writes no result files. Parity tests execute browser-generated
scripts against the native adapter, including a 32-case MIX matrix over
room type, output mode, fluctuations and source/receiver directivity.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Add the 2.3.1 changelog section for the playground Python export, note
that the sampled-directivity datasets stay attached to the v2.3.0
release, and restore the blank line before the 2.2.1.16 heading that
docutils reported as an unindented bullet list.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ZeyuXuAudio
ZeyuXuAudio merged commit 8d00294 into main Sep 19, 2026
5 checks passed
@ZeyuXuAudio
ZeyuXuAudio deleted the playground/python-export branch September 19, 2026 15:17
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.

1 participant