From 72f4b7fb1cb3e52d701eb5587e34babf8fb5ecab Mon Sep 17 00:00:00 2001 From: Shyam Dwaraknath Date: Mon, 21 Jun 2021 15:21:35 -0700 Subject: [PATCH 1/2] use deprecated calcs in MaterialsBuilder --- emmet-core/emmet/core/vasp/material.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/emmet-core/emmet/core/vasp/material.py b/emmet-core/emmet/core/vasp/material.py index aec4c9a16d..a26d410982 100644 --- a/emmet-core/emmet/core/vasp/material.py +++ b/emmet-core/emmet/core/vasp/material.py @@ -68,10 +68,10 @@ def from_tasks( 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 @@ -97,6 +97,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), @@ -120,7 +121,8 @@ 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 = [ PropertyOrigin( From e2155a6cc1f19ff6f2af110cb84eec505faa89eb Mon Sep 17 00:00:00 2001 From: Shyam Dwaraknath Date: Mon, 21 Jun 2021 15:33:25 -0700 Subject: [PATCH 2/2] Fix linting issues --- emmet-core/emmet/core/vasp/material.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/emmet-core/emmet/core/vasp/material.py b/emmet-core/emmet/core/vasp/material.py index a26d410982..abf56b8e18 100644 --- a/emmet-core/emmet/core/vasp/material.py +++ b/emmet-core/emmet/core/vasp/material.py @@ -65,7 +65,6 @@ 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 task_group @@ -121,8 +120,8 @@ 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 - + deprecated = deprecated or best_structure_calc.task_id in deprecated_tasks + # Origins origins = [ PropertyOrigin(