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

🧠 Implement "uncertainty adapter" within Concentrate #346

Merged
merged 13 commits into from
Apr 26, 2024
Prev Previous commit
Next Next commit
reverse_trip not reverse_prediction
bfauble committed Mar 21, 2024
commit 282e28e6bb325637468141a24fb43de76408dc0e
2 changes: 1 addition & 1 deletion lib/concentrate/parser/gtfs_realtime_enhanced.ex
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ defmodule Concentrate.Parser.GTFSRealtimeEnhanced do

defp calculate_uncertainty("mid_trip"), do: 60
defp calculate_uncertainty("at_terminal"), do: 120
defp calculate_uncertainty("reverse_prediction"), do: 360
defp calculate_uncertainty("reverse_trip"), do: 360

defp schedule_relationship(nil), do: :SCHEDULED

4 changes: 2 additions & 2 deletions test/concentrate/parser/gtfs_realtime_enhanced_test.exs
Original file line number Diff line number Diff line change
@@ -428,13 +428,13 @@ defmodule Concentrate.Parser.GTFSRealtimeEnhancedTest do
assert stu.uncertainty == 120
end

test "decodes reverse_prediction update_type to determine uncertainty value" do
test "decodes reverse_trip update_type to determine uncertainty value" do
update = %{
"trip" => %{
"trip_id" => "trip",
"route_id" => "route"
},
"update_type" => "reverse_prediction",
"update_type" => "reverse_trip",
"stop_time_update" => [
%{
"arrival" => %{"time" => 100, "uncertainty" => 500},