What I am trying to do:
Query 11k entries by mpid using a try / except statement to grab updated mpids where they have been deprecated.
My code:
with MPRester(conditions["MP_API_key"]) as mpr:
try:
pmg_entry = mpr.get_entry_by_material_id(mpid)
except:
mpid_new = mpr.get_materials_id_from_task_id(mpid)
pmg_entry = mpr.get_entry_by_material_id(mpid_new)
The problem
For ~400 entries, the try statement fails, and mpid_new = mpr.get_materials_id_from_task_id(mpid)
points to the same mpid so the second query fails. I sampled 20 failed ids and searched for them with the materials explorer they show as
(1) deprecated on the old website https://materialsproject.org/materials/mp-1104462/
(2) perfectly available on the nextgen site. https://next-gen.materialsproject.org/materials/mp-1104462
Any advice / suggestions? Thank you in advance for your help! I am happy to clarify / provide more examples.