Fix median_speed call when returning confirmed trips #843
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #841
we added support for returning metrics based on confirmed trips.
This works for all the metrics that we support, except for median_speed, since
the trips don't have a list of speeds.
I first tried to fix this by adding a list of speeds to each trip, but was
worried about breaking the
ground_truth
comparison tests.So for now, if we are returning
confirmed_trips
, and there is nospeed
field, we concatenate the speeds lists from the sections to generate the speed
list for the trip.
we don't have a similar issue in the future