Skip to content

Commit

Permalink
Merge pull request #212 from materialsproject/fix-more-run-type
Browse files Browse the repository at this point in the history
Fix `run_type` in validation
  • Loading branch information
shyamd authored Jun 24, 2021
2 parents 4261c1a + 23553ef commit 319e9df
Show file tree
Hide file tree
Showing 4 changed files with 1,592 additions and 1,239 deletions.
2 changes: 1 addition & 1 deletion emmet-builders/emmet/builders/vasp/task_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(
"orig_inputs",
"output.structure",
"output.bandgap",
"input.parameters",
"calcs_reversed.0.input.parameters",
"calcs_reversed.output.ionic_steps.electronic_steps.e_fr_energy",
"tags",
],
Expand Down
17 changes: 15 additions & 2 deletions emmet-core/emmet/core/vasp/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,28 @@ class TaskDocument(BaseTaskDocument, StructureMetadata):

@property
def run_type(self) -> RunType:
return run_type(self.calcs_reversed[0].get("input", {}).get("parameters", {}))
params = self.calcs_reversed[0].get("input", {}).get("parameters", {})
ldau_fields = {
k: self.calcs_reversed[0].get("input", {}).get("incar", {}).get(k, [])
for k in ["LDAUL", "LDAUJ", "LDAUU"]
}
return run_type({**params, **ldau_fields})

@property
def task_type(self):
return task_type(self.orig_inputs)

@property
def calc_type(self):
return calc_type(self.orig_inputs, self.input.parameters)
params = self.calcs_reversed[0].get("input", {}).get("parameters", {})
ldau_fields = {
k: self.calcs_reversed[0].get("input", {}).get("incar", {}).get(k, [])
for k in ["LDAUL", "LDAUJ", "LDAUU"]
}
return calc_type(
self.orig_inputs,
{**params, **ldau_fields},
)

@property
def entry(self) -> ComputedEntry:
Expand Down
2 changes: 1 addition & 1 deletion tests/emmet-core/vasp/test_vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from emmet.core.vasp.validation import ValidationDoc


def test_task_tye():
def test_task_type():

# TODO: Switch this to actual inputs?
input_types = [
Expand Down
Loading

0 comments on commit 319e9df

Please sign in to comment.