-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: use last predicted stop as added trip headsign #839
Conversation
Coverage of commit
|
Comparison from today's RL disruption with service suspended between Harvard and Broadway:
dev-green:
(Added trip IDs are not consistent between environments. I found these to compare by downloading the Prod/Green RT feeds and finding the predictions for vehicle |
@@ -56,6 +56,10 @@ defmodule State.Trip.Added do | |||
with %{route_pattern_id: route_pattern_id} when is_binary(route_pattern_id) <- prediction, | |||
%{representative_trip_id: rep_trip_id} <- State.RoutePattern.by_id(route_pattern_id), | |||
[trip | _] <- State.Trip.by_id(rep_trip_id) do | |||
stop = parent_or_stop(prediction.stop_id) |
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.
would this make the headsign different for each prediction? it seems like it's applying it to every prediction along the trip rather than applying the last stop's prediction's stopname as the headsign
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.
Sorry, I should've called this out. Only the last prediction ever makes it to this function due to the reduce here. I can add the requested test to help demonstrate that.
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.
ah that makes sense, misread it as a simple sorting rather than just keeping the last 👍
%{prediction: prediction} do | ||
insert_predictions([prediction]) | ||
assert [%{headsign: "Last Stop on Shape"}] = by_id(@trip_id) | ||
assert [%{headsign: "Parent"}] = by_id(@trip_id) |
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.
is it possible to add multiple predictions to verify that the headsign is being properly set for multiple predictions on the same trip?
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.
Test updated to use multiple predictions. There's also this test on for the route_pattern side that tests the same thing so this has us covering both the shape and route pattern sides of this functionality.
3e27228
to
358b6b2
Compare
Coverage of commit
|
Summary of changes
Asana Ticket: 🍎 Adjust API headsign logic for ADDED trips
[Please include a brief description of what was changed]