From 079111c5d9dff75f467588a42329d86dee52a470 Mon Sep 17 00:00:00 2001 From: Alejandro Acosta <127198532+aacostadiaz@users.noreply.github.com> Date: Tue, 6 Oct 2026 11:57:54 +0100 Subject: [PATCH 1/2] Install graph_longrange from PyPI graph_longrange 0.4.4 is now published on PyPI and its wheel is file for file identical to the commit requirements/polar.txt pinned. CI installs the exact release, and a new polar extra gives users pip install mace-torch[polar]. --- mace/modules/extensions.py | 8 ++++---- pyproject.toml | 2 +- requirements/polar.txt | 9 +++++---- setup.cfg | 1 + 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/mace/modules/extensions.py b/mace/modules/extensions.py index 1d9cc4f98..939d62343 100644 --- a/mace/modules/extensions.py +++ b/mace/modules/extensions.py @@ -690,8 +690,8 @@ def __init__( ): if not GRAPH_LONGRANGE_AVAILABLE: raise ImportError( - "Cannot import 'graph_longrange'. Please install graph_electrostatics " - "from https://github.com/WillBaldwin0/graph_electrostatics." + "Cannot import 'graph_longrange'. Install it with " + "`pip install mace-torch[polar]`." ) try: hidden_irreps: o3.Irreps = kwargs["hidden_irreps"] @@ -991,8 +991,8 @@ def forward( ) -> Dict[str, Optional[torch.Tensor]]: if not GRAPH_LONGRANGE_AVAILABLE: raise ImportError( - "Cannot import 'graph_longrange'. Please install graph_electrostatics " - "from https://github.com/WillBaldwin0/graph_electrostatics." + "Cannot import 'graph_longrange'. Install it with " + "`pip install mace-torch[polar]`." ) ctx = prepare_graph( data, diff --git a/pyproject.toml b/pyproject.toml index 6e5ba93b0..e5b6fbe0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ markers = [ "network: downloads from the internet (foundation models); opt-in via MACE_CI_ALLOW_NETWORK=1", "cueq: requires cuEquivariance (its GPU kernels are NVIDIA-only)", "oeq: requires OpenEquivariance (JIT kernels for CUDA or HIP)", - "polar: requires graph_electrostatics (import name graph_longrange)", + "polar: requires graph_longrange", "les: requires the LES library", "magnetic: requires sphericart-torch (import name sphericart)", "torchsim: requires torch-sim-atomistic (python >= 3.12)", diff --git a/requirements/polar.txt b/requirements/polar.txt index ae9036010..228ff8431 100644 --- a/requirements/polar.txt +++ b/requirements/polar.txt @@ -1,4 +1,5 @@ -# External dependency of the polar extension (import name: graph_longrange). -# Pinned by commit: an unpinned git dependency can break CI on its own. -# To bump: update the SHA and run the polar jobs (ci-extensions.yaml). -git+https://github.com/WillBaldwin0/graph_electrostatics.git@6a86de5e3ed35fd86a55fc046aa085fe48a72764 +# External dependency of the polar extension, from PyPI. +# Pinned exactly so a new release cannot break CI on its own; setup.cfg's +# `polar` extra carries the range users get. +# To bump: update the version here and run the polar jobs (ci-extensions.yaml). +graph_longrange==0.4.4 diff --git a/setup.cfg b/setup.cfg index da9b7bdd6..571062a58 100644 --- a/setup.cfg +++ b/setup.cfg @@ -77,6 +77,7 @@ dev = pytest-xdist pylint==4.0.6 schedulefree = schedulefree +polar = graph_longrange>=0.4.4,<0.5 magnetic = sphericart-torch>=2.0 torch-geometric From 4784cf4e16c0e8430e2abef56ad1fecc24edd115 Mon Sep 17 00:00:00 2001 From: Alejandro Acosta <127198532+aacostadiaz@users.noreply.github.com> Date: Tue, 6 Oct 2026 12:21:31 +0100 Subject: [PATCH 2/2] Record the polar extra in the feature inventory --- tests/golden/feature_inventory.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/golden/feature_inventory.md b/tests/golden/feature_inventory.md index 57b322c64..f31563e9b 100644 --- a/tests/golden/feature_inventory.md +++ b/tests/golden/feature_inventory.md @@ -831,7 +831,7 @@ only the bag spells. | `calc.export.mace_omol` | `mace_omol` | `mace/calculators/__init__.py:12` | KEEP — a recent, large, published multi-head model; converts with heads intact | `tests/foundations/test_foundations.py::test_mace_omol_elements_subset_reproduces_energy_forces` | | `calc.export.mace_anicc` | `mace_anicc` | `mace/calculators/__init__.py:12` | DROP — a 2023 organic-chemistry model superseded by MACE-OFF, and the only loader with a divergent signature (`model_path` instead of `model`): an API exception for an obsolete artifact. Its tracked checkpoint `mace/calculators/foundations_models/ani500k_large_CC.model` goes with it; the release notes say "use MACE-OFF" | — | -## 10. Optional-dependency extras (12) +## 10. Optional-dependency extras (13) From `setup.cfg` `[options.extras_require]`. Two facts here feed design decisions rather than packaging: `magnetic` pins **`sphericart-torch`**, a shipped dependency on a non-e3nn @@ -846,6 +846,7 @@ copy — so the tree depends on both at once (§19). | `extra.schedulefree` | `[schedulefree]` | `setup.cfg` | KEEP | `tests/extensions/schedulefree` | | `extra.torchsim` | `[torchsim]` | `setup.cfg` | KEEP — a first-class deployment path, not a secondary integration; the coupling to torch-sim's still-moving API becomes MACE's problem, so the version is pinned in `requirements/` | `tests/extensions/torchsim` | | `extra.magnetic` | `[magnetic]` | `setup.cfg` | KEEP — `sphericart-torch` + `torch-geometric` | `tests/extensions/magnetic` | +| `extra.polar` | `[polar]` | `setup.cfg` | KEEP | `tests/extensions/polar` | | `extra.cueq` | `[cueq]` | `setup.cfg` | KEEP — the backend extra naming is worth revisiting | `tests/golden/test_backend_parity_golden.py::test_the_audits_verdict_tracks_whether_the_fused_ops_are_installed` | | `extra.cueq-cuda-12` | `[cueq-cuda-12]` | `setup.cfg` | KEEP — idem; the ops major must match `torch.version.cuda`, not the newest available, and a CUDA 11 host wants this one | `tests/unit/test_ci_gates.py::test_the_job_reads_the_extras_out_of_setup_cfg` (the `cueq-wheel-extras` PR job resolves each one; this keeps setup.cfg and that job in step) | | `extra.cueq-cuda-13` | `[cueq-cuda-13]` | `setup.cfg` | KEEP — idem; cu13 ops start at cuequivariance 0.7.0 | `tests/unit/test_ci_gates.py::test_the_job_reads_the_extras_out_of_setup_cfg` (the `cueq-wheel-extras` PR job resolves each one; this keeps setup.cfg and that job in step) | @@ -1223,7 +1224,7 @@ file on every run. | 7. Registries | 21 | registry key | | 8. Loss classes | 10 | class name | | 9. Calculator constructor + exports | 27 + 9 | parameter name, `__all__` | -| 10. Optional extras | 12 | extra name | +| 10. Optional extras | 13 | extra name | | 11. Model output keys | 43 | dict key | | 12. Calculator + eval output keys | 31 + 13 | results key, written key | | 13. Environment variables | 9 + 3 | variable name |