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

Mineral Occurence Endpoint #3

Closed
fros1y opened this issue Mar 9, 2024 · 3 comments
Closed

Mineral Occurence Endpoint #3

fros1y opened this issue Mar 9, 2024 · 3 comments

Comments

@fros1y
Copy link

fros1y commented Mar 9, 2024

Hello!

Thanks for the awesome work opening up this great data. The OpenMindat paper shows Mineral Occurrence records linking Mineral Species to Localities. Can end points for accessing that data be added to the API?

@ChuBL
Copy link
Owner

ChuBL commented Mar 9, 2024

Hello! I am glad to hear this project helps.

The function you mentioned was already available from the API, though it was hard to find. Thank you for pointing it out.

I have updated the coding examples to the readme file for your reference.

Please let me know if you need more help using openmindat API.

Jiyin

@fros1y
Copy link
Author

fros1y commented Mar 9, 2024

Thanks,

My use case here is trying to convert OpenMindat data into map layers usable in GIS analysis. I've been able to retrieve a list of locations, but that does not include any mineral occurrence data.

From the example you added to the README, it looks like something like

lr = openmindat.LocalitiesRetriever()
lr.expand("geomaterials")
lr.save()

should work. However, the results don't appear to be any different. when using the expand option. Am I missing something?

@ChuBL
Copy link
Owner

ChuBL commented Mar 10, 2024

Bug Reproduction

I encountered problems running this code. Noticing that the function expand might result in many internal queries and crush the retrieval session, I tested an alternative code for single locality ID querying.

import openmindat
lr = openmindat.LocalitiesRetriever()
lr.id__in("6646").expand("geomaterials")
lr.saveto('./test/', 'test')

As you mentioned, the expand() function doesn't retrieve anything different from the retrieval without it. This is probably a problem from the API side. I will study it and discuss it with the API developers. Thank you for pointing it out.

Updating the Package

You might notice that the LocalitiesRetriever() class was problematic in the Pypi version of the package. We have fixed this issue; now you can import it in the manner shown in the examples. However, the updated code hasn't been published on the Pypi platform. To install the up-to-date version of this package, please clone this repo to your local environment, and run

pip install .

in your root directory of the cloned repo, which should look like:

/Users/YourUserName/.../OpenMindat/

@ChuBL ChuBL closed this as completed Apr 12, 2024
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

2 participants