Skip to main content

viva-copasi

process-bigraph-compatible COPASI Steps and Processes for SBML model simulation.

Exposes any SBML kinetic model as a process-bigraph Step or Process so it can be composed with other simulators in a bigraph document, using COPASI / basico as the simulation back-end.

Installation

uv venv .venv && source .venv/bin/activate
uv pip install -e .

Quick Start

from importlib.resources import files
from process_bigraph import Composite, gather_emitter_results
from viva_copasi.composites import build_composite, register_copasi

# Resolve the bundled Repressilator model
model_path = str(files('viva_copasi.composites').joinpath('repressilator.xml'))

# Build and run the incremental UTC process composite
sim = build_composite('utc-process')
for _ in range(10):
    sim.update({}, 1.0)   # advance 1 time unit per step

results = gather_emitter_results(sim)
print(results[('emitter',)][-1])

Classes

  • CopasiUTCStep — one-shot Uniform Time Course (UTC) trajectory (Step)
  • CopasiUTCProcess — incremental UTC simulation (Process)
  • CopasiSteadyStateStep — steady-state solve (Step)
  • BaseCopasi — shared model-load mixin (SBML parsing, species/reaction indexing)

All classes accept a model_source config key pointing to an SBML or COPASI model file (path or URL).

Composites

Three discoverable composites in viva_copasi/composites/:

Name Type Description
utc-step Step One-shot UTC trajectory; returns full time series in a single update() call
utc-process Process Incremental UTC; advances one interval per update(), emitting concentrations + fluxes
steady-state Step Steady-state solve; returns equilibrium concentrations and reaction fluxes

Each ships with the bundled SBML model BIOMD0000000012 — the Elowitz & Leibler 2000 Repressilator.

Load a composite by name:

from viva_copasi.composites import build_composite, list_composite_specs

print(list_composite_specs())   # ['steady-state', 'utc-process', 'utc-step']
sim = build_composite('utc-process')

Override the model or parameters:

sim = build_composite('utc-step', overrides={
    'model_source': '/path/to/my_model.xml',
    'time': 50.0,
    'n_points': 51,
})

API

CopasiUTCStep (Step)

One-shot UTC trajectory.

Config: model_source (str), time (float, default 1.0), n_points (int, default 2).

Outputs: result — dict with keys time (list), columns (list), values (list of rows).

CopasiUTCProcess (Process)

Incremental UTC simulation.

Config: model_source (str), time (float, default 1.0), intervals (int, default 10).

Outputs: species_concentrations (map[float]), fluxes (map[float]), time (list[float]).

CopasiSteadyStateStep (Step)

Steady-state solve.

Config: model_source (str).

Outputs: results — dict with keys time, species_concentrations, fluxes.

register_copasi(core=None)

Register all COPASI process classes, the RAM emitter, and the SpeciesConcentrationsPlot visualization into a bigraph core.

make_copasi_utc_document(...) / make_copasi_utc_process_document(...) / make_copasi_steady_state_document(...)

Programmatic composite-document factories for callers that want full control over wiring without a YAML file.

Tests

python -m pytest tests/ -q

Demos

python demo/demo_report.py       # runs all 3 classes; saves demo/report.html
python demo/composite_report.py  # runs utc-process composite; saves demo/utc-process-report.html

Metadata

Release files for viva-copasi 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viva-copasi 0.1.2
File Size Uploaded
viva_copasi-0.1.2.tar.gz 31.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for viva-copasi 0.1.2
File Interpreter ABI Platform
viva_copasi-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 61.7 kB

Release files / viva_copasi-0.1.2.tar.gz

Download URL viva_copasi-0.1.2.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c62a0ba70e50bc1c3b082663781bf0052680e78c4b8270a97c58a34df6a6d06e
BLAKE2b-256 checksum
How to use checksums
5223886b916c4e92af14319932048cb474eb1f00bff48e3014aabc902c1001d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / viva_copasi-0.1.2-py3-none-any.whl

Download URL viva_copasi-0.1.2-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71e7eb8cd05cd2cb42bb0c8ddfd9314cf4f4ccfba91f8b201260e761a2e71b58
BLAKE2b-256 checksum
How to use checksums
7dc2bde3261104344e493e37e55733f32759fa285f7eaa2565474dd8f64ba0d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page