Skip to main content
        .   °                .......                                     °   
       | .° |                :.   .:                                   (  .° )
       | °  |                .'   '.                                    |°  |
       |° . |                |     |                                   /°  ° \
      (______)               `_____'                                  (_______) 
▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌
  ▄▄▄▄▄▄▄▄▄   ▄▄▄▄▄▄▄▄▄▄  ▄▄        ▄  ▄▄▄▄▄▄▄▄▄▄  ▄        ▄  ▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄ 
 ▐░░░░░░░░░▌ ▐░░░░░░░░░░▌▐░░▌      ▐░▌▐░░░░░░░░░░▌▐░▌      ▐░▌▐░░░░░░░░░░▌▐░░░░░░░░░░▌▐░░░░░░░░░░▌
 ▐░█▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀ ▐░▌░▌     ▐░▌▐░█▀▀▀▀▀▀▀▀ ▐░▌      ▐░▌ ▀▀▀▀█░█▀▀▀ ▐░█▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀█░▌
 ▐░█▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌   ▐░▌▐░▌         ▐░█▄▄▄▄▄▄█░▌     ▐░▌    ▐░▌      ▐░▌▐░█▄▄▄▄▄▄█░▌
 ▐░░░░░░░░░▌ ▐░░░░░░░░░░▌▐░▌  ▐░▌  ▐░▌▐░▌         ▐░░░░░░░░░░▌     ▐░▌    ▐░▌      ▐░▌▐░░░░░░░░░░▌
 ▐░█▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀ ▐░▌   ▐░▌ ▐░▌▐░▌         ▐░█▀▀▀▀▀▀█░▌     ▐░▌    ▐░▌      ▐░▌▐░█▀▀▀▀▀▀▀▀ 
 ▐░█▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄ ▐░▌     ▐░▐░▌▐░█▄▄▄▄▄▄▄▄ ▐░▌      ▐░▌     ▐░▌    ▐░█▄▄▄▄▄▄█░▌▐░▌          
 ▐░░░░░░░░░▌ ▐░░░░░░░░░░▌▐░▌      ▐░░▌▐░░░░░░░░░░▌▐░▌      ▐░▌     ▐░▌    ▐░░░░░░░░░░▌▐░▌          
  ▀▀▀▀▀▀▀▀▀   ▀▀▀▀▀▀▀▀▀▀  ▀        ▀▀  ▀▀▀▀▀▀▀▀▀▀  ▀        ▀       ▀      ▀▀▀▀▀▀▀▀▀▀  ▀           

Benchtop

Parallel in-silico experiments for biological models

Benchtop runs simulation benchmarks defined in a PEtab-inspired format. Given a YAML configuration and companion TSV/SBML files, it schedules conditions in dependency order, simulates across multiple CPU cores, caches intermediate results, and computes observables for model–data comparison.

Documentation

Full documentation: https://benchtop.readthedocs.io/en/latest/

Sphinx sources live in docs/. To build locally after pip install -e ".[docs]":

python -m sphinx -b html docs docs/_build/html

Features

  • PEtab-style benchmarks — Define experiments with YAML plus standard TSV files for conditions, measurements, observables, and parameters.
  • Parallel execution — Distributes simulation tasks across processes using a round-robin worker pool.
  • Preequilibration support — Topologically sorts conditions so preequilibration runs before dependent simulations.
  • Single-cell replication — Run multiple stochastic replicates per condition via cell_count.
  • Result caching — Persists per-simulation pickle files and a cache index; supports resuming incomplete runs.
  • Observable calculation — Evaluates observable formulas from simulation trajectories and aligns them with experimental measurements.
  • Pluggable simulators — Built-in Tellurium wrapper; optional AMICI support via extras.

How it works

flowchart LR
    YAML[Benchmark YAML] --> Loader[FileLoader]
  Loader --> Exp[Experiment]
  Exp --> Org[Organizer]
  Org -->|topological task order| Pool[Worker pool]
  Pool --> Sim[Simulator wrapper]
  Sim --> Cache[ResultCache]
  Cache --> Obs[ObservableCalculator]
  Obs --> Results[results/*.pkl]
  1. FileLoader reads the benchmark YAML and loads PEtab TSV/SBML files into memory.
  2. Organizer builds a dependency-aware task list (conditions × cell replicates) and assigns work to workers.
  3. Workers load the SBML model, apply condition parameters, run preequilibration when needed, and simulate.
  4. ResultCache stores raw trajectories as pickle files alongside a JSON index.
  5. ObservableCalculator downsamples trajectories, evaluates observable formulas, and packages results next to experimental data.

Requirements

Installation

Benchtop is registered on PyPI and pip installable:

pip install benchtop

To build from source,navigate to the repository root:

pip install -e .

For AMICI support (optional):

pip install -e ".[amici]"

This installs the benchtop CLI entry point.

Quick start

Command line

Run a single benchmark:

benchtop experiment -p src/tests/data/LR-benchmark.yaml -s tellurium -c 4

Run all benchmarks in a directory:

benchtop experiment --run_all path/to/benchmarks/ -s tellurium

Useful flags:

Flag Description
-p, --path Path to benchmark YAML
-s, --simulator Simulator backend (tellurium or amici)
-c, --cores Number of parallel processes (default: CPU count)
--cache_dir Directory for simulation cache (default: ./.cache)
--load_index Resume from an existing cache index
--no_confirm Overwrite an existing cache directory without erroring
--No_Observables Skip observable calculation after simulation
-v, --verbose Enable debug logging

Python API

from benchtop.experiment import Experiment

experiment = Experiment(
    "src/tests/data/LR-benchmark.yaml",
    cores=4,
    cache_dir="./.cache",
    verbose=True,
)

experiment.run("tellurium")
experiment.calculate_observables()

You can also pass a custom simulator class that extends AbstractSimulator instead of a registry name.

A worked example is available in demo/in-silico-experiment-demo.ipynb.

Benchmark configuration

A benchmark is a directory containing a YAML file that references PEtab-style data files. Example (src/tests/data/LR-benchmark.yaml):

format_version: 1
parameter_file: LR Model - Parameters.tsv
problems:
  - name: test-benchmark
    condition_files:
      - conditions.tsv
    measurement_files:
      - measurements.tsv
    observable_files:
      - observables.tsv
    sbml_files:
      - LR-model.xml
    cell_count: 3

Note: The cell_count attribute is only applicable to Benchtop and specifies the number of replicates to simulate per-condition.

Data files

File Purpose
Parameter.tsv Model parameters (parameterId, parameterScale, nominalValue, …)
conditions.tsv Simulation conditions — maps conditionId to parameter overrides
measurements.tsv Links observables to conditions, optional preequilibration, and measurement timepoints
observables.tsv Observable definitions (observableId, observableFormula, noiseFormula)
SBML One or more model files (.xml or .sbml)

When preequilibrationConditionId is set in measurements.tsv, Benchtop runs the preequilibration condition first and uses its final state as the initial condition for the simulation.

Results

After observable calculation, results are written as a pickle file in a results/ subdirectory next to the benchmark YAML (named after the problem or today's date). Each entry in the results dictionary contains:

  • conditionId and cell replicate index
  • Per-observable experiment, simulation, and time arrays

Simulators

Benchtop uses a small registry of simulator wrappers in src/wrappers/. Each wrapper implements AbstractSimulator with load, modify, and simulate methods.

Name Class Install
tellurium TelluriumSimulator Included by default
amici AmiciSimulator pip install -e ".[amici]"

To add a new backend, create a wrapper under src/wrappers/ and register it in src/benchtop/registry.py.

Project structure

Benchtop/
├── demo/                          # Jupyter notebook walkthrough
├── src/
│   ├── benchtop/                  # Core library
│   │   ├── experiment.py          # Main experiment orchestrator
│   │   ├── _organizer.py          # Task scheduling and topological sort
│   │   ├── _worker.py             # Per-simulation worker logic
│   │   ├── _record.py             # Results dictionary management
│   │   ├── _results_cacher.py     # Pickle cache and index
│   │   ├── _observable_calculator.py
│   │   ├── _abstract_simulator.py # Simulator interface
|   |   ├── design.py              # Creates visual of simulation experiment
│   │   ├── file_loader.py         # YAML and TSV loading
│   │   ├── registry.py            # Simulator lookup
│   │   ├── launcher.py            # CLI entry point
│   │   └── arguments.py           # CLI argument parsing
│   ├── wrappers/                  # Simulator backends
│   └── tests/                     # Test suite and example data
├── pyproject.toml
└── README.md

Running tests

From the repository root:

cd src/tests
python run_tests.py

The test suite uses the LR receptor benchmark in src/tests/data/ and exercises experiment execution, caching, workers, organizers, records, and observable calculation.

Authors

License

See LICENSE.

Metadata

Release files for Benchtop 0.1.4.1

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

Source distribution (sdist)

Source distribution for Benchtop 0.1.4.1
File Size Uploaded
benchtop-0.1.4.1.tar.gz 37.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Benchtop 0.1.4.1
File Interpreter ABI Platform
benchtop-0.1.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 87.4 kB

Release files / benchtop-0.1.4.1.tar.gz

Download URL benchtop-0.1.4.1.tar.gz
Size 37.6 kB
Tags Source
SHA-256 checksum
How to use checksums
04cb0035fa6f6c6ca761dae380fed450ddaf1add36c77fc4758bb87adecfc555
BLAKE2b-256 checksum
How to use checksums
f6a844979c537049f184f9a4c68b9033ab01ba2f6ed42e1acfcceaf6966f3e9c
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 Sep 10, 2026.

Transparency log

Release files / benchtop-0.1.4.1-py3-none-any.whl

Download URL benchtop-0.1.4.1-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4cf55013530c23a37f0d1b583e7bf1d787e87536eb2f77feefffc6038a8ab4c
BLAKE2b-256 checksum
How to use checksums
c6a091afb6f4ba2911e23c70c2e0f369d3148d7f749e29abb3dd401d86dddfea
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 Sep 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4.1 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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