Skip to content

Commit

Permalink
Merge pull request #207 from materialsproject/shyamd-deprecated
Browse files Browse the repository at this point in the history
Use deprecated tasks in Materials Builder
  • Loading branch information
Shyam Dwaraknath authored Jun 21, 2021
2 parents c636258 + e2155a6 commit 87135f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions emmet-core/emmet/core/vasp/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ def from_tasks(
task_types = {task.task_id: task.task_type for task in task_group}
calc_types = {task.task_id: task.calc_type for task in task_group}

valid_tasks = [task for task in task_group if task.is_valid]
structure_optimizations = [
task
for task in valid_tasks
for task in task_group
if task.task_type == TaskType.Structure_Optimization # type: ignore
]
statics = [task for task in valid_tasks if task.task_type == TaskType.Static] # type: ignore
statics = [task for task in task_group if task.task_type == TaskType.Static] # type: ignore
structure_calcs = (
structure_optimizations + statics
if use_statics
Expand All @@ -97,6 +96,7 @@ def _structure_eval(task: TaskDocument):
task_run_type = task.run_type

return (
-1 * int(task.is_valid),
-1 * quality_scores.get(task_run_type.value, 0),
-1 * task_quality_scores.get(task.task_type.value, 0),
-1 * task.input.parameters.get("ISPIN", 1),
Expand All @@ -120,6 +120,7 @@ def _structure_eval(task: TaskDocument):

# Deprecated
deprecated = all(task.task_id in deprecated_tasks for task in structure_calcs)
deprecated = deprecated or best_structure_calc.task_id in deprecated_tasks

# Origins
origins = [
Expand Down

0 comments on commit 87135f5

Please sign in to comment.