Skip to content

Commit 7491eb9

Browse files
wanghan-iapcmHan Wang
and
Han Wang
authored
Fix exception message (#1554)
fixes #1553 Co-authored-by: Han Wang <[email protected]>
1 parent cf29489 commit 7491eb9

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

dpgen/data/gen.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -671,15 +671,12 @@ def make_scale(jdata):
671671
for jj in scale:
672672
if skip_relax:
673673
pos_src = os.path.join(os.path.join(init_path, ii), "POSCAR")
674-
assert os.path.isfile(pos_src)
675674
else:
676-
try:
677-
pos_src = os.path.join(os.path.join(init_path, ii), "CONTCAR")
678-
assert os.path.isfile(pos_src)
679-
except Exception:
680-
raise RuntimeError(
681-
"not file %s, vasp relaxation should be run before scale poscar"
682-
)
675+
pos_src = os.path.join(os.path.join(init_path, ii), "CONTCAR")
676+
if not os.path.isfile(pos_src):
677+
raise RuntimeError(
678+
f"file {pos_src} not found, vasp relaxation should be run before scale poscar"
679+
)
683680
scale_path = os.path.join(work_path, ii)
684681
scale_path = os.path.join(scale_path, f"scale-{jj:.3f}")
685682
create_path(scale_path)

0 commit comments

Comments
 (0)