From 1cf263adb11b688f0bd010222bd4656085f0ea72 Mon Sep 17 00:00:00 2001 From: Duo <50307526+iProzd@users.noreply.github.com> Date: Sun, 12 Mar 2023 20:34:30 +0800 Subject: [PATCH 1/2] Raise error when dpdata.MultiSystem calls from_deepmd_npy_mixed with not-a-directory para. --- dpdata/plugins/deepmd.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dpdata/plugins/deepmd.py b/dpdata/plugins/deepmd.py index 770d2f9b..22247c42 100644 --- a/dpdata/plugins/deepmd.py +++ b/dpdata/plugins/deepmd.py @@ -136,6 +136,7 @@ def mix_system(self, *system, type_map, **kwargs): def from_multi_systems(self, directory, **kwargs): sys_dir = [] + assert os.path.isdir(directory), f'{directory} is not a directory!' for root, dirs, files in os.walk(directory): if ( "type_map.raw" in files From 91deabfc6d20c50f55579cec88f505c1e99897da Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 12 Mar 2023 12:35:56 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- dpdata/plugins/deepmd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpdata/plugins/deepmd.py b/dpdata/plugins/deepmd.py index 22247c42..3fb8a931 100644 --- a/dpdata/plugins/deepmd.py +++ b/dpdata/plugins/deepmd.py @@ -136,7 +136,7 @@ def mix_system(self, *system, type_map, **kwargs): def from_multi_systems(self, directory, **kwargs): sys_dir = [] - assert os.path.isdir(directory), f'{directory} is not a directory!' + assert os.path.isdir(directory), f"{directory} is not a directory!" for root, dirs, files in os.walk(directory): if ( "type_map.raw" in files