-
Notifications
You must be signed in to change notification settings - Fork 37
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
Bugfix Nodes Table Merging #166
Conversation
Codecov Report
@@ Coverage Diff @@
## master #166 +/- ##
==========================================
+ Coverage 84.69% 90.51% +5.81%
==========================================
Files 10 10
Lines 915 938 +23
==========================================
+ Hits 775 849 +74
+ Misses 140 89 -51
Continue to review full report at Codecov.
|
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.
LGTM. Thanks for adding the unit tests.
As an FYI @bburns632, I had been toying a while ago with a major refactor of how we handling the igraph object and the different node and graph measures. Here: https://github.com/jayqi/pkgnet/blob/feature/graph-refactor/R/AbstractGraphReporter.R#L305-L629
It's a pretty major change and I didn't want to open a PR before we put out 3.2. But I think it makes things more modular and potentially easier to test.
Looks like I had implemented my node measure assignment to protect against this bug as well. https://github.com/jayqi/pkgnet/blob/feature/graph-refactor/R/AbstractGraphReporter.R#L320-L335
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.
Nice work! Really elegant fix, and I'm confident the tests you wrote will prevent us from reintroducing this bug. Well done.
@jayqi I'm looking forward to that upcoming refactor. It looks clean and probably easier to test. Thanks for holding off for the moment. |
268da81
to
983f382
Compare
The Issue
Node level statistics are being merged out of order causing issue #165.
As currently written, node statistics are merged under this paradigm:
However,
pkg_graph
(which drives the order of outDegreeResult) and the nodes table,outNodeDT
, have different node orders:This causes the mismatch seen in #165.
The Fix
Utilizing the existing method
update_nodes
and some minor manipulation fixes this issue.The Tests So It is Not Merged Again
Units tests have been added to:
stats
inbaseballstats
), confirm node level statistics are calculated and assigned correctlyslugging_avg
inbaseballstats
), confirm node level statistics are calculated and assigned correctlyKingOfTheEarth
inmilne
), confirm node level statistics are calculated and assigned correctlyNote, changes to these unit tests will be required when:
baseballstats
ormilne
is changed