NullPointerError of mp-640274

When I query the chgcar of mp-640274:

from mp_api.client import MPRester
with MPRester("[my_key]") as mpr:
     chgcar = mpr.get_charge_density_from_material_id('mp-640274')

The program will try to download the whole profile:

Retrieving MaterialsDoc documents: 100%
 1/1 [00:00<00:00, 63.81it/s]
/usr/local/lib/python3.11/dist-packages/mp_api/client/core/client.py:526: UserWarning: Ignoring `fields` argument: All fields are always included when no query is provided.
  warnings.warn(
Retrieving TaskDoc documents:   0%
 747/1418469 [00:07<3:46:18, 104.41it/s]

Thanks for reporting this! I can reproduce the issue and am looking into it. I’ll follow up here with an update soon.

@sc303165 The issue is that this material doesn’t have a chgcar and the API client wasn’t catching that. I’ve released mp-api==0.45.2 which catches this by returning before trying to retrieve tasks. Thanks!

1 Like