Unreachable code in ColoredHyperGraph, ColoredHyperGraphView, and CombinatorialComplex
gurug-dev opened this issue · 0 comments
gurug-dev commented
What/Where?
- CHG -
degree_matrix
, line 1125
incidence_matrix will never be 0,0 shape due to compute_set_incidence
- CHG -
laplacian_matrix
, line 1163
adjacency_matrix will never be 0,0 shape due to compute_set_incidence
- CHG/CCC -
_remove_hyperedge
the case -> isinstance(hyperedge, Hashable) and not isinstance(hyperedge, Iterable)
is not valid as previous check if hyperedge not in self.cells
filters out any object not already present in self.cells and self.cells can only contain hashable and iterable elements like frozenset, etc
- CHGView -
__contains__
elif isinstance(hyperedge_elements, HyperEdge)
case is unreachable as hyperedge_elements is unpacked earlier if it is HyperEdge object.
- CCC -
_CCC_condition
method is not well defined,CCC._node_membership
is an empty set for a defined CCC.
Eg.,
combinatorial_complex = CombinatorialComplex([[1, 2, 3], [2, 3, 4]], ranks=2)
combinatorial_complex._CCC_condition([None], 2) #doesn't throw an error.