However I can’t seem to make a similar process work with the new pymatgen API nor can I successfully install the legacy version on my new machine. Does anybody know how to solve this issue?
Hi @Lee1, here is a piece of code to retrieve all of the structures that have a substrate entry:
from emmet.core.summary import HasProps
from mp_api.client import MPRester
with MPRester() as mpr:
docs = mpr.summary.search(has_props=[HasProps.substrates], fields=["structure", "material_id"])
substrates = [doc.structure for doc in docs]
This is equivalent to:
# Get list of material IDs for common substrates
mids = mpr.get_all_substrates()
substrates = mpr.query({"material_id": {"$in": mids}}, ["structure", "material_id"])
Is this the portion of the code you were looking for?