-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #971 from esoteric-ephemera/taskdoc
TaskDoc refactor
- Loading branch information
Showing
21 changed files
with
213 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
from emmet.core.utils import group_structures, jsanitize, undeform_structure | ||
from emmet.core.vasp.calc_types import TaskType | ||
from emmet.core.vasp.material import MaterialsDoc | ||
from emmet.core.vasp.task_valid import TaskDocument | ||
from emmet.core.tasks import TaskDoc | ||
|
||
__author__ = "Shyam Dwaraknath <[email protected]>" | ||
|
||
|
@@ -176,7 +176,7 @@ def get_items(self) -> Iterator[List[Dict]]: | |
invalid_ids = set() | ||
|
||
projected_fields = [ | ||
"last_updated", | ||
# "last_updated", | ||
"completed_at", | ||
"task_id", | ||
"formula_pretty", | ||
|
@@ -190,9 +190,11 @@ def get_items(self) -> Iterator[List[Dict]]: | |
"input.structure", | ||
# needed for entry from task_doc | ||
"output.energy", | ||
"calcs_reversed.output.energy", | ||
"input.is_hubbard", | ||
"input.hubbards", | ||
"input.potcar_spec", | ||
"calcs_reversed.input.potcar_spec", | ||
"calcs_reversed.output.structure", | ||
# needed for transform deformation structure back for grouping | ||
"transformations", | ||
# misc info for materials doc | ||
|
@@ -222,7 +224,9 @@ def process_item(self, items: List[Dict]) -> List[Dict]: | |
were processed | ||
""" | ||
|
||
tasks = [TaskDocument(**task) for task in items] | ||
tasks = [ | ||
TaskDoc(**task) for task in items | ||
] # [TaskDoc(**task) for task in items] | ||
formula = tasks[0].formula_pretty | ||
task_ids = [task.task_id for task in tasks] | ||
|
||
|
@@ -290,8 +294,8 @@ def update_targets(self, items: List[List[Dict]]): | |
self.logger.info("No items to update") | ||
|
||
def filter_and_group_tasks( | ||
self, tasks: List[TaskDocument], task_transformations: List[Union[Dict, None]] | ||
) -> Iterator[List[TaskDocument]]: | ||
self, tasks: List[TaskDoc], task_transformations: List[Union[Dict, None]] | ||
) -> Iterator[List[TaskDoc]]: | ||
""" | ||
Groups tasks by structure matching | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.