Skip to content

Conversation

@tawe141
Copy link

@tawe141 tawe141 commented Dec 3, 2025

Summary

Setting relax_maker=None in MagneticOrderingsMaker should make it so the Flow only runs static calculations, but this originally fails because structure isn't defined if relax_maker=None. I've fixed this and tried adding to the test case, but it fails with a mysterious error I can't pin down (see below).

TODO (if any)

Test case currently fails with the following error:

ValueError: Could not resolve reference - 19bed1a4-6a26-482c-8eae-f855983b35cb not in store or index=None, cache={'19bed1a4-6a26-482c-8eae-f855983b35cb': {}} 

I think this arises because something wrong happened with the fake static calculation. This is what appears alongside this error:

INFO jobflow.core.job:job.py:586 Starting job - static 2/3 (afm) (19bed1a4-6a26-482c-8eae-f855983b35cb) INFO atomate2.vasp.files:files.py:202 Writing VASP input set. INFO atomate2:vasp.py:167 Running fake VASP. INFO jobflow.managers.local:local.py:121 static 2/3 (afm) failed with exception: Traceback (most recent call last): File "/home/gridsan/ER32640/.conda/envs/atomate/lib/python3.11/site-packages/jobflow/managers/local.py", line 117, in _run_job response = job.run(store=store) ^^^^^^^^^^^^^^^^^^^^ File "/home/gridsan/ER32640/.conda/envs/atomate/lib/python3.11/site-packages/jobflow/core/job.py", line 604, in run response = function(*self.function_args, **self.function_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data2/groups/MBD_shared/eric/atomate2/src/atomate2/vasp/jobs/base.py", line 263, in make run_vasp(**self.run_vasp_kwargs) File "/data2/groups/MBD_shared/eric/atomate2/src/atomate2/utils/testing/vasp.py", line 110, in mock_run_vasp fake_run_vasp(ref_path, **_FAKE_RUN_VASP_KWARGS.get(name, {})) File "/data2/groups/MBD_shared/eric/atomate2/src/atomate2/utils/testing/vasp.py", line 183, in fake_run_vasp _check_poscar(ref_path) File "/data2/groups/MBD_shared/eric/atomate2/src/atomate2/utils/testing/vasp.py", line 295, in _check_poscar raise ValueError( ValueError: POSCAR files are inconsistent on site(s) 7, 10, 11, 12 /data2/groups/MBD_shared/eric/atomate2/tests/test_data/vasp/MgMn2O4_magnetic/static_2_3_(afm)/inputs/POSCAR.gz Mg2 Mn4 O8 1.0 -1.4013627584047403 4.8863814616147661 -2.6690096428701415 -0.0069000597693647 -0.0091579237479205 6.1628646215114546 5.0833568514662772 -0.0002027328146935 -2.6690078035749418 Mg Mn O 2 4 8 direct 0.6250046392730044 0.7499993302874581 0.3749946584820302 Mg 0.3749953607269955 0.2500006697125421 0.6250053415179697 Mg 0.5000000000000000 -0.0000000000000000 0.0000000000000000 Mn -0.0000000000000000 -0.0000000000000000 0.0000000000000000 Mn -0.0000000000000000 0.5000000000000000 0.0000000000000000 Mn -0.0000000000000000 0.5000000000000000 0.5000000000000000 Mn 0.7780112445054692 0.5089096009337630 0.7544642856563863 O 0.2455072748279359 0.9910362520651074 0.7691151397739133 O 0.2455355743036234 0.9910903117108990 0.2219884378819191 O 0.2219887554945306 0.4910903990662371 0.2455357143436137 O 0.7691149643992734 0.4910363370673025 0.2455072946161888 O 0.7544927251720641 0.0089637479348926 0.2308848602260867 O 0.2308850356007265 0.5089636629326975 0.7544927053838113 O 0.7544644256963766 0.0089096882891011 0.7780115621180809 O POSCAR Mg2 Mn4 O8 1.0 -1.3970423400000000 4.8724991099999997 -2.6611020299999999 0.0098609100000000 0.0130852800000000 6.1764935899999998 5.0688234300000001 0.0001248800000000 -2.6611016699999999 Mg Mn O 2 4 8 direct 0.6251027400000000 0.7500000200000000 0.3748972600000000 Mg 0.3748972600000000 0.2499999800000000 0.6251027400000001 Mg 0.0000000000000000 0.5000000000000000 0.0000000000000000 Mn 0.5000000000000000 0.0000000000000000 0.0000000000000000 Mn 0.0000000000000000 0.5000000000000000 0.5000000000000001 Mn 0.0000000000000000 0.0000000000000000 0.0000000000000000 Mn 0.7782675000000000 0.5080588200000000 0.7540230900000000 O 0.2459477900000000 0.9919131600000000 0.7702028500000001 O 0.2459768900000000 0.9919411600000000 0.2217325400000000 O 0.2217325000000000 0.4919411800000000 0.2459769100000000 O 0.7702028800000001 0.4919131300000000 0.2459476500000000 O 0.7540522100000001 0.0080868400000000 0.2297971500000000 O 0.2297971200000000 0.5080868700000000 0.7540523500000001 O 0.7540231100000000 0.0080588400000000 0.7782674600000002 O 

The atomic positions and lattice parameters are very slightly different, which might be why this error gets thrown. Will look into this later.

Checklist

Work-in-progress pull requests are encouraged, but please put [WIP] in the pull request
title.

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

  • 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.
  • Doc strings have been added in the Numpy docstring format.
    Run ruff on your code.
  • Type annotations are highly encouraged. Run mypy to
    type check your code.
  • 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.

"static 3/3 (afm)": {"incar_settings": ["NSW", "ISMEAR"]},
}

mock_vasp(ref_paths, fake_run_vasp_kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might have the issue with POSCAR because the tests include test data for relaxations - if set_relax_maker_to_none is True, then the test data for the relaxes shouldn't be there (I think, just a hunch)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I checked the structures, and it's because the AFM generated structures in the test data are rotations of the original structure. I think not relaxing the structure causes the flow to retain exactly the same structure, so even if I use the relaxed structures as a reference, the check_poscar step will still fail. What do you think should be the next step?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd need to generate new test data with relax_maker = None unfortunately. Simply because the static data that is in the repo already has been relaxed, so it will necessarily differ from the starting structure

If that's something you need help with, let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants