Skip to content
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

Merged
merged 6 commits into from
Mar 19, 2018
Merged

Conversation

bschreck
Copy link
Contributor

Resolves #83

@codecov-io
Copy link

codecov-io commented Feb 17, 2018

Codecov Report

Merging #96 into master will decrease coverage by 0.01%.
The diff coverage is 75%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
...aturetools/tests/entityset_tests/test_pandas_es.py 99.72% <100%> (ø) ⬆️
featuretools/entityset/entityset.py 89.84% <100%> (+0.04%) ⬆️
featuretools/entityset/base_entity.py 76.78% <60%> (-1.07%) ⬇️
featuretools/entityset/entity.py 77.19% <0%> (+0.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98eab54...fea469e. Read the comment docs.

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():
Copy link
Contributor

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?

Copy link
Contributor Author

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():
Copy link
Contributor

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])?

Copy link
Contributor Author

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

@kmax12
Copy link
Contributor

kmax12 commented Mar 19, 2018

Looks good. merging

@kmax12 kmax12 merged commit 44b8cef into master Mar 19, 2018
@rwedge rwedge mentioned this pull request Mar 21, 2018
@rwedge rwedge deleted the entityset-concat-index branch June 3, 2019 15:44
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

Successfully merging this pull request may close these issues.

3 participants