PhyNetPy
PhyNetPy is a Python library for phylogenetic network inference and analysis. It provides improved implementations of methods from PhyloNet, plus a framework for building new Bayesian and simulation-based methods.
This repository is the Rust-core build of PhyNetPy, published on PyPI as
phynetpy-rs. The Python package it installs is still named phynetpy
and has the same classes, functions and module layout as the pure-Python
PhyNetPy 0.7.0; underneath, the
graph structures, parsers, likelihood kernels, simulators and search operators
run in the compiled extension phynetpy._core. Existing scripts work
unchanged. Because both distributions provide the phynetpy package, install
one or the other in a given environment, not both.
Install
pip install phynetpy-rs
Wheels are published for Python 3.9 and later (one abi3 wheel per platform
for Linux x86_64/aarch64, macOS Intel/Apple Silicon and Windows x64).
Installing from source needs a Rust toolchain (rustup), after which
pip install .
builds the extension with maturin.
Quick start
from phynetpy.infer import infer, score
from phynetpy.data import GeneTrees
from phynetpy.models import MSC
from phynetpy.criteria import MDC, Likelihood, PseudoLikelihood, Bayesian
gts = GeneTrees.from_file("gene_trees.nex", {"A": ["A1", "A2"], "B": ["B1"]})
result = infer(gts, model=MSC(), criterion=PseudoLikelihood())
print(result.best, result.score)
log_lik = score(result.best, gts, model=MSC(), criterion=Likelihood())
See README.upstream.md for the full method table, the three-axis design of
infer and score, and the DIMPLE pipeline. Nothing about that surface
changed in the port.
Layout
| Path | What it holds |
|---|---|
python/phynetpy/ |
The phynetpy package: the public API, thin wrappers over the core. |
src/ |
The Rust crate behind phynetpy._core. |
src/graph/ |
Node, Edge, Network, transactions, graph algorithms, Newick parsing. |
tests/ |
Test suite (pytest; -m "not slow" skips long MCMC recovery runs). |
examples/ |
Runnable end-to-end workflows. |
Guides/ |
Installation, I/O, and validation guides. |
Development
python -m venv .venv && . .venv/bin/activate
pip install maturin pytest scipy numpy matplotlib networkx biopython python-nexus pulp
maturin develop # build the extension into the venv (add --release for speed)
python -m pytest -m "not slow"
The version lives in python/phynetpy/_version.py and Cargo.toml; keep the
two in step. docs/PORTING.md describes how the Rust core and the Python
facades fit together.
Releasing
CI (.github/workflows/release.yml) builds wheels for Linux (x86_64,
aarch64), macOS (Intel, Apple Silicon) and Windows (x64) plus an sdist on
every push, and runs the test suite against each wheel. Pushing a version
tag publishes those artifacts to PyPI as phynetpy-rs through trusted
publishing:
git tag v0.8.0
git push origin v0.8.0
Metadata
Release files for phynetpy-rs 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| phynetpy_rs-0.8.0.tar.gz | 2.6 MB | Without provenance | Details for phynetpy_rs-0.8.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| phynetpy_rs-0.8.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details for phynetpy_rs-0.8.0-cp39-abi3-win_amd64.whl |
| phynetpy_rs-0.8.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details for phynetpy_rs-0.8.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| phynetpy_rs-0.8.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details for phynetpy_rs-0.8.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| phynetpy_rs-0.8.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details for phynetpy_rs-0.8.0-cp39-abi3-macosx_11_0_arm64.whl |
| phynetpy_rs-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details for phynetpy_rs-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl |
Total release size: 16.2 MB
Release files / phynetpy_rs-0.8.0.tar.gz
| Download URL | phynetpy_rs-0.8.0.tar.gz |
|---|---|
| Size | 2.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27aee02f291805a2975e456d15c9a9ed7c1fe166bd3ba8c373e95078703ae978
|
|
BLAKE2b-256 checksum How to use checksums |
79dacd62f08241f5eff43f5036d8853e820bfd948b6aac6c6e4739f1f7da8f80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / phynetpy_rs-0.8.0-cp39-abi3-win_amd64.whl
| Download URL | phynetpy_rs-0.8.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e85071c207aff7ed1bb112f4ff0ffb3d8513ff68b8026e76a1123418135e51d3
|
|
BLAKE2b-256 checksum How to use checksums |
8e43298aa3536b4d2aa480c082fb2e83ad86952825b082ae672c16ba3d034535
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / phynetpy_rs-0.8.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | phynetpy_rs-0.8.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
71b533f5e64eef65a666a95fa343061616b6b48d5a9d8384b19fbeb982cf3918
|
|
BLAKE2b-256 checksum How to use checksums |
c92a1c220e87b334edaed826f5ef2a455f01f6354a98404dcb6f7d9ba508c131
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / phynetpy_rs-0.8.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | phynetpy_rs-0.8.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4acae983596c5da6edbdb3fda88a173abbe29ee96547b3fe63f0fc0ad100908c
|
|
BLAKE2b-256 checksum How to use checksums |
ef69a40bbf0879bb994761b207ca2babcd02c156656f31cb56a6aaae4835d246
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / phynetpy_rs-0.8.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | phynetpy_rs-0.8.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
31a3a24b286212b8372d50a71ede9ea6fe4076b668720e4a35394309da300d0e
|
|
BLAKE2b-256 checksum How to use checksums |
19fcb5544838af8a92429e3b4a108dcfda7be62523d6ff1a13c21c5a120d2e31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / phynetpy_rs-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | phynetpy_rs-0.8.0-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
5ee05d62f67a554c29dc98b0f89b79a650cb9cc248d139ee76df2103270e7395
|
|
BLAKE2b-256 checksum How to use checksums |
0d4c3a7eedfa248de0954cd462aa46260fb11ccb8be9f0242bc6bcfea102ee61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for phynetpy-rs 0.8.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.