Skip to content

Commit

Permalink
Fix JobStoreDocument attribute access (#710)
Browse files Browse the repository at this point in the history
* Update dev.py

* Fix accessing attributes of TaskDoc using dot
  • Loading branch information
mjwen authored Jul 18, 2024
1 parent 0817ede commit 0291106
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/atomate2/cli/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,23 @@ def vasp_test_data(test_dir: str | Path, additional_file: list[str]) -> None:

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(" ", "_")

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

0 comments on commit 0291106

Please sign in to comment.