Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 2.72 KB

CONTRIBUTING.md

File metadata and controls

61 lines (46 loc) · 2.72 KB

Contributing to fes-ml

Development environment

micromamba env create -f environment.yaml -n fes-ml-dev
micromamba activate fes-ml-dev
pip install -e ".[dev,docs]"
pre-commit install

A 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.

Checks

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:8000

Tests 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.

Tests: never test fes-ml against itself

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.

Adding a modification

  1. Subclass BaseModification, set NAME, phase, requires_lambda, and the dependencies (pre_dependencies, post_dependencies, excludes); implement apply.
  2. Declare the strategy data it needs in inputs, and its global parameter in LAMBDA_PARAMETER if its λ can live in one.
  3. Register it as an entry point in pyproject.toml under alchemical.modifications, pointing to the class, and reinstall (pip install -e .).
  4. Add tests against an independent reference, including at least one with two groups.
  5. Document it in docs/guide/schedules.md and docs/api/modifications.md.

The extension guide has a complete example.

Pull requests

  • 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 --strict must pass.