Skip to content

Commit

Permalink
fix missing key of merged caly-evo-step (deepmodeling#228)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced key transformation handling for "caly-evo-step" in specific
scenarios.
	
- **Bug Fixes**
- Fixed issue where `None` values in `traj_results` caused errors by
filtering them out before path resolution.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: zjgemi <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
zjgemi and pre-commit-ci[bot] authored Jun 4, 2024
1 parent 3f4b764 commit d3f52d8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 22 deletions.
65 changes: 44 additions & 21 deletions dpgen2/entrypoint/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ def get_superop(key):
return key.replace("prep-caly-model-devi", "prep-run-explore")
elif "run-caly-model-devi" in key:
return re.sub("run-caly-model-devi-[0-9]*", "prep-run-explore", key)
elif "caly-evo-step" in key:
return re.sub("caly-evo-step-[0-9]*", "prep-run-explore", key)
return None


Expand Down Expand Up @@ -871,30 +873,51 @@ def get_resubmit_keys(
wf,
):
all_step_keys = successful_step_keys(wf)
all_step_keys = matched_step_key(
all_step_keys,
[
"prep-run-train",
"prep-train",
"run-train",
"modify-train-script",
"prep-caly-input",
step_keys = [
"prep-run-train",
"prep-train",
"run-train",
"modify-train-script",
"prep-caly-input",
"prep-caly-model-devi",
"run-caly-model-devi",
"prep-run-explore",
"prep-lmp",
"run-lmp",
"select-confs",
"prep-run-fp",
"prep-fp",
"run-fp",
"collect-data",
"scheduler",
"id",
]
if (
len(
matched_step_key(
all_step_keys,
[
"collect-run-calypso",
"prep-dp-optim",
"run-dp-optim",
],
)
)
> 0
):
# calypso default mode
step_keys += [
"collect-run-calypso",
"prep-dp-optim",
"run-dp-optim",
"prep-caly-model-devi",
"run-caly-model-devi",
"prep-run-explore",
"prep-lmp",
"run-lmp",
"select-confs",
"prep-run-fp",
"prep-fp",
"run-fp",
"collect-data",
"scheduler",
"id",
],
]
else:
# calypso merge mode
step_keys.append("caly-evo-step")

all_step_keys = matched_step_key(
all_step_keys,
step_keys,
)
all_step_keys = sort_slice_ops(
all_step_keys,
Expand Down
6 changes: 5 additions & 1 deletion dpgen2/op/prep_caly_model_devi.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def execute(
"""
work_dir = Path(ip["task_name"])
traj_results_dir = [Path(dir_name).resolve() for dir_name in ip["traj_results"]]
traj_results_dir = [
Path(dir_name).resolve()
for dir_name in ip["traj_results"]
if dir_name is not None
]
trajs = [
traj.resolve()
for traj_dir in traj_results_dir
Expand Down

0 comments on commit d3f52d8

Please sign in to comment.