Skip to content

Commit

Permalink
tested structure grouping builder
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmshn committed Feb 4, 2021
1 parent 03c9d16 commit 11de9c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions emmet-builders/emmet/builders/materials/electrodes.py
Expand Up @@ -305,14 +305,14 @@ def _remove_targets(self, rm_ids):
#
# def modify_item(item):
# self.logger.debug(
# f"Looking for {len(item['grouped_task_ids'])} task_ids in the Thermo DB."
# f"Looking for {len(item['grouped_ids'])} task_ids in the Thermo DB."
# )
# with self.thermo as store:
# thermo_docs = [
# *store.query(
# {
# "$and": [
# {"task_id": {"$in": item["grouped_task_ids"]}},
# {"task_id": {"$in": item["grouped_ids"]}},
# {"_sbxn": {"$in": ["core"]}},
# ]
# },
Expand Down
7 changes: 4 additions & 3 deletions emmet-core/emmet/core/structure_group.py
Expand Up @@ -23,10 +23,10 @@ def generic_groupby(list_in, comp=operator.eq) -> List[int]:
Returns:
[int] list of labels for the input list
"""
list_out = [None] * len(list_in)
list_out = [-1] * len(list_in)
label_num = 0
for i1, ls1 in enumerate(list_out):
if ls1 is not None:
if ls1 != -1:
continue
list_out[i1] = label_num
for i2, ls2 in list(enumerate(list_out))[i1 + 1 :]:
Expand Down Expand Up @@ -57,7 +57,8 @@ class StructureGroupDoc(BaseModel):
structure_matched: bool = Field(
None,
description="True if the structure matching was performed to group theses entries together."
"This is False for groups that contain all the left over entries like the ones that only contain the ignored species.",
"This is False for groups that contain all the left over entries like the ones that only "
"contain the ignored species.",
)

has_distinct_compositions: bool = Field(
Expand Down

0 comments on commit 11de9c2

Please sign in to comment.