micromamba env create -f environment.yaml -n fes-ml-dev
micromamba activate fes-ml-dev
pip install -e ".[dev,docs]"
pre-commit installA CUDA build of OpenMM and PyTorch is recommended: the integration tests evaluate full systems on the GPU (CUDA, double precision) and fall back to the much slower Reference platform without one.
pre-commit run --all-files # ruff, ruff-format, mypy
pytest tests/unit # ~15 s, OpenMM only
pytest tests # ~20 min on one RTX 3090
pytest -m "not slow" # skip the full-system tests
mkdocs serve # docs at http://127.0.0.1:8000Tests that need optional packages (requires_sire, requires_openff, requires_ml,
requires_emle) are skipped when those packages are missing. CI also installs only the core
dependencies and checks that import fes_ml and the unit tests work without them.
Every expected value comes from an independent source: closed-form energies, plain OpenMM on the
unmodified system with parameters edited by hand, Sire's own system, or openmmml. The reference
code lives in tests/reference/oracle.py and does not import fes-ml. When a test fails, either
fes-ml or the reference is wrong, and the reference is short enough to check by hand. See
tests/README.md.
The one exception is tests/test_alchemical_states.py, the original tests, which compare with
energies stored from an older fes-ml and Sire. Do not regenerate those values to make a change
pass: a difference there needs an explanation (a bug fix or an upstream change).
A change that is not a bug fix must not change any energy. A bug fix comes with a test that fails
without it, and an entry in CHANGELOG.md.
- Subclass
BaseModification, setNAME,phase,requires_lambda, and the dependencies (pre_dependencies,post_dependencies,excludes); implementapply. - Declare the strategy data it needs in
inputs, and its global parameter inLAMBDA_PARAMETERif its λ can live in one. - Register it as an entry point in
pyproject.tomlunderalchemical.modifications, pointing to the class, and reinstall (pip install -e .). - Add tests against an independent reference, including at least one with two groups.
- Document it in
docs/guide/schedules.mdanddocs/api/modifications.md.
The extension guide has a complete example.
- One topic per pull request; one commit per bug fix, so each can be reverted alone.
- Update
CHANGELOG.md(Keep a Changelog format) under "Unreleased". - Docstrings use the numpy style;
mkdocs build --strictmust pass.