-
Notifications
You must be signed in to change notification settings - Fork 33
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
Cleanup method #161
Cleanup method #161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! BTW, does this depend on #162?
Also, should we add a parameter in_place
? If in_place
is False, then a new hypergraph is returned and the original one is left intact. This might simplify some of the code inside the if reindex:
branch.
a7fc9b5
to
639c2ff
Compare
Pro tip: next time try rebasing your PR rather than merging main into it bc it makes it hard to review. The current diff shows both changes from this PR as well as the other one. If rebasing does not work/is scary, you can also just close it and start a new PR. |
duplicates()
method to not include the first instance of the node/edge in the list of duplicates, so that when you callH.remove_edges_from(H.edges.duplicates())
it only removes the redundant edges, not all of the edges. In preparation of only supporting non-loopy edges, theduplicates()
method has been simplified to not differentiate between duplicate nodes in an edge.