Skip to content

Commit

Permalink
Minor code simplification.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Oct 23, 2024
1 parent 6025d44 commit ab99149
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pymatgen/io/vasp/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5788,7 +5788,9 @@ def __init__(self, dirname: str | Path):
dirname: The directory containing the VASP calculation as a string or Path.
"""
self.path = Path(dirname).absolute()
self.files = [Path(d) / f for d, subd, fnames in os.walk(self.path) for f in fnames]

# Note that py3.12 has Path.walk(). But we need to use os.walk to ensure backwards compatibility for now.
self.files = [Path(d) / f for d, _, fnames in os.walk(self.path) for f in fnames]
self._parsed_files: dict[str, Any] = {}

def reset(self):
Expand Down Expand Up @@ -5823,7 +5825,7 @@ def __getitem__(self, item):
return self._parsed_files[item]

warnings.warn(
f"No parser defined for {item}. Full text of file is returned as a string.",
f"No parser defined for {item}. Contents are returned as a string.",
UserWarning,
)
with zopen(fpath, "rt") as f:
Expand Down

0 comments on commit ab99149

Please sign in to comment.