Fix time calculations in insert_one_edge#278
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #278 +/- ##
==========================================
- Coverage 94.12% 94.07% -0.05%
==========================================
Files 51 51
Lines 6821 6823 +2
==========================================
- Hits 6420 6419 -1
- Misses 401 404 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
That's great @leoniedu, thank you very much for finding that bug. I've modified your code a bit, only to try to make it a bit clearer what is actually happening. Under each of my comments, you should see a button to "Commit Suggestion". If you click each of those, and maybe reformat a little, you should see something like this: if (!is.na (gr_cols$time)) {
graph [index, gr_cols$time] <- d1 * time_scale
graph [index + 1, gr_cols$time] <- d2 * time_scale
graph [index, gr_cols$time_weighted] <- d1 * time_scale * time_wt
graph [index + 1, gr_cols$time_weighted] <- d2 * time_scale * time_wt
}I think having the explicit Great that you included tests too! If i had have had that in there, this would never have happened. Nice! |
Co-authored-by: mark padgham <mark.padgham@email.com>
Co-authored-by: mark padgham <mark.padgham@email.com>
Co-authored-by: mark padgham <mark.padgham@email.com>
Co-authored-by: mark padgham <mark.padgham@email.com>
Co-authored-by: mark padgham <mark.padgham@email.com>
Co-authored-by: mark padgham <mark.padgham@email.com>
Propose fix to #277
Basically the code was not updating the time values for index + 1