-
Notifications
You must be signed in to change notification settings - Fork 30
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
Views should be read-only #371
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #371 +/- ##
==========================================
+ Coverage 90.58% 90.74% +0.16%
==========================================
Files 41 42 +1
Lines 3060 3113 +53
==========================================
+ Hits 2772 2825 +53
Misses 288 288
☔ View full report in Codecov by Sentry. |
Nice! Could you add a quick test for that? |
Good point! Just did. |
# test that members are copies in memory | ||
H.edges.members(0).add("a") | ||
assert "a" not in H.edges.members(0) | ||
|
||
e = H.edges.members() | ||
e[0].add("a") | ||
assert "a" not in H.edges.members(0) | ||
|
||
e = H.edges.members(dtype=dict) | ||
e[0].add("a") | ||
assert "a" not in H.edges.members(0) |
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.
I'd rather this be a separate test :)
I found a bug where
H.edges.members()
creates a list with entries that are references toH._edge
and so modifyingH.edges.members()
modifies the internal data structure. Same withH.nodes.memberships()
. Also modified a few of the docstrings.