Skip to content

Commit

Permalink
Fix corrected entries builder
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Nov 8, 2023
1 parent 46486b0 commit be40a1f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions emmet-builders/emmet/builders/materials/corrected_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,14 @@ def get_entries(self, chemsys: str) -> List[Dict]:
# Convert entries into ComputedEntries and store
for doc in materials_docs:
for r_type, entry_dict in doc.get("entries", {}).items():
entry_dict["data"]["oxidation_states"] = oxi_states_data.get(
entry_dict["data"]["material_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)
if entry_dict:
entry_dict["data"]["oxidation_states"] = oxi_states_data.get(
entry_dict["data"]["material_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 be40a1f

Please sign in to comment.