I’m having issues querying the following data (the variable my_api_key
has been properly defined before the code below):
m = MPRester(my_api_key)
basic_properties = ['task_id','pretty_formula','reduced_cell_formula','unit_cell_formula','spacegroup.number','energy','formation_energy_per_atom','density']
electronic_properties = ['band_gap','efermi','total_magnetization']
elasticity_properties_prefix = ['elasticity']
all_properties = basic_properties + electronic_properties + elasticity_properties_prefix
# Query options
criteria = {"nelements": {"$lte": 3}, "elasticity": {"$exists": True}, "spacegroup.number": {"$exists": True}, "band_gap": {"$exists": True}}
# All properties: query response
results = m.query(criteria=criteria, properties=all_properties)
The script execution stops at the above line after printing all the query results to the screen (don’t know why). In debug mode, the following line is printed out:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pymatgen/matproj/rest.py", line 129, in _make_request
And I end up in the __init__
method of class BufferedIncrementalDecoder
(file codecs.py
).
I’m using Python 3.6 and pymatgen 4.7.3.
EDIT
I forgot to mention that the same code above did work a month or so ago.