pyt-team/TopoNetX

Unreachable code in ColoredHyperGraph, ColoredHyperGraphView, and CombinatorialComplex

gurug-dev opened this issue · 0 comments

What/Where?

  1. CHG - degree_matrix, line 1125

incidence_matrix will never be 0,0 shape due to compute_set_incidence

  1. CHG - laplacian_matrix, line 1163

adjacency_matrix will never be 0,0 shape due to compute_set_incidence

  1. 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.cellsfilters out any object not already present in self.cells and self.cells can only contain hashable and iterable elements like frozenset, etc

  1. CHGView - __contains__

elif isinstance(hyperedge_elements, HyperEdge) case is unreachable as hyperedge_elements is unpacked earlier if it is HyperEdge object.

  1. 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.