Skip to main content

Markov-chain evolutionary dynamics on genotype-phenotype maps. Rust-accelerated.

Project description

gpvolve-v2

CI Documentation PyPI Python License Streamlit

Markov-chain evolutionary dynamics on genotype-phenotype maps. Rust-accelerated.

gpvolve-v2 lifts a gpgraph-v2 GenotypePhenotypeGraph into a Markov state model and analyzes evolutionary dynamics on top of it. Given a fitness function and a fixation model (SSWM, Moran, McCandlish, Bloom DMS, weak-mutation), it builds a row-stochastic transition matrix and computes stationary distributions, relaxation timescales, mean first passage times, transition path theory committors and reactive flux, dominant pathways, stochastic walker trajectories, PCCA+ metastable sets, and fitness peaks.

This is a clean-break rewrite of harmslab/gpvolve (dormant since 2020) with selective architectural inspiration from the harmsm/gpvolve fork (dormant since 2022). The two hot paths that actually scaled badly in pure Python live in Rust via PyO3 + rayon: the stochastic walker sampler (~500x faster at 2^14 states) and the BiCGSTAB committor solver (~1700x faster at 2^14 vs scipy.sparse.linalg.spsolve). Everything else (transition matrix assembly, stationary distributions, TPT setup, PCCA+) stays in vectorized numpy/scipy where it already runs under a second on 2^14 maps. See benchmarks/README.md for the measured numbers and the rationale for what is and is not in Rust.

Try it in the browser

The Streamlit showcase tours every public surface interactively: MSM builder, TPT explorer, stochastic sampler with live ESS / R-hat, PCCA+ clustering, and a live Rust-vs-Python benchmark tab. Source under examples/streamlit/.

Why v2

  • Drops the dormant msmtools dependency. PCCA+ and TPT are reimplemented natively.
  • Fast where it matters. Walker sampling and the committor solver run in Rust with rayon parallelism; the rest stays in vectorized numpy/scipy.
  • Sound convergence. Stochastic path sampling stops on a real criterion (effective sample size + Gelman-Rubin R-hat), not a Euclidean distance heuristic.
  • Typed. Full type hints, mypy --strict in CI.
  • Modern tooling. uv + maturin + pyproject.toml. Releases via python-semantic-release. OIDC-based PyPI publishing.
  • Consumes the v2 family. Hard deps on gpmap-v2 and gpgraph-v2; speaks their locked SCHEMA.md contracts.

Install

pip install gpvolve-v2

Or with uv:

uv add gpvolve-v2

Plotting support is optional. For matplotlib:

pip install "gpvolve-v2[plot]"

Optional simulation backends (SLiM, tskit):

pip install "gpvolve-v2[sim]"

Python 3.11+. Prebuilt wheels ship for Linux (x86_64, aarch64), macOS (x86_64, aarch64), and Windows (x64).

Status

Pre-release. See CHANGELOG.md for progress and docs/migration/from-v1.md for the v1 to v2 API map.

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

gpvolve_v2-1.2.0.tar.gz (52.1 kB view details)

Uploaded Source

Built Distributions

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

gpvolve_v2-1.2.0-cp311-abi3-win_amd64.whl (260.4 kB view details)

Uploaded CPython 3.11+Windows x86-64

gpvolve_v2-1.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (432.6 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

gpvolve_v2-1.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (424.1 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

gpvolve_v2-1.2.0-cp311-abi3-macosx_11_0_arm64.whl (376.8 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

gpvolve_v2-1.2.0-cp311-abi3-macosx_10_12_x86_64.whl (381.9 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file gpvolve_v2-1.2.0.tar.gz.

File metadata

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

File hashes

Hashes for gpvolve_v2-1.2.0.tar.gz
Algorithm Hash digest
SHA256 1dddf7bdbc3d0974a187267a085c383530fc58b9de81cc3a008e27df188bb266
MD5 ecf6bb0e2a6588f1d93b9f7cb65d2f9e
BLAKE2b-256 557cc15c1eecc74af60b5384cc8751d8c7a89c28cafd364e0098ec5d044c7459

See more details on using hashes here.

File details

Details for the file gpvolve_v2-1.2.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: gpvolve_v2-1.2.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 260.4 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gpvolve_v2-1.2.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5de4fdd869d4b29bab7750694ce4da453716a823a8cba51e0b2b50508f78cb07
MD5 5b148de3d96d22caadb0ca2c968f6213
BLAKE2b-256 b87442dfbb421e1f2ab6df907a644df410a6d9986784e877d95cbac06bf231c8

See more details on using hashes here.

File details

Details for the file gpvolve_v2-1.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for gpvolve_v2-1.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 274f518131952d52b33c871077c7520e3d112f28281797ee911090f0134da3e4
MD5 d0f042cd6352c0877271656debad420e
BLAKE2b-256 bf66a1e3379f660af9ae38e0ce45e227793888b5ad53b296c7239febd946b228

See more details on using hashes here.

File details

Details for the file gpvolve_v2-1.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for gpvolve_v2-1.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 78a43df1ce4b5279440dede3069775b26e16342a5d4b9399b1917e0b43a00f9a
MD5 89c7cfacba9be339bb98c4fdc44a06ce
BLAKE2b-256 32410d7aacaa7c4dd379c9d9604ae78689ca086efa66578863bc8b121c662020

See more details on using hashes here.

File details

Details for the file gpvolve_v2-1.2.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gpvolve_v2-1.2.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b26eb06ad9c565f8828edef40f3cb82f300e7b8ff7539c7b1832c047ca111a5
MD5 998a2e7a210532e9aa510311e4fcff9d
BLAKE2b-256 b0376c63953e742afce49db7c38e042297f97da3147a956a02377a0205cc0117

See more details on using hashes here.

File details

Details for the file gpvolve_v2-1.2.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for gpvolve_v2-1.2.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a41c190113e72ea9897997d0384f555c4d22183d8748784ed627d74d0c7122e2
MD5 0ecd594484a384e5b28fcb0e11319a7f
BLAKE2b-256 63f69512c25e267a5b8adf42f2d4cd01d2266de11d9f662753cfeffcc1511544

See more details on using hashes here.

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