Skip to content

Commit

Permalink
Merge pull request #203 from materialsproject/revert_mat_finding
Browse files Browse the repository at this point in the history
Revert materials finding to old pipeline behavior
  • Loading branch information
shyamd committed Jun 14, 2021
2 parents 6d6425f + 39cb46c commit 16cc016
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions emmet-core/emmet/core/vasp/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ def from_tasks(
if len(task_group) == 0:
raise Exception("Must have more than one task in the group.")

# Material ID
possible_mat_ids = [task.task_id for task in task_group]
material_id = min(possible_mat_ids)

# Metadata
last_updated = max(task.last_updated for task in task_group)
created_at = min(task.completed_at for task in task_group)
Expand All @@ -82,6 +78,13 @@ def from_tasks(
else structure_optimizations
)

# Material ID
possible_mat_ids = [task.task_id for task in structure_optimizations]
material_id = min(possible_mat_ids)

# Always prefer a static over a structure opt
task_quality_scores = {"Structure Optimization": 1, "Static": 2}

def _structure_eval(task: TaskDocument):
"""
Helper function to order structures optimziation and statics calcs by
Expand All @@ -95,6 +98,7 @@ def _structure_eval(task: TaskDocument):

return (
-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),
-1 * task.input.parameters.get("LASPH", False),
task.output.energy_per_atom,
Expand Down

0 comments on commit 16cc016

Please sign in to comment.