-
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
bug: add_edge removes other edge #224
Comments
When we pass in edge data to the constructor, the |
Exactly, but only in the {id : members} format apparently H = xgi.Hypergraph({0: {1, 2}, 1: {1, 4}, 2: {0, 1, 8}, 3: {0, 3, 5}})
H._edge_uid
# -> count(0) # wrong But H = xgi.Hypergraph([{1, 2}, {1, 4}, {0, 1, 8}, {0, 3, 5}])
H._edge_uid
# -> count(4) # correct |
|
Yep, my conclusion too. |
* fix: #224 initialise uid counter when adding edges in some formats * tests: added for counter uid * fix: bug in copy with str id, and added test * style: ran black and isort * fix: check existence of id before adding edge * tests: added to check uid handling * refactor: replaced uid check by helper function * docs: removed note of copy() * fix: uid check for simplicial complexes and added tests * style: ran isort and black * fix: deal with potential tuple ID from merging edges * removed unused import
Create a Hypergraph:
Then remove an edge
But then, when adding a new hyperedge, [1,9,2], it is assigned the ID 0 already in use, and the previous hyperedge with ID 0 has disappeared:
It should just be assigned a new ID, probably 4. Not sure what is causing this yet.
Instead, specifying the ID explicitly works, and gives the expected result, but the above is still wrong:
The text was updated successfully, but these errors were encountered: