Skip to content

Commit

Permalink
working Thermo builder, some e_above_hull still look wierd
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmshn committed Mar 3, 2021
1 parent fb2f5b5 commit 07d34ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions emmet-builders/emmet/builders/vasp/thermo.py
Expand Up @@ -3,6 +3,7 @@
from itertools import chain
from typing import Dict, Iterator, List, Optional, Set, Tuple

from icecream import ic
from maggma.core import Builder, Store
from monty.json import MontyDecoder
from pymatgen import Structure
Expand Down Expand Up @@ -99,7 +100,7 @@ def get_items(self) -> Iterator[List[Dict]]:
# Yield the chemical systems in order of increasing size
# Will build them in a similar manner to fast Pourbaix
for chemsys in sorted(to_process_chemsys, key=lambda x: len(x.split("-"))):
entries = self.get_entries(chemsys, include_structure=True)
entries = self.get_entries(chemsys)
yield entries
# # build sandbox sets: ["a"] , ["a","b"], ["core","a","b"]
# sandbox_sets = set(
Expand Down Expand Up @@ -196,7 +197,7 @@ def update_targets(self, items):
else:
self.logger.info("No items to update")

def get_entries(self, chemsys: str, include_structure: bool = False) -> List[Dict]:
def get_entries(self, chemsys: str) -> List[Dict]:
"""
Gets a entries from the tasks collection for the corresponding chemical systems
Args:
Expand Down Expand Up @@ -240,8 +241,6 @@ def get_entries(self, chemsys: str, include_structure: bool = False) -> List[Dic
for doc in materials_docs:
for r_type, entry_dict in doc.get("entries", {}).items():
entry_dict["data"]["run_type"] = r_type
if include_structure:
entry_dict["structure"] = doc["structure"]
elsyms = sorted(set([el for el in entry_dict["composition"]]))
self._entries_cache["-".join(elsyms)].append(entry_dict)
all_entries.append(entry_dict)
Expand Down
3 changes: 2 additions & 1 deletion emmet-core/emmet/core/thermo.py
Expand Up @@ -3,6 +3,7 @@
from enum import Enum
from typing import ClassVar, Dict, List, Union

from icecream import ic
from pydantic import BaseModel, Field
from pymatgen.analysis.phase_diagram import PhaseDiagram, PhaseDiagramError
from pymatgen.core import Composition
Expand Down Expand Up @@ -139,6 +140,6 @@ def from_entries(cls, entries: List[Union[ComputedEntry, ComputedStructureEntry]
elif k in e.data:
d[k] = e.data[k]

docs.append(ThermoDoc.from_composition(composition=e.composition, **d))
docs.append(ThermoDoc.from_structure(structure=e.structure, **d))

return docs

0 comments on commit 07d34ef

Please sign in to comment.