Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 25, 2024
1 parent 19ee8d5 commit 8e472ee
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 57 deletions.
16 changes: 10 additions & 6 deletions dpgen2/entrypoint/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,12 +812,12 @@ def get_resubmit_keys(
wf,
):
wf_info = wf.query()
all_steps = [step for step in wf_info.get_step(sort_by_generation=True) if step.key is not None]
super_keys = [
"prep-run-train",
"prep-run-explore",
"prep-run-fp"
all_steps = [

Check warning on line 815 in dpgen2/entrypoint/submit.py

View check run for this annotation

Codecov / codecov/patch

dpgen2/entrypoint/submit.py#L814-L815

Added lines #L814 - L815 were not covered by tests
step
for step in wf_info.get_step(sort_by_generation=True)
if step.key is not None
]
super_keys = ["prep-run-train", "prep-run-explore", "prep-run-fp"]
other_keys = [

Check warning on line 821 in dpgen2/entrypoint/submit.py

View check run for this annotation

Codecov / codecov/patch

dpgen2/entrypoint/submit.py#L820-L821

Added lines #L820 - L821 were not covered by tests
"select-confs",
"collect-data",
Expand All @@ -829,7 +829,11 @@ def get_resubmit_keys(
for step in all_steps:
if len(matched_step_key([step.key], super_keys)) > 0:
sub_steps = wf_info.get_step(parent_id=step.id, sort_by_generation=True)
sub_keys = [step.key for step in sub_steps if step.key is not None and step.phase == "Succeeded"]
sub_keys = [

Check warning on line 832 in dpgen2/entrypoint/submit.py

View check run for this annotation

Codecov / codecov/patch

dpgen2/entrypoint/submit.py#L828-L832

Added lines #L828 - L832 were not covered by tests
step.key
for step in sub_steps
if step.key is not None and step.phase == "Succeeded"
]
sub_keys = sort_slice_ops(

Check warning on line 837 in dpgen2/entrypoint/submit.py

View check run for this annotation

Codecov / codecov/patch

dpgen2/entrypoint/submit.py#L837

Added line #L837 was not covered by tests
sub_keys,
["run-train", "run-lmp", "run-fp", "diffcsp-gen", "run-relax"],
Expand Down
102 changes: 51 additions & 51 deletions tests/entrypoint/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,34 +967,34 @@ def __init__(self, key, phase):


steps = [
MockedArgoStep(key='init--scheduler', phase="Succeeded"),
MockedArgoStep(key='init--id', phase="Succeeded"),
MockedArgoStep(key='iter-000000--loop', phase="Succeeded"),
MockedArgoStep(key='iter-000000--block', phase="Succeeded"),
MockedArgoStep(key='iter-000000--prep-run-train', phase="Succeeded"),
MockedArgoStep(key='iter-000000--prep-run-explore', phase="Succeeded"),
MockedArgoStep(key='iter-000000--select-confs', phase="Succeeded"),
MockedArgoStep(key='iter-000000--prep-run-fp', phase="Succeeded"),
MockedArgoStep(key='iter-000000--collect-data', phase="Succeeded"),
MockedArgoStep(key='iter-000000--scheduler', phase="Succeeded"),
MockedArgoStep(key='iter-000000--id', phase="Succeeded"),
MockedArgoStep(key='iter-000001--block', phase="Failed"),
MockedArgoStep(key='iter-000001--prep-run-train', phase="Succeeded"),
MockedArgoStep(key='iter-000001--prep-train', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-train-0000', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-train-0001', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-train-0002', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-train-0003', phase="Succeeded"),
MockedArgoStep(key='iter-000001--prep-run-explore', phase="Succeeded"),
MockedArgoStep(key='iter-000001--prep-lmp', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-lmp-000000', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-lmp-000001', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-lmp-000002', phase="Succeeded"),
MockedArgoStep(key='iter-000001--select-confs', phase="Succeeded"),
MockedArgoStep(key='iter-000001--prep-run-fp', phase="Failed"),
MockedArgoStep(key='iter-000001--prep-fp', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-fp-000000', phase="Succeeded"),
MockedArgoStep(key='iter-000001--run-fp-000001', phase="Failed"),
MockedArgoStep(key="init--scheduler", phase="Succeeded"),
MockedArgoStep(key="init--id", phase="Succeeded"),
MockedArgoStep(key="iter-000000--loop", phase="Succeeded"),
MockedArgoStep(key="iter-000000--block", phase="Succeeded"),
MockedArgoStep(key="iter-000000--prep-run-train", phase="Succeeded"),
MockedArgoStep(key="iter-000000--prep-run-explore", phase="Succeeded"),
MockedArgoStep(key="iter-000000--select-confs", phase="Succeeded"),
MockedArgoStep(key="iter-000000--prep-run-fp", phase="Succeeded"),
MockedArgoStep(key="iter-000000--collect-data", phase="Succeeded"),
MockedArgoStep(key="iter-000000--scheduler", phase="Succeeded"),
MockedArgoStep(key="iter-000000--id", phase="Succeeded"),
MockedArgoStep(key="iter-000001--block", phase="Failed"),
MockedArgoStep(key="iter-000001--prep-run-train", phase="Succeeded"),
MockedArgoStep(key="iter-000001--prep-train", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-train-0000", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-train-0001", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-train-0002", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-train-0003", phase="Succeeded"),
MockedArgoStep(key="iter-000001--prep-run-explore", phase="Succeeded"),
MockedArgoStep(key="iter-000001--prep-lmp", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-lmp-000000", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-lmp-000001", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-lmp-000002", phase="Succeeded"),
MockedArgoStep(key="iter-000001--select-confs", phase="Succeeded"),
MockedArgoStep(key="iter-000001--prep-run-fp", phase="Failed"),
MockedArgoStep(key="iter-000001--prep-fp", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-fp-000000", phase="Succeeded"),
MockedArgoStep(key="iter-000001--run-fp-000001", phase="Failed"),
]


Expand Down Expand Up @@ -1022,31 +1022,31 @@ def query(self):


expected_folded_keys = {
'init--scheduler': ['init--scheduler'],
'init--id': ['init--id'],
'iter-000000--prep-run-train': ['iter-000000--prep-run-train'],
'iter-000000--prep-run-explore': ['iter-000000--prep-run-explore'],
'iter-000000--select-confs': ['iter-000000--select-confs'],
'iter-000000--prep-run-fp': ['iter-000000--prep-run-fp'],
'iter-000000--collect-data': ['iter-000000--collect-data'],
'iter-000000--scheduler': ['iter-000000--scheduler'],
'iter-000000--id': ['iter-000000--id'],
'iter-000001--prep-run-train': [
'iter-000001--prep-train',
'iter-000001--run-train-0000',
'iter-000001--run-train-0001',
'iter-000001--run-train-0002',
'iter-000001--run-train-0003'
"init--scheduler": ["init--scheduler"],
"init--id": ["init--id"],
"iter-000000--prep-run-train": ["iter-000000--prep-run-train"],
"iter-000000--prep-run-explore": ["iter-000000--prep-run-explore"],
"iter-000000--select-confs": ["iter-000000--select-confs"],
"iter-000000--prep-run-fp": ["iter-000000--prep-run-fp"],
"iter-000000--collect-data": ["iter-000000--collect-data"],
"iter-000000--scheduler": ["iter-000000--scheduler"],
"iter-000000--id": ["iter-000000--id"],
"iter-000001--prep-run-train": [
"iter-000001--prep-train",
"iter-000001--run-train-0000",
"iter-000001--run-train-0001",
"iter-000001--run-train-0002",
"iter-000001--run-train-0003",
],
'iter-000001--prep-run-explore': [
'iter-000001--prep-lmp',
'iter-000001--run-lmp-000000',
'iter-000001--run-lmp-000001',
'iter-000001--run-lmp-000002'
"iter-000001--prep-run-explore": [
"iter-000001--prep-lmp",
"iter-000001--run-lmp-000000",
"iter-000001--run-lmp-000001",
"iter-000001--run-lmp-000002",
],
'iter-000001--select-confs': ['iter-000001--select-confs'],
'iter-000001--prep-fp': ['iter-000001--prep-fp'],
'iter-000001--run-fp-000000': ['iter-000001--run-fp-000000'],
"iter-000001--select-confs": ["iter-000001--select-confs"],
"iter-000001--prep-fp": ["iter-000001--prep-fp"],
"iter-000001--run-fp-000000": ["iter-000001--run-fp-000000"],
}


Expand Down

0 comments on commit 8e472ee

Please sign in to comment.