api
api copied to clipboard
[Bug or New restriction]: exclude_elements - String should have at most 15 characters
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.
This is a new restriction for the time being while we address some performance issues with our infrastructure.
I am encountering the same error. Can you please tell when are you going to remove this restriction?
Bumping this to ask if there's a timeline for removing the exclude_elements
length restriction!
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