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

fix: always show route_pattern_prefix_overrides trips #685

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

nlwstein
Copy link
Contributor

@nlwstein nlwstein commented Oct 12, 2023

Summary of changes

Asana Ticket: [extra] 🐛🍎 API: Ashland stop disappeared on the Worcester Line

I lost my mind debugging this, but we were missing a case where a valid "canonical override" trip was falsely being flagged as non-canonical because it ended up in a list that was not checked against the configuration value.

This logic (and perhaps the approach overall) for assigning stops to routes seems like it may be overcomplicated for what we are trying to do. It may even make sense to have a hard coded source of truth that we conditionally override vs. reverse engineering stops from trips in the future.

Asana Ticket: 🍎 Update merge_ids logic for StopsOnRoute

For this (Boat-F6), I am suggesting that we just whack the hardcoded configuration - from my understanding of the code, the output we are currently seeing is correct. For reference, locally I am seeing:

NOT SPECIFIED: Boat-Aquarium, Boat-Fan, Boat-Quincy, Boat-Winthrop, Boat-Logan

INBOUND: Boat-Winthrop, Boat-Quincy, Boat-Logan, Boat-Fan, Boat-Aquarium

OUTBOUND: Boat-Aquarium, Boat-Fan, Boat-Quincy, Boat-Winthrop

According to the PDF schedule and my reading of the static schedule in GTFS, that is correct: https://cdn.mbta.com/sites/default/files/media/route_pdfs/2023-10-02-winthrop-ferry-weekday-schedule-effective-through-november-30-2023.pdf

I have removed the overrides as they state Logan is in both directions, which conflicts with this paper schedule.

Some extra context can be found here, though honestly stepping through this code with a debugger gave me a better understanding than anything else 💫

@github-actions
Copy link

Coverage of commit 8933b61

Summary coverage rate:
  lines......: 89.2% (4101 of 4596 lines)
  functions..: 70.9% (2224 of 3138 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/state/lib/state/helpers.ex                                       |93.8%     16| 100%     3|    -      0
  apps/state/lib/state/stops_on_route.ex                                |94.9%     99|96.7%    30|    -      0

Download coverage report

@nlwstein nlwstein requested review from bfauble and removed request for bfauble October 12, 2023 14:02
@nlwstein nlwstein marked this pull request as ready for review October 12, 2023 14:45
@nlwstein
Copy link
Contributor Author

@bfauble I updated this branch to not remove the override to avoid the unordered Logan. I suggest that we close the investigation ticket and either make a follow up ticket to support overriding global stop order (IE: when pulling stops without a direction_Id specified) or leave as-is and hopefully refactor the entire approach at some point.

@nlwstein nlwstein merged commit 8622f50 into master Oct 13, 2023
6 checks passed
@github-actions
Copy link

Coverage of commit 289aef0

Summary coverage rate:
  lines......: 89.2% (4104 of 4600 lines)
  functions..: 70.9% (2225 of 3139 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/state/lib/state/helpers.ex                                       |93.8%     16| 100%     3|    -      0

Download coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants