From b7d9135ea75a5c58a24c779b34e7eff5f916fd2b Mon Sep 17 00:00:00 2001 From: Yongbin Zhuang <38876805+robinzyb@users.noreply.github.com> Date: Tue, 13 Jun 2023 21:48:57 +0800 Subject: [PATCH] len(all_sys) should > 0 for post_fp_cp2k (#1245) fix for this discussion https://github.com/deepmodeling/dpgen/discussions/1237#discussioncomment-6124499 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com> --- dpgen/generator/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/generator/run.py b/dpgen/generator/run.py index 1b630ead7..40dcfbd78 100644 --- a/dpgen/generator/run.py +++ b/dpgen/generator/run.py @@ -4295,7 +4295,7 @@ def post_fp_cp2k(iter_index, jdata, rfailed=None): all_sys.append(_sys) icount += len(all_sys) - if all_sys is not None: + if (all_sys is not None) and (len(all_sys) > 0): sys_data_path = os.path.join(work_path, "data.%s" % ss) all_sys.to_deepmd_raw(sys_data_path) all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output))