Skip to content

Add example MP-compatible phase diagram tutorial #1159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 4, 2025

Conversation

esoteric-ephemera
Copy link
Collaborator

@esoteric-ephemera esoteric-ephemera commented Mar 28, 2025

It came up during the CECAM atomate2 workshop that it would be useful to have an example of how to perform MP-compatible workflow calcs, including how to apply corrections to these.

This adds a notebook to the tutorials on how to do this and a reference set of task docs. To handle the larger amount of raw VASP data used, I've added a VaspTestData class to atomate2.utils.testing.vasp which takes an input calculation directory and handles creation of a compressed JSON archive of the files for better organization / data usage

  • I also tested using HDF5 and parquet to compress VASP test data, but the header / metadata fields take up a lot of space in these formats

Also added a utility function for extracting job UUID : name mappings from generic flows with replacements/etc. Can remove if requested, it's been useful for analyzing tests with complex flows when run locally.

Other changes:

@@ -15,7 +15,14 @@
from pymatgen.util.coord import find_in_coord_list_pbc

import atomate2.vasp.jobs.base
import atomate2.vasp.jobs.defect

try:
Copy link
Member

Choose a reason for hiding this comment

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

Thanks. Should have fixed this a long time ago..

@@ -2,6 +2,7 @@
from jobflow import run_locally
from monty.serialization import loadfn

from atomate2.common.utils import get_job_uuid_name_map
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rather in utils.testing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good - moved / made a common testing utils file

@JaGeo
Copy link
Member

JaGeo commented Mar 28, 2025

@esoteric-ephemera that's great. Thanks.
The idea behind the test data was to ensure that the tutorials will not break in the future which happens quite frequently otherwise. But I get the point with the large files ...

@esoteric-ephemera
Copy link
Collaborator Author

esoteric-ephemera commented Mar 28, 2025

That makes sense, I'll see if it's possible to trim the new test data down sufficiently

@esoteric-ephemera
Copy link
Collaborator Author

@JaGeo , @utf : I got the test data for this down to about 10MB so I'm adding it here. I also added convenience classes to make json-format archives of VASP calculations (atomate2.utils.testing.vasp.VaspTestData) that interface with mock_vasp

So from the user's side, to make VASP test data archive, they have to run two lines of code:

from atomate2.utils.testing.vasp import VaspTestData

vtd = VaspTestData.from_directory("calculation directory")
vtd.to_file("name of the json.gz or json.bz2 file")

mock_vasp now checks for an archived test data format and appropriately unpacks it. The new classes handle making the directory structure, removing POTCAR info, etc.

Hoping this helps with file bloat / size as we grow tests out. If you want me to re-/move this, just let me know

@JaGeo
Copy link
Member

JaGeo commented Apr 4, 2025

Great @esoteric-ephemera . I like it. I am fine with leaving it.
Can you maybe add this way to generate test data in the documentation as well?

@JaGeo
Copy link
Member

JaGeo commented Apr 4, 2025

Thank you for the great work. I will merge!

@JaGeo JaGeo enabled auto-merge (squash) April 4, 2025 21:50
@JaGeo JaGeo merged commit 5a01ccc into materialsproject:main Apr 4, 2025
21 checks passed
@esoteric-ephemera esoteric-ephemera deleted the mp_ex branch June 4, 2025 15:58
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.

2 participants