Skip to content

fix: restore legacy MACE imports with ASE 3.28 - #21

Merged
tdpham2 merged 1 commit into
mainfrom
fix/mace-ase-import-compat
Sep 8, 2026
Merged

fix: restore legacy MACE imports with ASE 3.28#21
tdpham2 merged 1 commit into
mainfrom
fix/mace-ase-import-compat

Conversation

@tdpham2

@tdpham2 tdpham2 commented Sep 7, 2026

Copy link
Copy Markdown
Owner

ASE 3.28 no longer exports ExpCellFilter from ase.constraints, causing the legacy MACE optimizer import to fail and matkit.mlip to omit run_opt_mace.

Prefer ase.filters.ExpCellFilter with a fallback to ase.constraints for older ASE releases. This restores the legacy Python and CLI entry points while retaining the existing filter, optimization settings, optional dependency behavior, and ase>=3.22 requirement.

Add seven isolated regression cases covering both ASE import layouts, missing MACE, all three optimization modes, and successful CLI output. Optimization tests use ASE's CPU EMT calculator through a stub MACE factory; they require no model downloads or GPU dependencies. Record the fix in the changelog.

Validation:

  • Before the fix: five new regression cases failed; the legacy-layout and missing-MACE cases passed.
  • On ASE 3.28.0: PYTHONPATH=src python -m pytest -q tests/test_mlip*.py tests/test_cli.py — 109 passed.
  • Ruff lint and formatting checks passed for the changed Python files.
  • git diff --check passed.

Older ASE import behavior is emulated in tests; real MACE/GPU execution was not exercised.

@tdpham2
tdpham2 merged commit 07a9068 into main Sep 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant