Development¶
Guide for contributing to AdaptivePy and building documentation locally.
Setup¶
For Torch-backed policy development and tests:
Run tests¶
Build documentation locally¶
Serve with live reload:
Open http://127.0.0.1:8000/AdaptivePy/ in your browser.
Build a static site (same check used in CI):
Output is written to site/.
Documentation structure¶
| Path | Purpose |
|---|---|
docs/*.md |
User guides (edit these for workflow docs) |
docs/reference/*.md |
API reference via mkdocstrings (pulls from code docstrings) |
mkdocs.yml |
Site theme, navigation, and plugin config |
When you update docstrings in adaptivepy/, the API reference pages update
automatically on the next docs build.
Project layout¶
adaptivepy/
├── api.py # Main workflow
├── config/ # YAML schema
├── io/ # Feature and trajectory loading
├── clustering/ # Clustering backends
├── policies/ # Adaptive policies
├── selection/ # Frame-level seed selection
├── stats/ # Cluster statistics
├── output/ # Writers (CSV, PDB, model)
└── cli/ # Command-line interface
Adding a new policy¶
- Create a module in
adaptivepy/policies/ - Subclass
Policyand use@register_policy - Import the module in
adaptivepy/policies/__init__.py - If the policy needs YAML settings, add validation in
adaptivepy/config/schema.pyand extendbuild_policy_kwargs - Add tests and document in Policies
Existing examples with policy_params:
fast— feature indices, directions, weights,alpha; writesscores.csvma_reap— agent-to-trajectory mapping, stakes,delta, regime; writes sidecar CSVs (scores.csv,agent_weights.csv,stakes.csv,executors.csv)maxent_vampnet— VAMPNet training hyperparameters; frame-level entropy selection without clustering; writes per-framescores.csvts_dar— TS-DAR training hyperparameters; frame-level OOD score selection without clustering; writes per-framescores.csv
CI workflows¶
| Workflow | Trigger | Purpose |
|---|---|---|
.github/workflows/docs.yml |
Push to main (docs/code changes) |
Build and deploy GitHub Pages |
.github/workflows/publish.yml |
GitHub Release published | Publish to PyPI |
Release checklist¶
- Update version in
pyproject.tomlandadaptivepy/__init__.py - Run
pytest tests/ -qandmkdocs build --strict - Merge to
main(docs deploy automatically) - Create a GitHub Release to trigger PyPI publish