Skip to content

hypernetx.classes.hyp_view.AttrList _level is None #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rkspsm opened this issue Apr 12, 2025 · 2 comments
Closed

hypernetx.classes.hyp_view.AttrList _level is None #169

rkspsm opened this issue Apr 12, 2025 · 2 comments

Comments

@rkspsm
Copy link

rkspsm commented Apr 12, 2025

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:

  1. Create a simple Hypergraph, using list of lists, e.g. H.
  2. Iterate on H.edges, eg: for e in H.edges:
  3. Print elements : print(H.edges[e].elements)
  4. 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

@brendapraggastis
Copy link
Collaborator

Thanks @rkspsm for the catch. Hotfix will show up shortly.

@ryandanehy
Copy link
Collaborator

Hi @rkspsm hotfix was pushed last week. Issue should be resolved by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants