Skip to content

Commit

Permalink
simplify: do not symlink if the file does not exist (#1191)
Browse files Browse the repository at this point in the history
If there is no candidate (i.e. all accurate or all failed),
`picked_data_path` will not be dumped.

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed May 4, 2023
1 parent c977dcf commit d8519df
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions dpgen/simplify/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,15 @@ def make_fp_labeled(iter_index, jdata):
work_path = os.path.join(iter_name, fp_name)
create_path(work_path)
picked_data_path = os.path.join(iter_name, model_devi_name, picked_data_name)
os.symlink(
os.path.abspath(picked_data_path),
os.path.abspath(os.path.join(work_path, "task." + fp_task_fmt % (0, 0))),
)
os.symlink(
os.path.abspath(picked_data_path),
os.path.abspath(os.path.join(work_path, "data." + data_system_fmt % 0)),
)
if os.path.exists(os.path.abspath(picked_data_path)):
os.symlink(
os.path.abspath(picked_data_path),
os.path.abspath(os.path.join(work_path, "task." + fp_task_fmt % (0, 0))),
)
os.symlink(
os.path.abspath(picked_data_path),
os.path.abspath(os.path.join(work_path, "data." + data_system_fmt % 0)),
)


def make_fp_configs(iter_index, jdata):
Expand All @@ -393,6 +394,8 @@ def make_fp_configs(iter_index, jdata):
work_path = os.path.join(iter_name, fp_name)
create_path(work_path)
picked_data_path = os.path.join(iter_name, model_devi_name, picked_data_name)
if not os.path.exists(os.path.abspath(picked_data_path)):
return
systems = get_multi_system(picked_data_path, jdata)
ii = 0
jj = 0
Expand Down

0 comments on commit d8519df

Please sign in to comment.