Skip to content
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

Remove filtering subway predictions by route #663

Merged
merged 2 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions lib/signs/realtime.ex
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,6 @@ defmodule Signs.Realtime do
defp fetch_predictions(%{sources: sources}, state) do
Enum.flat_map(sources, fn source ->
state.prediction_engine.for_stop(source.stop_id, source.direction_id)
|> Enum.filter(fn prediction ->
if source.routes == nil or prediction.route_id in source.routes do
true
else
Logger.info(
"filter_prediction_by_route sign_id=#{state.id} stop_id=#{source.stop_id} direction_id=#{source.direction_id} route_id=#{prediction.route_id}"
)

false
end
end)
end)
end

Expand Down
1 change: 0 additions & 1 deletion lib/signs/utilities/source_config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ defmodule Signs.Utilities.SourceConfig do

* stop_id: The GTFS stop_id that it uses for prediction data.
* routes: A list of routes that are relevant to this sign regarding alerts.
Predictions are also filtered based on this field.
* direction_id: 0 or 1, used in tandem with the stop ID for predictions
* platform: mostly null, but :ashmont | :braintree for JFK/UMass, where it's used for the "next
train to X is approaching, on the Y platform" audio.
Expand Down
Loading