materialsproject / api

New API client for the Materials Project
https://materialsproject.github.io/api/
Other
104 stars 38 forks source link

Bug(?): `mpr.get_material_ids` can only take `chemsys` but not `formula` format anymore #814

Closed QuantumChemist closed 1 year ago

QuantumChemist commented 1 year ago

Hi everyone :D

until a few days ago, I could pass either a chemsys parameter (like Li-Fe-O) or a formula parameter (like LiFeO2) interchangeably as a variable called compo in my example code (i.e. calling my python script like mpr.py Li-Fe-O or mpr.py LiFeO2 both worked fine) and I find that pretty convenient.

Using LiFeO2 now causes the following error now: mp_api.client.core.client.MPRestError: HTTPSConnectionPool(host='api.materialsproject.org', port=443): Max retries exceeded with url: /materials/core/?deprecated=False&_fields=material_id&formula=LiFeO2&_limit=1000 (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))

Using Li-Fe-O still works fine.

This is a minimal code example for that issue.

from mp_api.client import MPRester
import sys

mpr = MPRester(api_key = 'API_KEY') 
compo = str(sys.argv[1])

mpids = mpr.get_material_ids(compo)  # input e.g. LiFeO2 or Li-Fe-O
for mpid in mpids: print(mpid)

Of course, I updated all packages first, etc. So I wanted to ask if maybe the syntax or so of that function changed and if there is the possibility to still pass the two formats interchangeably with one variable without adding additional code?

Thank you in advance! :)

munrojm commented 1 year ago

Hi @QuantumChemist, thanks for bringing this up. I can reproduce this issue and am taking a closer look at it now.

QuantumChemist commented 1 year ago

Hi @munrojm . Thx! Also tried to find out what's going wrong but don't see anything suspicious. 👀

munrojm commented 1 year ago

@QuantumChemist it looks like this is a server issue on our end. We have been having some stability and speed issues with our database, and are continuing to work on fixing them.

QuantumChemist commented 1 year ago

Hi @munrojm, then I think I can close this issue here. Thx for having a look at it ☺️