Skip to content

Commit 1044558

Browse files
Readd aims magnetism test (#1137)
* Readd aims magnetism test * Update pymatgen version * Fixes magnetic test if latest pymatgen/pymatgen-io-aims installed * Add FHI-aims dep to testing * add pymatgen dependence to aims * temp emmet core upper pin * add aims to strict * migrate import statement * Fix errors from new pymatgen interface 1) Energy -> Free Energy in FHI-aims for Force Consistent energies 2) up pymatgen-io-aims to account for stress definition differences * modify pyproject to see why there is the conflict * Remove pymatgen <2025.10.7 from pyproject * Add aims dep to another set of tests * bump pymatgen-io-aims version again * Update pyproject to test if errors persist * tweak test tol --------- Co-authored-by: Aaron Kaplan <[email protected]> Co-authored-by: esoteric-ephemera <[email protected]>
1 parent 57e617c commit 1044558

File tree

14 files changed

+18
-23
lines changed

14 files changed

+18
-23
lines changed

.github/workflows/testing.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
python -m pip install --upgrade pip
6767
mkdir -p ~/.abinit/pseudos
6868
cp -r tests/test_data/abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 ~/.abinit/pseudos
69-
uv pip install .[strict,strict-forcefields,tests,abinit,approxneb]
69+
uv pip install .[strict,strict-forcefields,tests,abinit,approxneb,aims]
7070
uv pip install torch-runstats torch_dftd
7171
uv pip install --no-deps nequip==0.5.6
7272
@@ -156,7 +156,7 @@ jobs:
156156
test-notebooks-and-ase:
157157
# prevent this action from running on forks
158158
if: github.repository == 'materialsproject/atomate2'
159-
159+
160160
# It seems like anything torch-dependent and tblite can't be installed in the same environment
161161
# without the tblite tests failing in CI, see, e.g.:
162162
# https://github.com/tblite/tblite/issues/116
@@ -198,7 +198,7 @@ jobs:
198198
run: |
199199
micromamba activate a2
200200
python -m pip install --upgrade pip
201-
uv pip install .[strict,tests]
201+
uv pip install .[strict,tests,aims]
202202
uv pip install tblite>=0.4.0
203203
204204
- name: Install pymatgen from master if triggered by pymatgen repo dispatch
@@ -267,7 +267,7 @@ jobs:
267267
python -m pip install --upgrade pip
268268
mkdir -p ~/.abinit/pseudos
269269
cp -r tests/test_data/abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 ~/.abinit/pseudos
270-
uv pip install .[strict,strict-forcefields,tests,abinit]
270+
uv pip install .[strict,strict-forcefields,tests,abinit,aims]
271271
uv pip install torch-runstats
272272
uv pip install --no-deps nequip==0.5.6
273273

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@ dependencies = [
3434
"numpy",
3535
"pydantic-settings>=2.0.3",
3636
"pydantic>=2.0.1",
37-
"pymatgen>=2024.11.13,<2025.10.7",
37+
"pymatgen>=2024.11.13",
3838
"pymongo<=4.10.1",
3939
]
4040

4141
[project.optional-dependencies]
4242
abinit = ["abipy>=0.9.3"]
43+
aims = ["pymatgen-io-aims>=0.0.5", "pymatgen>=2025.10.7"]
4344
amset = ["amset>=0.4.15", "pydash"]
4445
cclib = ["cclib>=1.8.1"]
4546
mp = ["mp-api>=0.37.5"]
46-
phonons = ["phonopy>=1.10.8", "seekpath>=2.0.0"]
47+
phonons = ["phonopy>=1.10.8,<2.43.3", "seekpath>=2.0.0"] # issue writing CIFs because of bug in phonopy >=2.43.3
4748
lobster = ["ijson>=3.2.2", "lobsterpy>=0.4.0"]
4849
defects = [
4950
"dscribe>=1.2.0",

src/atomate2/aims/jobs/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from jobflow import Response, job
1212
from monty.serialization import dumpfn
13-
from pymatgen.io.aims.parsers import read_aims_output
13+
from pyfhiaims.external_interfaces.ase.io import read_aims_output
1414
from pymatgen.io.aims.sets.bs import BandStructureSetGenerator, GWSetGenerator
1515
from pymatgen.io.aims.sets.core import (
1616
RelaxSetGenerator,

tests/aims/species_dir/light/25_Mn_default

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969
# hydro 5 g 10.8
7070
# hydro 3 s 3.8
7171
# "Third tier" - improvements: -1.38 meV to -0.13 meV
72-
# hydro 5 p 8.6 -1.38 meV
73-
# hydro 6 h 16 -0.73 meV
74-
# hydro 3 d 10.8 -0.43 meV
72+
# hydro 5 p 8.6
73+
# hydro 6 h 16
74+
# hydro 3 d 10.8
7575
# hydro 5 f 6.8 # forced: -0.26 meV
7676
# hydro 5 g 6.4 # forced: -0.21 meV
7777
# hydro 5 s 9.8 # forced: -0.13 meV

tests/aims/test_flows/test_eos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ def test_eos_from_parameters(mock_aims, tmp_path, si, species_dir):
101101
assert len(output["relax"]["energy"]) == 5
102102
# the initial calculation also participates in the fit here
103103
assert output["relax"]["EOS"]["birch_murnaghan"]["b0"] == pytest.approx(
104-
0.5189578108402951,
105-
rel=1e-4,
104+
0.5188838108657945,
105+
rel=1e-3,
106106
)

tests/aims/test_flows/test_magnetism.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515
cwd = os.getcwd()
1616

1717

18-
@pytest.mark.skip(
19-
reason="pymatgen 2024.11.13 broke this test with ValueError: Structure contains "
20-
"magnetic moments on both magmom site properties and spin species properties. This "
21-
"is ambiguous. Remove one or the other."
22-
)
23-
# TODO re-attempt to fix and unskip this test
24-
def test_magnetic_orderings(mock_aims, tmp_path, species_dir, mg2mn4o8):
18+
def test_magnetic_orderings(mock_aims, species_dir, mg2mn4o8):
2519
parameters = {
2620
"k_grid": [2, 2, 2],
2721
"species_dir": (species_dir / "light").as_posix(),
@@ -50,9 +44,9 @@ def test_magnetic_orderings(mock_aims, tmp_path, species_dir, mg2mn4o8):
5044

5145
flow = maker.make(mg2mn4o8)
5246

53-
os.chdir(tmp_path)
47+
# os.chdir(tmp_path)
5448
responses = run_locally(flow, create_folders=True, ensure_success=True)
55-
os.chdir(cwd)
49+
# os.chdir(cwd)
5650

5751
final_output = responses[flow.jobs[-1].uuid][1].output
5852

tests/aims/test_makers/test_gw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ def test_gw_maker_molecule(tmp_dir, species_dir, mock_aims, o2):
3333
# validation the outputs of the job (maybe add gw energy levels as well)
3434
output1 = responses[job.uuid][1].output
3535
assert isinstance(output1, AimsTaskDoc)
36-
assert output1.output.energy == pytest.approx(-4092.0702534)
36+
assert output1.output.energy == pytest.approx(-4092.12667244759)
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)