atomate2 icon indicating copy to clipboard operation
atomate2 copied to clipboard

Readd aims magnetism test

Open tpurcell90 opened this issue 10 months ago • 3 comments

Summary

The aims magnetism test should now work.

Checklist

Before a pull request can be merged, the following items must be checked:

  • [x] Code is in the standard Python style. The easiest way to handle this is to run the following in the correct sequence on your local machine. Start with running ruff and ruff format on your new code. This will automatically reformat your code to PEP8 conventions and fix many linting issues.
  • [x] Doc strings have been added in the Numpy docstring format. Run ruff on your code.
  • [x] Type annotations are highly encouraged. Run mypy to type check your code.
  • [x] Tests have been added for any new functionality or bug fixes.
  • [ ] All linting and tests pass.

Note that the CI system will run all the above checks. But it will be much more efficient if you already fix most errors prior to submitting the PR. It is highly recommended that you use the pre-commit hook provided in the repository. Simply run pre-commit install and a check will be run prior to allowing commits.

tpurcell90 avatar Mar 10 '25 17:03 tpurcell90

This can merge in once the pymatgen update is possible

tpurcell90 avatar Mar 10 '25 19:03 tpurcell90

Yeah. Should hopefully be possible soon. OpenMM tests behave weird again. Will try to fix them and then see....

JaGeo avatar Mar 10 '25 19:03 JaGeo

No rush, I was just checking to see if that was the fail point on here since the test pass locally.

tpurcell90 avatar Mar 10 '25 19:03 tpurcell90

@tpurcell90 I'm seeing that some of the magnetic moments are None when running the AIMS magnetism test - any ideas if this is an issue on pymatgen's side for the AIMS input set?

esoteric-ephemera avatar Aug 12 '25 16:08 esoteric-ephemera

Let me check what is going on here later today

tpurcell90 avatar Aug 12 '25 16:08 tpurcell90

This looks to be on the pymatgen side. I will fix this once: https://github.com/materialsproject/pymatgen/pull/4260 gets merged in

tpurcell90 avatar Aug 13 '25 15:08 tpurcell90

Great thanks!

esoteric-ephemera avatar Aug 13 '25 17:08 esoteric-ephemera

This should now work if the latest pymatgen and pymatgen-io-aims are installed. Should I add the new aims extra to strict as well?

tpurcell90 avatar Aug 19 '25 15:08 tpurcell90

Good question - given the precedent with abinit and amset, I don't think you need to put them in strict unless there's a conflict with the most recent version of another package like pymatgen

esoteric-ephemera avatar Aug 20 '25 15:08 esoteric-ephemera

At this point I think it works with the master version of pymatgen with the aims plug in locally, so I can confirm once that is pip accessible

tpurcell90 avatar Aug 20 '25 16:08 tpurcell90

Great thanks! I'll bump the pymatgen dependence once it's released and merge if all the tests pass

esoteric-ephemera avatar Aug 20 '25 18:08 esoteric-ephemera

@tpurcell90 : after the latest pymatgen release + migrating an import to pyfhiaims, some of the tests are failing. Locally, I see:

FAILED tests/aims/test_makers/test_gw.py::test_gw_maker_molecule - assert -4092.12667244759 == -4092.0702534 ± 0.00409207 FAILED tests/aims/test_flows/test_elastic.py::test_elastic[False] - AssertionError: FAILED tests/aims/test_flows/test_elastic.py::test_elastic[True] - AssertionError: FAILED tests/aims/test_flows/test_anharmonic_quantification.py::test_site_resolved_anharmonic_quantification - AssertionError: assert ('a', 0.076) in [('a', 13.668), ('b', 5.813)] FAILED tests/aims/test_flows/test_anharmonic_quantification.py::test_element_resolved_anharmonic_quantification - AssertionError: assert ('Na', 0.076) in [('Na', 13.668), ('Cl', 5.813)]

Any idea about how best to fix these?

esoteric-ephemera avatar Oct 07 '25 19:10 esoteric-ephemera

I'll fix these either later today or tomorrow and update you. Thanks for the heads up on it!

tpurcell90 avatar Oct 07 '25 19:10 tpurcell90

All of the tests pass on my machine will check here as well

FAILED tests/aims/test_flows/test_anharmonic_quantification.py::test_site_resolved_anharmonic_quantification - AssertionError: assert ('a', 0.076) in [('a', 13.668), ('b', 5.813)]
FAILED tests/aims/test_flows/test_anharmonic_quantification.py::test_element_resolved_anharmonic_quantification - AssertionError: assert ('Na', 0.076) in [('Na', 13.668), ('Cl', 5.813)]

This is likely a mapping issue what is your environment?

tpurcell90 avatar Oct 16 '25 23:10 tpurcell90

They seem to be failing because of this conflict

╰─▶ Because atomate2==0.0.1 depends on pymatgen>=2024.11.13,<2025.10.7 and

What blocks the use of 2025.10.7?

tpurcell90 avatar Oct 16 '25 23:10 tpurcell90

What blocks the use of 2025.10.7?

You can and should unpin it here - I had to temporarily pin to ensure the CI tests were passing before this PR gets merged

esoteric-ephemera avatar Oct 17 '25 00:10 esoteric-ephemera

@esoteric-ephemera Can you confirm that the anharmonicity quantification tests also pass for you locally?

If they don't would it be possible for you to send me the super cells you are getting so I can work out what the supercell mapping error is?

tpurcell90 avatar Oct 17 '25 00:10 tpurcell90

@tpurcell90 sorry I missed this! Tests look to be passing on my side and CI now, many thanks for your work on this!!

esoteric-ephemera avatar Oct 24 '25 17:10 esoteric-ephemera