-
Notifications
You must be signed in to change notification settings - Fork 890
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
EntitySet.concat() reindexes relationships #96
Conversation
Codecov Report
@@ Coverage Diff @@
## master #96 +/- ##
=========================================
- Coverage 87.62% 87.6% -0.02%
=========================================
Files 73 73
Lines 7191 7207 +16
=========================================
+ Hits 6301 6314 +13
- Misses 890 893 +3
Continue to review full report at Codecov.
|
for i, related in index_map.items(): | ||
if i not in other.indexed_by[v]: | ||
return False | ||
if not (np.sort(related) == np.sort(other.indexed_by[v][i])).all(): |
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.
can you leave a comment in the code what this line is checking?
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.
done
# indexed_by maps instances of two entities together by lists | ||
# We want to check that all the elements of the lists of instances | ||
# for each relationship are the same in both entities being | ||
# checked for equality, but don't care about the order. | ||
if not (np.sort(related) == np.sort(other.indexed_by[v][i])).all(): |
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 the comment. can this line just be set(related) != set(other.indexed_by[v][i])
?
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.
yeah that should work too
Looks good. merging |
Resolves #83