Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
tests: import UnitCellFilter from ase.filters, falling back to ase.co…
…nstraints

test_relaxation failed on the Python 3.10 job with

    ImportError: cannot import name 'UnitCellFilter' from 'ase.constraints'

ASE moved UnitCellFilter to ase.filters in 3.23 and has since removed the
alias from ase.constraints. `ase` is unpinned in requirements.txt, so the 3.10
job resolves a recent ASE without it, while the 3.9 job - which recent ASE no
longer supports - still gets a version that has it. That is why only one of
the two jobs failed.

Try the new location first and fall back to the old one, so both ASE
generations keep working. Verified against ase 3.29: ase.filters.UnitCellFilter
resolves and importing it from ase.constraints raises exactly the error above.

This failure is unrelated to the cutoff change in this branch; it only became
visible once the maxvolpy fix in 3bfa4df let the suite be collected at all.
It is the sole remaining failure - the run before this commit reported
289 passed, 1 failed on 3.10 and a fully green 3.9.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017QbfG2UVKxkeuiz9GtDLo4
  • Loading branch information
yury-lysogorskiy and claude committed Aug 27, 2026
commit d63466faa43481496ee85f1c1530bef91bc23063
6 changes: 5 additions & 1 deletion tests/test_PyACECalculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ def test_fcc_stress():


def test_relaxation():
from ase.constraints import UnitCellFilter
try:
# ASE >= 3.23
from ase.filters import UnitCellFilter
except ImportError:
from ase.constraints import UnitCellFilter
from ase.optimize import QuasiNewton

calc = PyACECalculator(basis_set="tests/Al.pbe.rhocore-v2.ace")
Expand Down
Loading