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

Add a small test #2133

Merged
merged 2 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/quacc/calculators/vasp/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,11 @@ def __init__(
-------
None
"""
if atoms is None and prev_dir is None:
raise ValueError("Either atoms or prev_dir must be provided.")
self.atoms = atoms
self.prev_dir = prev_dir
self.structure = AseAtomsAdaptor.get_structure(atoms)
if atoms is None and prev_dir is None:
raise ValueError("Either atoms or prev_dir must be provided.")

def convert_dict_set(self, dict_set: DictSet) -> dict:
"""
Expand Down
5 changes: 5 additions & 0 deletions tests/core/calculators/vasp/test_vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,11 @@ def test_preset_override():
assert calc.parameters.get("efermi") is None


def test_bad_pmg_converter():
with pytest.raises(ValueError, match="Either atoms or prev_dir must be provided"):
MPtoASEConverter()


def test_pmg_input_set():
atoms = bulk("Cu")
parameters = MPtoASEConverter(atoms=atoms).convert_dict_set(MPRelaxSet)
Expand Down
Loading