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

mpr.materials.elasticity.search() does not return all results #932

Open
fxcoudert opened this issue Sep 11, 2024 · 3 comments
Open

mpr.materials.elasticity.search() does not return all results #932

fxcoudert opened this issue Sep 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@fxcoudert
Copy link

fxcoudert commented Sep 11, 2024

Python version

Python 3.10.14

Pymatgen version

2024.8.9

Operating system version

macOS 14

Current behavior

data = mpr.materials.elasticity.search(fields=["material_id", "formula_pretty", "structure", "elastic_tensor"])
print("Number of materials retrieved:", len(data))

You can see that it expects 12392 results (in line with what the website shows, roughly) but only downloads 10733.

Capture d’écran 2024-09-11 à 15 24 30

Expected Behavior

The search should download all available records.

Minimal example

from pymatgen.ext.matproj import MPRester
mpr = MPRester(mpapikey)
data = mpr.materials.elasticity.search(fields=["material_id", "formula_pretty", "structure", "elastic_tensor"])
print("Number of materials retrieved:", len(data))
@fxcoudert fxcoudert added the bug Something isn't working label Sep 11, 2024
@janosh
Copy link
Member

janosh commented Sep 11, 2024

moving this to the api repo since it's not an issue with pymatgen

@janosh janosh transferred this issue from materialsproject/pymatgen Sep 11, 2024
@tschaume
Copy link
Member

Thanks for reporting this @fxcoudert. Good catch! I can reproduce the issue and am looking into it.

@tschaume
Copy link
Member

@fxcoudert 1659 out of 12392 entries are deprecated and the API client skips them for empty queries while including them in the count for the progress bar. If you add a query on poisson_ratio for instance, deprecated entries are included and would need to be post-filtered out, though. @munrojm might remember why we went this route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants