Open oarcelus opened 2 years ago
I just tried the query you specified and for me it works. I ran it from the binder page of the Optimade tutorial. The pymatgen version I used is 2022.0.16
Perhaps there was a problem with the internet connexion to the server, or there was another reason the server could not respond at the time. Could you retry the query to see if the issue is still there?
The only way I made it work was to use string operations to build the url's instead of the join function.
url = resource + f"/v1/structures?filter={optimade_filter}&{fields}"
#url = join(resource, f"v1/structures?filter={optimade_filter}&{fields}")
And
#url = join(provider_url, "v1/info")
url = provider_url + "/v1/info"
This builds strings like 'https://optimade.materialsproject.org/v1/info' instead of 'https://optimade.materialsproject.org\v1/info'
Thanks for reporting this @oarcelus and following up @JPBergsma.
I can't replicate the issue with the example on my local laptop (macOS), so I suspect it may be a platform-dependent issue related to the behaviour of join
?
Perhaps urljoin
is the better function to call.
Thanks for the inputs @mkhorton, indeed urljoin
solves the problem in my case.
For the record, I am using Python 3.9 in Windows 10, and executing the string from PyCharm Community Edition 2021.2.2.
I am trying to use the OPTIMADE Rester. But when running the following lines
`from pymatgen.ext.optimade import OptimadeRester
opt = OptimadeRester('mp')
data = opt.get_structures(elements=['Li','Mn','O'], nelements=[1,3])`
I get the following error messages
Process finished with exit code 0
Searching for this same URL's, both for the 'info' and 'structures' endpoints I get the expected responses, so I assume this is a bug of some kind. Is this the case?