Conversation
|
Fairly wonky stub for this idea. Needs more work but seems to be functional already. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #908 +/- ##
==========================================
+ Coverage 96.17% 96.19% +0.02%
==========================================
Files 79 79
Lines 4625 4629 +4
Branches 1469 1477 +8
==========================================
+ Hits 4448 4453 +5
Misses 27 27
+ Partials 150 149 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #908 will not alter performanceComparing Summary
|
pyvrp/cpp/Route.cpp
Outdated
| auto const div = std::max<size_t>(size(), 1); // max 1 avoids zero div | ||
| centroid_.first += (x.get() * trip.size()) / div; | ||
| centroid_.second += (y.get() * trip.size()) / div; |
There was a problem hiding this comment.
I think this was a subtle bug, because size() can be zero for empty routes.
leonlan
left a comment
There was a problem hiding this comment.
LGTM. Just one thing in the quick tutorial that we should update:
PyVRP automatically converts all numeric input values to integers. If your data has decimal values, you must scale and convert them to integers first to avoid unexpected behaviour.
I don't think we'll make any of the other parameters float anytime soon, so we can just change it like this:
PyVRP automatically converts all numeric inputs to integers, except for client
xandycoordinates. If your data has decimal values, you must scale and convert them to integers first to avoid unexpected behaviour.
|
Forgot about the tutorial, thanks! |

This PR:
TODO:
std::pair<double, double> centroidtostd::pair<Coordinate, Coordinate>Details
Notes:
Please read our contributing guidelines first.
In particular:
This keeps the code coverage level up, and helps ensure the changes work as intended.
Please check that this PR can be included into PyVRP under the MIT license.