Skip to content

model_devi_clean_traj support int type #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 5, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2840,15 +2840,24 @@ def post_fp (iter_index,
else :
raise RuntimeError ("unsupported fp style")
# clean traj
iter_name = make_iter_name(iter_index)
clean_traj = True
if 'model_devi_clean_traj' in jdata :
clean_traj = jdata['model_devi_clean_traj']
if clean_traj:
modd_path = os.path.join(iter_name, model_devi_name)
modd_path = None
if isinstance(clean_traj, bool):
iter_name = make_iter_name(iter_index)
if clean_traj:
modd_path = os.path.join(iter_name, model_devi_name)
elif isinstance(clean_traj, int):
clean_index = iter_index - clean_traj
if clean_index >= 0:
modd_path = os.path.join(make_iter_name(clean_index), model_devi_name)
if modd_path is not None:
md_trajs = glob.glob(os.path.join(modd_path, 'task*/traj'))
for ii in md_trajs :
for ii in md_trajs:
shutil.rmtree(ii)



def set_version(mdata):

Expand Down