Skip to content
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

Fix JobStoreDocument attribute access #710

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Changes from all 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
12 changes: 7 additions & 5 deletions src/atomate2/cli/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,23 @@

outputs = loadfn("outputs.json")

task_labels = [o["output"].task_label for o in outputs if isinstance(o, TaskDoc)]
task_labels = [
o.output.task_label for o in outputs if isinstance(o.output, TaskDoc)
]

if len(task_labels) != len(set(task_labels)):
raise ValueError("Not all jobs have unique names")

original_mapping = {}
mapping = {}
for output in outputs:
if not isinstance(output["output"], TaskDoc):
if not isinstance(output.output, TaskDoc):
# this is not a VASP job
continue

job_name = output["output"].task_label
orig_job_dir = strip_hostname(output["output"].dir_name)
folder_name = output["output"].task_label.replace("/", "_").replace(" ", "_")
job_name = output.output.task_label
orig_job_dir = strip_hostname(output.output.dir_name)
folder_name = output.output.task_label.replace("/", "_").replace(" ", "_")

Check warning on line 66 in src/atomate2/cli/dev.py

View check run for this annotation

Codecov / codecov/patch

src/atomate2/cli/dev.py#L64-L66

Added lines #L64 - L66 were not covered by tests

if len(task_labels) == 1:
# only testing a single job
Expand Down
Loading