AdaptivePy
Adaptive sampling for molecular dynamics trajectories
Clustering-based and frame-level adaptive policies for MD workflows, including entropy-based MaxEnt VAMPNet and OOD-based TS-DAR seed selection.
Overview
AdaptivePy helps you identify under-sampled or high-uncertainty regions of conformational space and select seed frames for new simulations. It loads per-trajectory feature arrays, optionally clusters frames, applies adaptive policies, and writes reproducible metadata and optional PDB structures.
Most policies select seeds from clusters. MaxEnt VAMPNet (maxent_vampnet) and TS-DAR (ts_dar) are frame-level: they train Torch models on lagged features and select scored frames directly — no clustering required.
Full documentation: https://shuklagroup.github.io/AdaptivePy/
| Input | Feature arrays (.npy / .pkl), optional coordinate trajectories |
| Clustering | KMeans, MiniBatch KMeans, regular-space (optional for frame-level policies) |
| Policies | Least counts, random, FAST, MA-REAP, kNN-AS, MaxEnt VAMPNet, TS-DAR (extensible) |
| Output | Seeds, cluster assignments, model, logs, policy scores, optional PDBs |
Installation
pip install adaptivepy-sampling
For Torch-backed policies such as MaxEnt VAMPNet and TS-DAR:
pip install adaptivepy-sampling[torch]
For development:
git clone https://github.com/shuklagroup/AdaptivePy.git
cd AdaptivePy
pip install -e ".[dev,docs]"
For Torch-backed policy development:
pip install -e ".[dev,docs,torch]"
Quick start
-
Prepare features — one file per trajectory, shape
(n_frames, n_features):features/ ├── traj_0.npy └── traj_1.pkl
-
Configure — edit
examples/config.yaml(or create your own). -
Run:
adaptivepy run examples/config.yaml
See the Getting Started guide for a complete walkthrough.
CLI
adaptivepy run config.yaml # run adaptive sampling
adaptivepy validate config.yaml # validate inputs only
adaptivepy list-policies # list available policies
Python API
from adaptivepy import run_adaptive_sampling
results = run_adaptive_sampling("config.yaml")
Policies
Built-in seed-selection policies:
| Policy | Use case |
|---|---|
least_counts |
Target under-sampled clusters |
random |
Baseline random sampling |
fast |
Goal-directed sampling via feature columns (Zimmerman & Bowman 2015) |
ma_reap |
Multi-agent coordinated sampling with learned CV weights (Kleiman & Shukla 2022) |
knn_as |
k-nearest-neighbors adaptive sampling over cluster representatives (Rovers et al. 2025) |
maxent_vampnet |
Entropy-based frame selection via VAMPNet soft state assignments (Kleiman & Shukla 2023); no clustering (forced for ensemble policy) |
ts_dar |
OOD-score frame selection via TS-DAR hyperspherical embeddings (Liu et al. 2025); no clustering (forced for ensemble policy) |
fast, ma_reap, knn_as, maxent_vampnet, and ts_dar accept extra YAML under policy_params.
MA-REAP requires mapping each trajectory to an agent. Torch-backed policies require the
[torch] install extra (pip install adaptivepy-sampling[torch]). See the
Policies guide and
Configuration.
AdaptivePy also supports opt-in metapolicy ensembles with majority polling or
per-policy seed allocation through the metapolicy YAML block.
Documentation
| Guide | Description |
|---|---|
| Getting Started | First run in minutes |
| Configuration | YAML options and defaults |
| Feature Inputs | File formats and layout |
| Policies | Seed selection strategies |
| API Reference | Module documentation |
Contributors
- Hassan Nadeem
- Diego E. Kleiman
License
MIT. See LICENSE for details.
Metadata
Release files for adaptivepy-sampling 1.0.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 | |
|---|---|---|---|---|
| adaptivepy_sampling-1.0.0.tar.gz | 56.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| adaptivepy_sampling-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 118.8 kB
Release files / adaptivepy_sampling-1.0.0.tar.gz
| Download URL | adaptivepy_sampling-1.0.0.tar.gz |
|---|---|
| Size | 56.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2bbb9d6c99aab5e9f5c41ed5c72ca1c2ea5b22f8c6346b25b3ccbaed7ca5b4f1
|
|
BLAKE2b-256 checksum How to use checksums |
298f9f13f711a3eb7b588fb5436d896d316003fc3ff06efc896872461cd4b33d
|
| 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 Jul 31, 2026.
Transparency logRelease files / adaptivepy_sampling-1.0.0-py3-none-any.whl
| Download URL | adaptivepy_sampling-1.0.0-py3-none-any.whl |
|---|---|
| Size | 62.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
960bde0703b9bebf223cf4c1b1b32d7ab1dca62ad7cfe22ec47ea84809448997
|
|
BLAKE2b-256 checksum How to use checksums |
a4a175370c477d6f2b4f1cf2c1e1fa780435e555bb32c440bfa0aac9ecfb3056
|
| 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 Jul 31, 2026.
Transparency logSecurity for adaptivepy-sampling 1.0.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for adaptivepy_sampling-1.0.0.tar.gz
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 Jul 31, 2026.
Transparency logA 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.