From 741a14e0d390a5c714e6c4272610abcbc8203b2e Mon Sep 17 00:00:00 2001 From: munrojm Date: Fri, 8 Dec 2023 14:30:11 -0800 Subject: [PATCH] Fix max list --- mp_api/client/core/utils.py | 2 +- tests/test_mprester.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mp_api/client/core/utils.py b/mp_api/client/core/utils.py index de2cfacd..b4dfa786 100644 --- a/mp_api/client/core/utils.py +++ b/mp_api/client/core/utils.py @@ -25,7 +25,7 @@ def validate_ids(id_list: list[str]): Returns: id_list: Returns original ID list if everything is formatted correctly. """ - if len(id_list) >= MAPIClientSettings().MAX_LIST_LENGTH: + if len(id_list) > MAPIClientSettings().MAX_LIST_LENGTH: raise ValueError( "List of material/molecule IDs provided is too long. Consider removing the ID filter to automatically pull" " data for all IDs and filter locally." diff --git a/tests/test_mprester.py b/tests/test_mprester.py index 2809e6b4..cdde7521 100644 --- a/tests/test_mprester.py +++ b/tests/test_mprester.py @@ -316,7 +316,7 @@ def test_large_list(self, mpr): mpids = [ str(doc.material_id) for doc in mpr.summary.search( - chunk_size=1000, num_chunks=15, fields=["material_id"] + chunk_size=1000, num_chunks=10, fields=["material_id"] ) ] docs = mpr.summary.search(material_ids=mpids, fields=["material_ids"])