diff --git a/chgnet/utils/vasp_utils.py b/chgnet/utils/vasp_utils.py index bfb54a07..5b712262 100644 --- a/chgnet/utils/vasp_utils.py +++ b/chgnet/utils/vasp_utils.py @@ -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") diff --git a/tests/test_vasp_utils.py b/tests/test_vasp_utils.py index 8def6568..b16c2ad3 100644 --- a/tests/test_vasp_utils.py +++ b/tests/test_vasp_utils.py @@ -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