-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Filter out redundant outside elevator closures #2328
Conversation
1d8af7a
to
d5c12d4
Compare
#!/usr/bin/env -S ERL_FLAGS=+B elixir | ||
|
||
# Script used to format the spreadsheet found at | ||
# https://docs.google.com/spreadsheets/d/1lHogme-2SuDSgjrRK52k7yVgSFK-v_LMmUfkYgBJjIU/edit?gid=179933470#gid=179933470 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It occurs to me that this spreadsheet probably doesn't need to be public to the world, as the original copy is, given we are not programmatically downloading it. But we'd have to figure out what we're doing about access control on the team.
d5c12d4
to
c6d3ed2
Compare
61177c3
to
53e79fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor question. I'm also noticing there are no new/updated tests for this behavior; we should have something there.
# relevant at other stations. | ||
defp relevant_alert?(alert, home_stop_id) do | ||
relevant_effect?(alert) and informs_one_facility?(alert) and | ||
(Alert.informs_stop_id?(alert, home_stop_id) or not has_nearby_redundancy?(alert)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an alert informs a facility, does it also always inform the facility's parent station? This isn't necessarily true of GTFS in general but I'd believe that it's a guarantee of our alerts implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell, yes. I think it always includes the parent + every child stop not flagged for exclusion in the properties
field for the facility.
Thanks for the callout. Added a test for this. I'm not sure I'm happy with how I handled the file path now that we have a test fixture so any suggestions is appreciated. |
21f85dc
to
2344e9b
Compare
2344e9b
to
80e8623
Compare
Adds alert filtering based on presence of a redundant elevator. Only affects alerts outside the current station. CSV is here. Add some instructions to the script just in case the data is updated.