Skip to main content

mdweave

mdweave is an early-stage Python toolkit for reproducible, streaming conversion of molecular-dynamics trajectories into ML-ready structural and temporal features. It delegates trajectory I/O and atom selections to MDAnalysis, then adds stable feature schemas, canonical units, provenance, lazy frame views, and bounded-memory processing.

The initial release is Milestone 1: an MDAnalysis trajectory adapter, lazy slicing, mass-weighted radius of gyration, a metadata-rich result container, tests, and CI.

Installation

python -m pip install -e ".[test]"

Python 3.10+ is supported. Public units are angstrom for distance, picoseconds for time, and (for future angular features) radians.

Quickstart

import mdweave

traj = mdweave.load("trajectory.xtc", topology="protein.pdb")
feature = mdweave.features.RadiusOfGyration(selection="protein")

result = feature.transform(traj)
print(result.values.shape)
print(result.feature_names)
print(result.metadata)

Large trajectories can be consumed in bounded-memory batches:

for batch in feature.transform_stream(traj[100::10], batch_size=1_000):
    train_incrementally(batch.values)

FeatureResult.values works directly with NumPy and scikit-learn. Optional to_dataframe() and to_torch() methods import pandas and PyTorch only on demand.

Why this project?

MDAnalysis and MDTraj already provide excellent trajectory I/O, selection, geometry, and chunk iteration; CPPTRAJ and GROMACS provide extensive high-performance analysis; ProLIF provides chemically informed protein-ligand fingerprints; deeptime provides kinetic estimators. mdweave does not replace them. Its proposed contribution is the missing connective layer: deterministic feature definitions and provenance, consistent frame/time alignment, streaming feature batches, generic temporal transforms, and clean handoff to mainstream Python ML tools. See the landscape and scope.

Development

pytest
ruff check .

The public API is alpha-stage. See the roadmap, contributing guide, and citation metadata.

Releasing

GitHub releases are published to PyPI through Trusted Publishing. Configure the PyPI publisher with workflow filename release.yml and GitHub environment pypi, then publish a GitHub release after updating the version in pyproject.toml.

Release files for mdweave 0.1.0

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

Source distribution (sdist)

Source distribution for mdweave 0.1.0
File Size Uploaded
mdweave-0.1.0.tar.gz 11.3 kB Details

Built distribution (wheel)

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

Total release size: 21.3 kB

Release files / mdweave-0.1.0.tar.gz

Download URL mdweave-0.1.0.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
de18239f3c565e82377da6c400cc0855eb43fd077a5fb0840846adc508ad8044
BLAKE2b-256 checksum
How to use checksums
ddf506e278cf7e7b01c8451f4b655d4767bcff695d3a7b0d02ac846d6dc793ec
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 Aug 25, 2026.

Transparency log

Release files / mdweave-0.1.0-py3-none-any.whl

Download URL mdweave-0.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
147983400e5e1bd4b916cf3a0e94f1d9744f1d43302f0eb5456211e8becc4233
BLAKE2b-256 checksum
How to use checksums
908b83af0875939cd4141f092384613d920a05db4f8cff395fd5bd9f918e9b7e
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 Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 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