emmet
emmet copied to clipboard
el_refs serialized as strings
https://github.com/materialsproject/emmet/blob/31a226297f3677098e61da13b8e7fe4ea6177fdd/emmet-core/emmet/core/thermo.py#L251-L253
When these PhaseDiagramDocument
s are pulled from the DB and deserialized the keys for el_refs
are string but the pymatgen
code uses Element
the entries time. I can't find if a conversion occurred in emmet.
pd = loadfn("/Users/shen9/Desktop/pd_doc.json") # taken from DB
pd["phase_diagram"].el_refs.keys()
# gives dict_keys(['O', 'Ge', 'Co', 'Li'])
@kim-jiyoon reported this. @munrojm and @mkhorton can you please have a look? This is to get the conversion documents on the new site.
Yup! Will take a look at this.
@janosh, this seems to stem from the fact that computed_data
can be passed when constructing a PhaseDiagram
object, which contains the el_refs
dictionary. If its keys are strings instead of Element
objects it appears to make a fuss when de-serializing with monty, or when trying to plot with PDPlotter
. It might be best to have it check and ensure Element
object keys on construction in pymatgen?
Also, qhull_data
is assumed to be a numpy array, and causes similar issues for ternary+ plots. For now, I am manually patching in the API client. https://github.com/materialsproject/api/blob/ece1b3effeebae208a16d98776a3bb555ec8e459/mp_api/client/routes/thermo.py#L181
Was I tagged by accident?
@janosh No, this just relates to a pymatgen issue I was about to open. We can discuss outside of this thread.