You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`prep/`| System preparation |`fix_pdb`, `strip_solvent`, `run_propka`, ligand tools |
@@ -105,6 +106,16 @@ Tests live in `tests/analysis/`, `tests/plots/`, and `tests/chem/`, mirroring th
105
106
1. If visual output makes sense, add `plot_*` in `src/mdpp/plots/` and export it.
106
107
1. Write tests in `tests/analysis/`.
107
108
109
+
## Adding a New Compute Backend
110
+
111
+
For existing multi-backend functions (e.g. `compute_rmsd_matrix`, pairwise distances):
112
+
113
+
1. Add the implementation in the matching `src/mdpp/analysis/_backends/_<kind>.py` file, matching the existing signature.
114
+
1. Use `require_torch()` / `require_jax()` / `require_cupy()` from `_backends/_imports.py` for optional GPU libraries -- never import them at module top-level.
115
+
1. Register in the module's `BackendRegistry` at the bottom of the file.
116
+
1. Add the backend name to the corresponding `Literal` alias (`DistanceBackend` / `RMSDBackend`) in `_backends/_registry.py`.
117
+
1. Add agreement tests in `tests/analysis/test_<kind>.py` guarded by the relevant `requires_*` skip marker.
-**Pluggable compute backends** — pairwise distances and RMSD matrix ship with `mdtraj` / `numba` / `torch` / `jax` / `cupy` backends; switch via `backend=` (50x+ speedup on multi-core CPU or GPU, no PBC on non-mdtraj backends)
0 commit comments