Skip to main content

A demonstration of process composition rebuilding and extending COMETS by composing functional components

Project description

Spatio-Flux

▶ live test report paper ecosystem

A reference application for compositional multiscale biological modeling built on the Process-Bigraph framework. Spatio-Flux composes independently developed processes — metabolism, spatial transport, particle dynamics, structural rewrites — into a single executable simulation via typed interfaces and shared orchestration, not tightly coupled solvers.

It's the worked example in Process Bigraphs and the Architecture of Compositional Systems Biology (Agmon & Spangler, arXiv:2512.23754).

Browse the live test suite report → 19 composite scenarios, each with structure diagrams, time series, and plots.

Spatio-Flux reference composite

Spatio-Flux reference demo


What this repo is

Spatio-Flux is a testbed and reference implementation, not an optimized domain simulator. Its purpose is to make model composition explicit and inspectable.

It demonstrates how to:

  • compose heterogeneous modeling paradigms (ODEs, dFBA, spatial fields, particles)
  • couple mechanisms through shared typed state, not direct process calls
  • coordinate multi-timescale execution with reusable orchestration patterns
  • swap or recombine processes without modifying surrounding models

The test suite

The heart of the repo is spatio_flux/experiments/test_suite.py, which exercises 19 composition patterns and renders the report linked above.

Covered scenarios include:

  • Monod and dynamic FBA metabolism (single-strain + multi-strain communities)
  • COMETS-style spatial dFBA on a lattice
  • Brownian and Newtonian (Pymunk) particle systems
  • Particle–field exchange with embedded metabolism
  • Event-driven division and boundary handling

Each scenario produces a process-bigraph diagram, serialized schemas and state, and domain-specific plots or animations.

Each composite is a @composite_generator-decorated function under spatio_flux/composites/, discoverable by the pbg-superpowers dashboard.


Run it locally

git clone https://github.com/vivarium-collective/spatio-flux.git
cd spatio-flux
uv sync
uv run python spatio_flux/experiments/test_suite.py --output out
open out/report.html

--tests <name1> <name2> … runs a subset. --skip-existing reuses cached per-test artifacts so you can re-render the HTML without re-simulating.


Ecosystem

Spatio-Flux is part of Vivarium 2.0 — an open-source ecosystem for compositional modeling:

Citation

@article{agmon2025spatioflux,
  title  = {Process Bigraphs and the Architecture of Compositional Systems Biology},
  author = {Agmon, Eran and Spangler, Daniel},
  journal = {arXiv preprint arXiv:2512.23754},
  year   = {2025},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spatio_flux-1.4.0.tar.gz (132.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spatio_flux-1.4.0-py3-none-any.whl (144.9 kB view details)

Uploaded Python 3

File details

Details for the file spatio_flux-1.4.0.tar.gz.

File metadata

  • Download URL: spatio_flux-1.4.0.tar.gz
  • Upload date:
  • Size: 132.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spatio_flux-1.4.0.tar.gz
Algorithm Hash digest
SHA256 4efcdfa6f69409f9ea72fb3955347444608aaf65d62e58348739de89948dbb37
MD5 754efe4c426ce868b8e5fe6881c9308b
BLAKE2b-256 a1b3f8c99330acf3a20abb4be14bf70b02a2b9f5a5fa2bfcd9fd7f742b26b72c

See more details on using hashes here.

Provenance

The following attestation bundles were made for spatio_flux-1.4.0.tar.gz:

Publisher: release.yml on vivarium-collective/spatio-flux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spatio_flux-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: spatio_flux-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 144.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for spatio_flux-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b03b063182b3177d92b2199178c759e7579f897781f6d93dd84baf2bcf7245a0
MD5 9e93944346cfddcc9d2a5cbc6bc19060
BLAKE2b-256 bf1da978f55a2071d8faad01a46b5dfb81123721b264b25ef40890f041aa63c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for spatio_flux-1.4.0-py3-none-any.whl:

Publisher: release.yml on vivarium-collective/spatio-flux

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page