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

Support Pymatgen-style VASP input sets #1649

Merged
merged 44 commits into from
Feb 17, 2024
Merged

Support Pymatgen-style VASP input sets #1649

merged 44 commits into from
Feb 17, 2024

Conversation

Andrew-S-Rosen
Copy link
Member

@Andrew-S-Rosen Andrew-S-Rosen commented Feb 1, 2024

Closes #1311.

Requires: materialsproject/pymatgen#3615

This PR allows support for Pymatgen-formatted input sets in the Vasp calculator and, by extension, all VASP recipes. The Vasp calculator takes a new keyword argument pmg_input_set: DictSet | None = None that, if specified, would act in the same was a preset by providing a list of default parameters to use. Any class inheriting from pymatgen.io.vasp.sets.DictSet is usable. This also means we can use the MP-compatible, pymatgen input sets directly without having to try and duplicate them 1:1 in quacc, such as by doing pmg_input_set = MPRelaxSet.

I also renamed mp_relax_job to mp_metagga_relax_job (and similar for the rest) to allow for a future addition of the GGA MP workflows.

Requires: A new release of pymatgen to be minted (bumped in #1622).

Example:

from ase.build import bulk
from quacc.calculators.vasp import Vasp
from pymatgen.io.vasp.sets import MPRelaxSet

atoms = bulk("Fe") * (2, 1, 1)
atoms[0].symbol = "O"
calc = Vasp(atoms, pmg_input_set=MPRelaxSet)
print(calc.parameters)

@Andrew-S-Rosen Andrew-S-Rosen enabled auto-merge (squash) February 8, 2024 18:18
deepsource-autofix bot and others added 5 commits February 8, 2024 18:23
Resolved issues in tests/core/calculators/vasp/test_vasp.py with DeepSource Autofix
Copy link

codecov bot commented Feb 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a4b55a3) 99.49% compared to head (ce913a1) 99.50%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1649   +/-   ##
=======================================
  Coverage   99.49%   99.50%           
=======================================
  Files          76       76           
  Lines        2990     3010   +20     
=======================================
+ Hits         2975     2995   +20     
  Misses         15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Andrew-S-Rosen Andrew-S-Rosen merged commit 5bbad24 into main Feb 17, 2024
22 checks passed
@Andrew-S-Rosen Andrew-S-Rosen deleted the vaspsets branch February 17, 2024 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Use MP VASP input sets directly without copying them in quacc
1 participant