Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBugfix 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.
|
|
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 |
|
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
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_nodesand some minor manipulation fixes this issue.The Tests So It is Not Merged Again
Units tests have been added to:
statsinbaseballstats), confirm node level statistics are calculated and assigned correctlyslugging_avginbaseballstats), confirm node level statistics are calculated and assigned correctlyKingOfTheEarthinmilne), confirm node level statistics are calculated and assigned correctlyNote, changes to these unit tests will be required when:
baseballstatsormilneis changed