@@ -234,7 +234,9 @@ def _validate_identifiers(
234234
235235 return list (valid_mpids .union (new_mpids ))
236236
237- def fetch_many (self , str_idxs : str ) -> list [FetchResult ]:
237+ def fetch_many (
238+ self , str_idxs : str , limit_one_per_chemsys : bool = False
239+ ) -> list [FetchResult ]:
238240 """Retrieve complete material information for a list of materials.
239241
240242 Should only be used to retrieve at most 100 materials.
@@ -248,6 +250,8 @@ def fetch_many(self, str_idxs: str) -> list[FetchResult]:
248250 str_idxs (str) : A list of Materials Project IDs,
249251 chemical formulas, or chemical systems, separated by
250252 commas, e.g., "mp-13, LiCl, Fe-O"
253+ limit_one_per_chemsys (bool) : Whether to limit to one
254+ entry per chemical system.
251255
252256 Returns:
253257 list of FetchResult with detailed material metadata.
@@ -263,7 +267,10 @@ def fetch_many(self, str_idxs: str) -> list[FetchResult]:
263267 "most 100 identifiers or use `fetch_all` to retrieve all "
264268 "data and filter down."
265269 )
266- idxs = self ._validate_identifiers (idxs , limit_one_per_chemsys = True )
270+ idxs = self ._validate_identifiers (
271+ idxs ,
272+ limit_one_per_chemsys = limit_one_per_chemsys ,
273+ )
267274 return self ._aggregate_fetch_results_from_mpids (idxs )
268275
269276 def fetch (self , idx : str ) -> FetchResult :
@@ -294,7 +301,7 @@ def fetch(self, idx: str) -> FetchResult:
294301 Raises:
295302 MPRestError: If no identifier is specified
296303 """
297- return self .fetch_many (idx )[0 ]
304+ return self .fetch_many (idx , limit_one_per_chemsys = True )[0 ]
298305
299306 def get_phase_diagram_from_elements (
300307 self ,
0 commit comments