Skip to content

Commit 23a362d

Browse files
Raise warnings if there is no system in the path listed in sys_configs (#1130)
If the user writes a wrong path in "sys_configs", this warning can help locate the problem. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 18613d6 commit 23a362d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dpgen/generator/run.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,13 @@ def make_model_devi(iter_index, jdata, mdata):
10041004
cur_systems = []
10051005
ss = sys_configs[idx]
10061006
for ii in ss:
1007-
cur_systems += sorted(glob.glob(ii))
1007+
ii_systems = sorted(glob.glob(ii))
1008+
if ii_systems == []:
1009+
warnings.warn(
1010+
"There is no system in the path %s. Please check if the path is correct."
1011+
% ii
1012+
)
1013+
cur_systems += ii_systems
10081014
# cur_systems should not be sorted, as we may add specific constrict to the similutions
10091015
# cur_systems.sort()
10101016
cur_systems = [os.path.abspath(ii) for ii in cur_systems]

0 commit comments

Comments
 (0)