From d14d17c500792ad7540bac82eb946b3054098e1c Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Mon, 2 Feb 2026 14:15:28 +0100 Subject: [PATCH] Make sure warnings are treated as errors in CI --- python/metatomic_torch/metatomic/torch/ase_calculator.py | 5 +++++ python/metatomic_torch/pyproject.toml | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/python/metatomic_torch/metatomic/torch/ase_calculator.py b/python/metatomic_torch/metatomic/torch/ase_calculator.py index 2548834d..4deedab1 100644 --- a/python/metatomic_torch/metatomic/torch/ase_calculator.py +++ b/python/metatomic_torch/metatomic/torch/ase_calculator.py @@ -1401,6 +1401,10 @@ def _get_group_operations( "`pip install spglib` or `conda install -c conda-forge spglib`" ) from e + if not (atoms.pbc.all()): + # No periodic boundary conditions: no symmetry + return [], [] + # Lattice with column vectors a1,a2,a3 (spglib expects (cell, frac, Z)) A = atoms.cell.array.T # (3,3) frac = atoms.get_scaled_positions() # (N,3) in [0,1) @@ -1411,6 +1415,7 @@ def _get_group_operations( (atoms.cell.array, frac, numbers), symprec=symprec, angle_tolerance=angle_tolerance, + _throw=True, ) if data is None: diff --git a/python/metatomic_torch/pyproject.toml b/python/metatomic_torch/pyproject.toml index fff4c010..6f7de23b 100644 --- a/python/metatomic_torch/pyproject.toml +++ b/python/metatomic_torch/pyproject.toml @@ -56,3 +56,9 @@ namespaces = true [tool.pytest.ini_options] python_files = ["*.py"] testpaths = ["tests"] +filterwarnings = [ + "error", + "ignore:`torch.jit.script` is deprecated. Please switch to `torch.compile` or `torch.export`:DeprecationWarning", + "ignore:`torch.jit.save` is deprecated. Please switch to `torch.export`:DeprecationWarning", + "ignore:`torch.jit.load` is deprecated. Please switch to `torch.export`:DeprecationWarning", +]