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: only adjust headsign to last predicted stop on subway routes #840

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

Whoops
Copy link
Collaborator

@Whoops Whoops commented Nov 25, 2024

@Whoops Whoops requested review from a team and bfauble and removed request for a team November 25, 2024 19:15
Copy link

Coverage of commit 01924c7

Summary coverage rate:
  lines......: 89.1% (4234 of 4754 lines)
  functions..: 70.2% (2288 of 3260 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/state/lib/state/trip/added.ex                                    | 100%     50|74.5%    47|    -      0

Download coverage report

# A large number of unrelated tests end up calling this function without
# having set up a route, from predictions to the rate limiter, so we
# guard against that here
route_type = if route, do: route.type
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of this, you could update the subway? function definition to something like....

defp subway?(%Route{type: type}), do: subway?(type)
defp subway?(type) when type in [0, 1], do: true
defp subway(_), do: false

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, thanks!

Copy link
Contributor

@bfauble bfauble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small thing, then 👍

Copy link

Coverage of commit 79eea68

Summary coverage rate:
  lines......: 89.1% (4237 of 4755 lines)
  functions..: 70.2% (2288 of 3260 functions)
  branches...: no data found

Files changed coverage rate:
                                                                        |Lines       |Functions  |Branches    
  Filename                                                              |Rate     Num|Rate    Num|Rate     Num
  ============================================================================================================
  apps/state/lib/state/trip/added.ex                                    | 100%     51|74.5%    47|    -      0

Download coverage report

@Whoops Whoops merged commit ec44bb5 into master Nov 27, 2024
7 checks passed
@Whoops Whoops deleted the wh-added-headsigns-subway branch November 27, 2024 18:09
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