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

[Bug or New restriction]: exclude_elements - String should have at most 15 characters #879

Open
JiaoyueYuan opened this issue Dec 12, 2023 · 4 comments

Comments

@JiaoyueYuan
Copy link

I have a list of ~20 elements that need to be excluded in MP query. The code worked fine on Dec 1st, but failed with this error on Dec 11th:

mp_api.client.core.client.MPRestError: REST query returned with error status code 422 on URL ... with message:
exclude_elements - String should have at most 15 characters

Any query with exclude_elements length > 15 characters (including comma) would result in the same error. eg,.

from mp_api.client import MPRester
from emmet.core.summary import HasProps

with MPRester("your_api_key") as mpr:
    exclude_eles = ["H", "Rb", "Cs", "Be", 
                    "Mn", "Tc", "Re", "Fe", 
                    "Ru", "Os", "Co", "Rh",
                    "Ir", "Ni", "Pd", "Pt",
                    "Ag", "Au", "Cd", "Hg"]

    docs = mpr.summary.search(num_elements=3, 
                              is_gap_direct=True,
                              exclude_elements=exclude_eles,
                              has_props=[HasProps.bandstructure],
                              fields=["material_id"])

I am wondering if this is a new restriction or a bug.

@munrojm
Copy link
Member

munrojm commented Dec 13, 2023

This is a new restriction for the time being while we address some performance issues with our infrastructure.

@Shibu778
Copy link

Shibu778 commented Mar 3, 2024

I am encountering the same error. Can you please tell when are you going to remove this restriction?

@ebanyas
Copy link

ebanyas commented Sep 26, 2024

Bumping this to ask if there's a timeline for removing the exclude_elements length restriction!

@tschaume
Copy link
Member

We still need to keep some level of restriction on the list length in place but I raised it to 60 characters with the deployment a few days ago. That should allow @JiaoyueYuan 's original request through. HTH

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

5 participants