MPRester issue from this month's update

Hi all,

Since this month’s addition of new structures, I’m seeing some issues with MPRester(). The issue occurs with a large fraction of structures when using the basic lines to grab a MP structure:

from pymatgen import MPRester
mpr = MPRester(<my_key>)
structure = mpr.get_structure_by_material_id(<mp_id>)

I’m seeing this occur with roughly 10% of my structures (from a pool of >2,000 mp-ids), but the structures that fail don’t look to be depreciated or removed from the MP database. Any idea what’s going on?

Here are two example mp-ids that fail with MPRester().get_structure_by_material_id(): mp-1113805 and mp-546846. Interestingly, the former can’t load the data on it’s mp webpage while the latter can (link1 and link2).

Let me know if there’s any insight on what’s going on!


Hi @jacksund,

Welcome to the forum. Tagging @shyamd for comment on the database.

With regards to getting the data you want right now, there shouldn’t be any tasks removed from the database for the new release. Therefore, you can use:

mpr.get_task_data('mp-546846', prop='structure')

To get the structure directly from the task itself (i.e. the individual calculation). I’ve verified this works with both the mp-ids you shared. Why the material ID isn’t resolving correctly we’ll have to investigate.