Skip to content

Commit

Permalink
fix error type
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Sep 11, 2024
1 parent d628068 commit d0c6b5b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chgnet/utils/vasp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def parse_vasp_dir(
dict: a dictionary of lists with keys for structure, uncorrected_total_energy,
energy_per_atom, force, magmom, stress.
"""
if os.path.isdir(base_dir) is False:
if not os.path.isdir(base_dir):
raise NotADirectoryError(f"{base_dir=} is not a directory")

oszicar_path = zpath(f"{base_dir}/OSZICAR")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_vasp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_parse_vasp_dir_without_magmoms(tmp_path: Path):

def test_parse_vasp_dir_no_data():
# test non-existing directory
with pytest.raises(FileNotFoundError, match="is not a directory"):
with pytest.raises(NotADirectoryError, match="is not a directory"):
parse_vasp_dir(f"{ROOT}/tests/files/non-existent")

# test existing directory without VASP files
Expand Down

0 comments on commit d0c6b5b

Please sign in to comment.