Skip to content

Commit

Permalink
Raise warnings if there is no system in the path listed in sys_configs (
Browse files Browse the repository at this point in the history
#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>
  • Loading branch information
HuangJiameng and pre-commit-ci[bot] authored Jan 29, 2023
1 parent 18613d6 commit 23a362d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,13 @@ def make_model_devi(iter_index, jdata, mdata):
cur_systems = []
ss = sys_configs[idx]
for ii in ss:
cur_systems += sorted(glob.glob(ii))
ii_systems = sorted(glob.glob(ii))
if ii_systems == []:
warnings.warn(
"There is no system in the path %s. Please check if the path is correct."
% ii
)
cur_systems += ii_systems
# cur_systems should not be sorted, as we may add specific constrict to the similutions
# cur_systems.sort()
cur_systems = [os.path.abspath(ii) for ii in cur_systems]
Expand Down

0 comments on commit 23a362d

Please sign in to comment.