Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example queries return None #5

Open
latmarat opened this issue Oct 15, 2019 · 6 comments
Open

Example queries return None #5

latmarat opened this issue Oct 15, 2019 · 6 comments

Comments

@latmarat
Copy link

Hello, I have a question about qmpy_rester usage. I tried a few example queries from the Readme file but, whatever I try, I keep getting None as a result. Do you know what could be the issue?
Thanks!

@mohanliu
Copy link
Owner

Yes. The reason is that our RESTful API for OQMD is still in the stage of internal test. We will release a new OQMD with RESTful API and some other features very soon. After that, you will be able to query data using this python wrapper. I will follow up with you once everything is ready.

@latmarat
Copy link
Author

Thank you, looking forward to the new release!

@mohanliu
Copy link
Owner

mohanliu commented Nov 6, 2019

The new OQMD is released! This API wrapper should be good now. Try it out and close the issue if everything looks fine.

@CompRhys
Copy link

From the query function:

def query_oqmd(i=0, offset=100):
    with qr.QMPYRester() as q:
        kwargs = {'limit':offset,'offset': i*offset, 'elements':'O'}
        # data = q.get_oqmd_phases(verbose=False, **kwargs)
        data = q.get_optimade_structures(verbose=False, **kwargs)
    return data["data"]

I have gotten the error:

File "/home/reag2/PhD/datasets/OQMD/script.py", line 13, in query_oqmd
    return data["data"]
TypeError: 'NoneType' object is not subscriptable

Is this a related issue?

@CompRhys
Copy link

From the query function:

def query_oqmd(i=0, offset=100):
    with qr.QMPYRester() as q:
        kwargs = {'limit':offset,'offset': i*offset, 'elements':'O'}
        # data = q.get_oqmd_phases(verbose=False, **kwargs)
        data = q.get_optimade_structures(verbose=False, **kwargs)
    return data["data"]

I have gotten the error:

File "/home/reag2/PhD/datasets/OQMD/script.py", line 13, in query_oqmd
    return data["data"]
TypeError: 'NoneType' object is not subscriptable

Is this a related issue?

This actually appears to be due to a gateway timeout. @mohanliu what are the access rules on making requests to the server? I had queried less than 3000 structures when it locked me out.

@tachyontraveler
Copy link
Contributor

I increased the queue timeout on our web server now. I ran your script in my local system and it was able to download data from a query when I set the limit to be 3000. Lmk if this problem still persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants