Skip to content

Commit

Permalink
Oops, remove now-commented-out code
Browse files Browse the repository at this point in the history
  • Loading branch information
jzimbel-mbta committed Aug 23, 2024
1 parent a099f37 commit 2b4737f
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions reports/glides_terminal_departure_accuracy.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -380,28 +380,6 @@ variances = [1, 2, 3, 5, 10]
# OVERALL VALUES #
##################

# This is just trip_updates now
# predicted_departure_times =
# trip_updates
# |> Stream.flat_map(fn tr_upd ->
# Enum.map(
# tr_upd.trip_update.stop_time_update,
# &{&1.stop_id, &1.departure.time}
# )
# end)
# |> then(fn stream ->
# if not is_nil(top_twos) do
# Stream.filter(stream, &(&1 in top_twos))
# else
# stream
# end
# end)
# |> MapSet.new()

# This is just vehicle_positions now
# actual_departure_times =
# MapSet.new(vehicle_positions, &{&1.vehicle.stop_id, &1.vehicle.timestamp})

merge_sorted_ranges = fn l1.._r1//1, _l2..r2//1 ->
l1..r2//1
end
Expand Down Expand Up @@ -474,8 +452,6 @@ accurate_predictions_by_variance =
# VALUES BUCKETED BY HOUR #
###########################

# predicted_departure_times_by_hour = GlidesReport.Util.group_by_hour(predicted_departure_times)
# actual_departure_times_by_hour = GlidesReport.Util.group_by_hour(actual_departure_times)
predictions_by_hour =
trip_updates
|> Enum.group_by(&(&1.hour))
Expand All @@ -500,6 +476,7 @@ accurate_predictions_by_variance_by_hour =
Enum.map(departures, &{variance, &1})
end)
# Then, group by hour.
# %{hour => [{variance, Departure.t()}]}
|> Enum.group_by(
fn {_variance, departure} -> GlidesReport.Util.unix_timestamp_to_local_hour(departure.timestamp) end
)
Expand Down Expand Up @@ -635,4 +612,4 @@ VegaLite.new(width: 500, height: 300, title: "Percent accurate by bucket size")
|> VegaLite.encode_field(:y, "Accuracy (% of total predictions)", type: :quantitative)
```

<!-- livebook:{"offset":21700,"stamp":{"token":"XCP.oK-p-YHE3YsO0s9LHZdFdErkXTgBhp6aL46BIQCpxqLUtoGSaQ3NWPgNfLrVNkW2BqELQjVVaHztOKeY308yLZB0Vzt07Yum3-aA5TwUWZ5CFGCLOeEyrKLcKMuQUYbp2MS5ZHqdMrxwUIA55yQgzfpt7vgn7w","version":2}} -->
<!-- livebook:{"offset":21004,"stamp":{"token":"XCP.ATSOu_rP6RFgFvvRZ8paHaYkONVoffsyAdmyIND0CfyQSMJxlziipu5OMXp5vqkt5OHUi9quQtj_LASJHZq97-MmF2piU3uDc7VWoRBxn841hEBczhokS0oqxciRmKgWE8Do_GFXpC5Ob4dg5D_3FCiqht-iwg","version":2}} -->

0 comments on commit 2b4737f

Please sign in to comment.