File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -416,12 +416,17 @@ def proc_crit(val):
416
416
warnings .filterwarnings ("ignore" , message = "Failed to guess oxidation states.*" )
417
417
entries = MaterialsProject2020Compatibility ().process_entries (entries , clean = True )
418
418
419
- if summary_data :
420
- edata = self .search (
421
- "summary" ,
422
- material_ids = [e .data ["material_id" ] for e in entries ],
423
- _fields = [* summary_data , "material_id" ],
424
- )
419
+ if summary_data and len (entries ) > 0 :
420
+ mids = [e .data ["material_id" ] for e in entries ]
421
+ edata = []
422
+ for i in range (0 , len (mids ), 100 ):
423
+ edata .extend (
424
+ self .search (
425
+ "summary" ,
426
+ material_ids = mids [i : i + 100 ],
427
+ _fields = [* summary_data , "material_id" ],
428
+ )
429
+ )
425
430
mapped_data = {d ["material_id" ]: {k : v for k , v in d .items () if k != "material_id" } for d in edata }
426
431
for e in entries :
427
432
e .data ["summary" ] = mapped_data [e .data ["material_id" ]]
You can’t perform that action at this time.
0 commit comments