Skip to content
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

Materials Project GGA and meta-GGA workflows #504

Merged
merged 162 commits into from
Oct 2, 2023
Merged

Materials Project GGA and meta-GGA workflows #504

merged 162 commits into from
Oct 2, 2023

Conversation

janosh
Copy link
Member

@janosh janosh commented Sep 1, 2023

This PR branches off from #362. It implements the future Materials Project PBE and r2SCAN relaxations as 3-step workflows consisting of a double-relaxation followed by a higher-quality static job (all as in #362 so far) but builds these 3 steps out of MP(Meta)GGADoubleRelaxMakers that are exported for standalone use, as well as called inside MP(Meta)GGADoubleRelaxStatic (the main workflows intended for public use).

The difference to #362 is intended to address #362 (comment) and more closely align the MP workflow API with the existing DoubleRelaxMaker in atomate2.vasp.flows.core.


Closes #352. Closes #363. Closes #364.

This has been a team effort with @esoteric-ephemera and @Andrew-S-Rosen. 🙏

Andrew-S-Rosen and others added 30 commits June 2, 2023 12:53
wrong key user_incar_settings -> INCAR

and raises ruamel/yaml/comments.py:881: in update
    self._ok.add(*kw.keys())
E   TypeError: set.add() takes exactly one argument (3 given)
for consistency with MPPreRelaxMaker
…elaxMaker

was passed to __init__, needs to be passed to make()
…ests

just test_MP2023RelaxMaker_default_values() for now
fix bandgap doc str in the wrong place
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #504 (1a6882c) into main (59f47ee) will increase coverage by 0.56%.
Report is 39 commits behind head on main.
The diff coverage is 84.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #504      +/-   ##
==========================================
+ Coverage   75.09%   75.66%   +0.56%     
==========================================
  Files          74       77       +3     
  Lines        6570     6727     +157     
  Branches      952      986      +34     
==========================================
+ Hits         4934     5090     +156     
- Misses       1330     1331       +1     
  Partials      306      306              
Files Coverage Δ
src/atomate2/common/flows/defect.py 81.33% <100.00%> (ø)
src/atomate2/settings.py 100.00% <100.00%> (+4.25%) ⬆️
src/atomate2/vasp/flows/defect.py 77.46% <100.00%> (ø)
src/atomate2/vasp/jobs/base.py 96.55% <100.00%> (ø)
src/atomate2/vasp/jobs/defect.py 100.00% <ø> (ø)
src/atomate2/common/jobs/defect.py 85.71% <0.00%> (ø)
src/atomate2/vasp/run.py 40.98% <0.00%> (ø)
src/atomate2/vasp/sets/core.py 81.59% <0.00%> (ø)
src/atomate2/vasp/flows/core.py 89.51% <83.33%> (-1.09%) ⬇️
src/atomate2/vasp/jobs/mp.py 92.85% <92.85%> (ø)
... and 3 more

... and 6 files with indirect coverage changes

@janosh
Copy link
Member Author

janosh commented Sep 27, 2023

Wow, 1st time ever this PR has had green CI! 🎉 Only took a few months. 😅

vasprun=vasprun,
outcar=outcar,
)
prev_incar = prev_incar if self.inherit_incar else {}
Copy link
Member Author

Choose a reason for hiding this comment

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

@utf To get the tests passing, we needed to disable INCAR inheritance. This PR (2177b0f) adds a new keyword inherit_incar: bool = None to VaspInputGenerator which disables INCAR inheritance by default.

Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to disable inheritance for the tests to pass? Surely the test data can be changed?

Comment on lines 86 to 91
VASP_INHERIT_INCAR: bool = Field(
False,
description="Whether to inherit INCAR settings from previous calculation. "
"This might be useful to port Custodian fixes to child jobs but can also be "
"dangerous e.g. when switching from GGA to meta-GGA or relax to static jobs.",
)
Copy link
Member Author

@janosh janosh Sep 27, 2023

Choose a reason for hiding this comment

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

As advocated for by @Andrew-S-Rosen during the atomate2 maintainer meeting, INCAR inheritance can also be controlled by the global VASP_INHERIT_INCAR flag.

Copy link
Member

@utf utf Sep 29, 2023

Choose a reason for hiding this comment

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

This has changed the default behaviour for all input sets. Please can you change this to True and we can assess this as a separate issue. This discussion should probably happen on the pymatgen issues since the default pymatgen behaviour is to inherit incar settings and we will be merging the atomate2 inputs with those in pymatgen soon.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. VASP_INHERIT_INCAR now defaults to True.

@@ -305,6 +311,7 @@ class VaspInputGenerator(InputGenerator):
symprec: float = SETTINGS.SYMPREC
vdw: str = None
config_dict: dict = field(default_factory=lambda: _BASE_VASP_SET)
inherit_incar: bool = None
Copy link
Member

Choose a reason for hiding this comment

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

Please add docstring for this option.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@utf
Copy link
Member

utf commented Oct 2, 2023

This looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features
Projects
None yet
6 participants