Skip to content

Commit

Permalink
Build thermo with other entry types (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm authored Jul 19, 2022
1 parent 16ebaab commit e00011f
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions emmet-builders/emmet/builders/vasp/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,6 @@ def get_entries(self, chemsys: str) -> List[Dict]:
new_q["chemsys"] = {"$in": list(query_chemsys)}
new_q["deprecated"] = False

# only build with materials that have a GGA or GGA+U entry
new_q["$or"] = [
{"entries.GGA": {"$exists": True}},
{"entries.GGA+U": {"$exists": True}},
]
materials_docs = list(
self.materials.query(
criteria=new_q, properties=["material_id", "entries", "deprecated"]
Expand All @@ -306,17 +301,16 @@ def get_entries(self, chemsys: str) -> List[Dict]:
f"Got {len(materials_docs)} entries from DB for {len(query_chemsys)} sub-chemsys for {chemsys}"
)

# Convert GGA and GGA+U entries into ComputedEntries and store
# Convert entries into ComputedEntries and store
for doc in materials_docs:
for r_type, entry_dict in doc.get("entries", {}).items():
if r_type == "GGA" or r_type == "GGA+U":
entry_dict["data"]["oxidation_states"] = oxi_states_data.get(
entry_dict["entry_id"], {}
)
entry_dict["data"]["run_type"] = r_type
elsyms = sorted(set([el for el in entry_dict["composition"]]))
self._entries_cache["-".join(elsyms)].append(entry_dict)
all_entries.append(entry_dict)
entry_dict["data"]["oxidation_states"] = oxi_states_data.get(
entry_dict["entry_id"], {}
)
entry_dict["data"]["run_type"] = r_type
elsyms = sorted(set([el for el in entry_dict["composition"]]))
self._entries_cache["-".join(elsyms)].append(entry_dict)
all_entries.append(entry_dict)

self.logger.info(f"Total entries in {chemsys} : {len(all_entries)}")

Expand Down

0 comments on commit e00011f

Please sign in to comment.