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
Describe the bug
The __getattr__ method of hypernetx.classes.hyp_view.AttrList relies on self._level being set, but it is never initialized. As a result, many attribute accesses (e.g., .elements) return empty values.
To Reproduce
Steps to reproduce the behavior:
Create a simple Hypergraph, using list of lists, e.g. H.
Iterate on H.edges, eg: for e in H.edges:
Print elements : print(H.edges[e].elements)
You will see empty lists, regardless of graph contents.
Expected behavior
The edges should be displayed as lists of nodes. If you instead access .data (i.e., H.edges[e].data), the correct values are returned. This is because __getattr__ on .elements uses .data only when self._level is 0.
Screenshots
N/A
Environment (please complete the following information):
OS: Arch Linux, Kernel version : 6.13.6
Python Version: 3.13.12
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Describe the bug
The
__getattr__
method ofhypernetx.classes.hyp_view.AttrList
relies onself._level
being set, but it is never initialized. As a result, many attribute accesses (e.g.,.elements
) return empty values.To Reproduce
Steps to reproduce the behavior:
H
.H.edges
, eg:for e in H.edges:
print(H.edges[e].elements)
Expected behavior
The edges should be displayed as lists of nodes. If you instead access
.data
(i.e.,H.edges[e].data
), the correct values are returned. This is because__getattr__
on.elements
uses.data
only whenself._level
is0
.Screenshots
N/A
Environment (please complete the following information):
Additional context
N/A
The text was updated successfully, but these errors were encountered: