Skip to content

Commit b69a0b6

Browse files
committed
fix linting
1 parent e73e6dd commit b69a0b6

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/atomate2/utils/testing/lobster.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
"""Utilities for testing LOBSTER calculations."""
2+
13
from __future__ import annotations
24

35
import logging
46
import shutil
57
from pathlib import Path
6-
from typing import TYPE_CHECKING, Literal
8+
from typing import TYPE_CHECKING
79

810
import pytest
911
from pymatgen.io.lobster import Lobsterin
@@ -18,8 +20,8 @@
1820

1921
_LFILES = "lobsterin"
2022
_DFT_FILES = ("WAVECAR", "POSCAR", "INCAR", "KPOINTS", "POTCAR")
21-
_LOBS_REF_PATHS = {}
22-
_FAKE_RUN_LOBSTER_KWARGS = {}
23+
_LOBS_REF_PATHS: dict[str, str | Path] = {}
24+
_FAKE_RUN_LOBSTER_KWARGS: dict[str, dict[str, Sequence]] = {}
2325

2426

2527
@pytest.fixture(scope="session")
@@ -91,8 +93,8 @@ def _run(ref_paths, fake_run_lobster_kwargs):
9193

9294
def fake_run_lobster(
9395
ref_path: str | Path,
94-
check_lobster_inputs: Sequence[Literal["lobsterin"]] = _LFILES,
95-
check_dft_inputs: Sequence[Literal["WAVECAR", "POSCAR"]] = _DFT_FILES,
96+
check_lobster_inputs: Sequence[str] = _LFILES,
97+
check_dft_inputs: Sequence[str] = _DFT_FILES,
9698
lobsterin_settings: Sequence[str] = (),
9799
):
98100
"""
@@ -105,6 +107,8 @@ def fake_run_lobster(
105107
and output files in the folder named 'outputs'.
106108
check_lobster_inputs
107109
A list of lobster input files to check. Supported options are "lobsterin.gz".
110+
check_dft_inputs
111+
A list of VASP files that need to be copied to start the LOBSTER runs.
108112
lobsterin_settings
109113
A list of LOBSTER settings to check.
110114
"""
@@ -131,15 +135,15 @@ def verify_inputs(ref_path: str | Path, lobsterin_settings: Sequence[str]):
131135
user = Lobsterin.from_file("lobsterin")
132136

133137
# Check lobsterin
134-
ref = Lobsterin.from_file(ref_path / "inputs" / "lobsterin")
138+
ref = Lobsterin.from_file(Path(ref_path) / "inputs" / "lobsterin")
135139

136140
for key in lobsterin_settings:
137141
if user.get(key) != ref.get(key):
138142
raise ValueError(f"lobsterin value of {key} is inconsistent!")
139143

140144

141145
def copy_lobster_outputs(ref_path: str | Path):
142-
output_path = ref_path / "outputs"
146+
output_path = Path(ref_path) / "outputs"
143147
for output_file in output_path.iterdir():
144148
if output_file.is_file():
145149
shutil.copy(output_file, ".")

tutorials/lobster_workflow.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "0",
66
"metadata": {},
77
"source": [
8-
"The first lines are needed to ensure that we can mock VASP and LOBSTER runs."
8+
"The first lines are needed to ensure that we can mock VASP and LOBSTER runs. The test files here might not belong to the same calculation but are good enough for testing."
99
]
1010
},
1111
{

0 commit comments

Comments
 (0)