diff --git a/emmet-builders/emmet/builders/materials/electrodes.py b/emmet-builders/emmet/builders/materials/electrodes.py index 60a8e5f1b3..007abe61f1 100644 --- a/emmet-builders/emmet/builders/materials/electrodes.py +++ b/emmet-builders/emmet/builders/materials/electrodes.py @@ -52,11 +52,7 @@ def s_hash(el): WORKING_IONS = ["Li", "Be", "Na", "Mg", "K", "Ca", "Rb", "Sr", "Cs", "Ba"] -MAT_PROPS = [ - "structure", - "material_id", - "formula_pretty", -] +MAT_PROPS = ["structure", "material_id", "formula_pretty", "entries"] sg_fields = ["number", "hall_number", "international", "hall", "choice"] @@ -398,7 +394,7 @@ def process_item(self, item) -> Dict: host_structure=host_structure, ) if ie is None: - return None # {"failed_reason": "unable to create InsertionElectrode document"} + return None # {"failed_reason": "unable to create InsertionElectrode document"} return jsanitize(ie.dict()) def update_targets(self, items: List): diff --git a/emmet-core/emmet/core/structure_group.py b/emmet-core/emmet/core/structure_group.py index b5478906cd..acd6d96c2e 100644 --- a/emmet-core/emmet/core/structure_group.py +++ b/emmet-core/emmet/core/structure_group.py @@ -24,10 +24,10 @@ def generic_groupby(list_in, comp=operator.eq) -> List[int]: Returns: [int] list of labels for the input list """ - list_out = [-1] * len(list_in) + list_out = [None] * len(list_in) label_num = 0 for i1, ls1 in enumerate(list_out): - if ls1 != -1: + if ls1 is not None: continue list_out[i1] = label_num for i2, ls2 in list(enumerate(list_out))[i1 + 1 :]: @@ -181,6 +181,9 @@ def from_ungrouped_structure_entries( logger.debug( f"Performing structure matching for {framework} with {len(f_group_l)} documents." ) + print( + f"Performing structure matching for {framework} with {len(f_group_l)} documents." + ) for g in group_entries_with_structure_matcher(f_group_l, sm): struct_group = cls.from_grouped_entries( g, ignored_species=ignored_species @@ -210,6 +213,7 @@ def group_entries_with_structure_matcher( g, comp=lambda x, y: struct_matcher.fit(x.structure, y.structure, symmetric=True), ) + print(labs) for ilab in set(labs): sub_g = [g[itr] for itr, jlab in enumerate(labs) if jlab == ilab] yield [el for el in sub_g]