You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There were a couple of bugs w.r.t get_rank method in Hyperedge View.
Details
The relevant code is present below
defget_rank(self, e):
"""Get rank. Parameters ---------- e : Iterable, Hashable or HyperEdge Returns ------- int, the rank of the hyperedge e """ifisinstance(e, Iterable):
iflen(e) ==0:
return0else:
foriinlist(self.allranks):
iffrozenset(e) inself.hyperedge_dict[i]:
returniraiseKeyError(f"hyperedge {e} is not in the complex")
elifisinstance(e, HyperEdge):
iflen(e) ==0:
return0else:
foriinlist(self.allranks):
iffrozenset(e.elements) inself.hyperedge_dict[i]:
returniraiseKeyError(f"hyperedge {e} is not in the complex")
elifisinstance(e, Hashable) andnotisinstance(e, Iterable):
ifeinself.hyperedge_dict[0]:
return0else:
raiseKeyError(f"hyperedge {e} is not in the complex")
elifisinstance(e, str):
ifeinself.hyperedge_dict[0]:
return0else:
raiseKeyError(f"hyperedge {e} is not in the complex")
Bugs
The hyperedge case in the above if-else block is never triggered because hyperedge itself is Iterable.
The str case in the above if-else block is never triggered because str itself is Iterable.
The cases where e is int or str never evaluates to True, because the int/str are not present in hyperedge_dict, but rather frozenset({e}) is
The text was updated successfully, but these errors were encountered:
What
There were a couple of bugs w.r.t get_rank method in Hyperedge View.
Details
The relevant code is present below
Bugs
e
isint
orstr
never evaluates toTrue
, because the int/str are not present inhyperedge_dict
, but ratherfrozenset({e})
isThe text was updated successfully, but these errors were encountered: