Skip to content

Commit

Permalink
Try a different approach for el_refs
Browse files Browse the repository at this point in the history
`CompoundPhaseDiagram` contains `DummySpecies` not `Element`
  • Loading branch information
mkhorton committed Oct 22, 2021
1 parent 9fd9827 commit 8616ea5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pymatgen/analysis/phase_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def __init__(self, entries, elements=None, *, computed_data=None):
self.all_entries = computed_data["all_entries"]
self.qhull_data = computed_data["qhull_data"]
self.dim = computed_data["dim"]
self.el_refs = {Element(el): ref for el, ref in computed_data["el_refs"].items()}
self.el_refs = dict(computed_data["el_refs"])
self.qhull_entries = computed_data["qhull_entries"]
self.stable_entries = set(self.qhull_entries[i] for i in set(itertools.chain(*self.facets)))

Expand Down Expand Up @@ -461,7 +461,8 @@ def _compute(self):
all_entries=all_entries,
qhull_data=qhull_data,
dim=dim,
el_refs={str(el): ref for el, ref in el_refs.items()},
# Dictionary with Element keys is not JSON-serializable
el_refs=list(el_refs.items()),
qhull_entries=qhull_entries,
)

Expand Down

0 comments on commit 8616ea5

Please sign in to comment.