Skip to content

Commit

Permalink
Retrieve number of partitions more intuitively
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCBrammer committed Aug 23, 2024
1 parent 02aa89c commit abb3c9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tucan/canonicalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def partition_molecule_by_attribute(m: nx.Graph, attribute: str) -> nx.Graph:


def get_number_of_partitions(m: nx.Graph) -> int:
return max(nx.get_node_attributes(m, PARTITION).values())
return len(set(nx.get_node_attributes(m, PARTITION).values()))


def refine_partitions(m: nx.Graph) -> Generator[nx.Graph, None, None]:
Expand Down

0 comments on commit abb3c9b

Please sign in to comment.