Skip to content

Prepare pyvcell for 2026 workshop: docs, remote simulation API, and client regeneration#35

Merged
jcschaff merged 24 commits intomainfrom
workshop-2026
Mar 19, 2026
Merged

Prepare pyvcell for 2026 workshop: docs, remote simulation API, and client regeneration#35
jcschaff merged 24 commits intomainfrom
workshop-2026

Conversation

@jcschaff
Copy link
Member

Summary

  • Documentation overhaul: Replace auto-generated module docs with hand-written guides (visualization, building a model, complex geometries, field data, remote simulations, SBML, parameter
    exploration) with companion Jupyter notebooks and generated images
  • Remote simulation API (vcml_remote module): High-level convenience functions (run_remote, save_and_start, export_n5) to authenticate, save a model, run simulations, poll for completion, and
    read results via TensorStore — all from Python
  • Regenerated VCell API client: Updated OpenAPI spec and regenerated Python client with bug fixes (base URL doubling, Accept header, XML deserialization) and a post-generation patch script
  • Geometry improvements: Extracted SegmentedImageGeometry class, fixed analytic/image rasterization axis ordering, added save_path to plot methods for static doc generation
  • Expression handling: Improved numeric expression generation with boolean parsing fix in zarr writer
  • Version model: Parse server-assigned version metadata from VCML XML into pydantic models
  • CI/build: Notebook execution tests, docs-execute-notebooks make target, cache-corruption resilience in GitHub Actions

Test plan

  • pytest tests/ — unit tests including new geometry and expression tests
  • pytest tests/guides/test_notebooks.py — notebook execution tests (excludes remote-simulations which requires OAuth)
  • mkdocs serve — verify documentation renders correctly with images
  • Manual: run docs/guides/notebooks/remote-simulations.ipynb against live VCell server

jcschaff and others added 14 commits March 18, 2026 23:25
…ization

Decouple geometry processing from visualization by extracting a
SegmentedImageGeometry class that holds a labeled numpy array with
spatial metadata, independent of PyVista/VTK.

Key changes:
- New pyvcell/_internal/geometry/ package with SegmentedImageGeometry
- Geometry.to_segmented_image() factory method
- Geometry.plot() now delegates to SegmentedImageGeometry.plot()
- Fix analytic rasterizer to honor first-added-wins priority
- Fix Image axis ordering: size is now consistently (X, Y, Z) with
  X-fastest pixel data, matching VCell VCML convention

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add save_path to Plotter.plot_concentrations(), plot_slice_2d(),
plot_slice_3d(), and SegmentedImageGeometry.plot() / Geometry.plot()
so notebooks can save figures to files for use in static docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…on tests

Notebooks now save figures via save_path to docs/guides/images/.
Markdown guides reference these images so static pages show plots.
Add pytest-based notebook execution tests under tests/guides/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
login_interactive() defaulted api_base_url to include /api/v1, causing
a doubled path prefix since the generated client already includes it in
resource paths. The generated saveBioModel method listed application/json
in the Accept header but the server only @produces(APPLICATION_XML). The
deserializer did not handle application/xml responses from the server.

Added scripts/python-fix.sh to patch these code-generator bugs after
regeneration, and wired it into generate.sh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Parse server-assigned version metadata (key, name, owner, date) from
VCML XML into Biomodel and Simulation objects, enabling programmatic
access to server keys after save/load round-trips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Create notebook walking through authenticate, save, run, monitor, and
export workflow against the live VCell server. Exclude from CI execution
since it requires interactive OAuth login.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace file download approach with lazy chunked reads via TensorStore's
HTTP driver against VCell's S3 proxy. Update guide and notebook to parse
the export URL and open the N5 dataset remotely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduce the `vcml_remote` module to automate the multi-step process of saving a model, starting a simulation, polling for completion, and exporting results to N5.

The new `run_remote` function provides a single-call entry point that returns a TensorStore, while composable functions like `save_and_start` and `export_n5` offer more granular control. Update the tutorial notebook and documentation to demonstrate this simplified workflow.

Co-Authored-By: Claude Opus 4.6
@jcschaff jcschaff self-assigned this Mar 19, 2026
jcschaff added 10 commits March 19, 2026 01:03
Implement _write_version() in VcmlWriter so Version elements roundtrip
through read/write cycles. Fix mypy errors in vcml_remote.py: use
camelCase alias names for generated API models and narrow str|None type.
…ckend

Update expected concentration values in test_simulations.py and
test_result.py to reflect domain-masked mean computation. Set
matplotlib Agg backend in tests that call plot functions to prevent
hanging on interactive display. Fix publication API test import.
@jcschaff jcschaff merged commit 63d65b9 into main Mar 19, 2026
6 checks passed
@jcschaff jcschaff deleted the workshop-2026 branch March 19, 2026 06:19
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