Loop fixes for upstreaming #61
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an initial fix for #49. I only really touched get_segments (plus the new helper functions in both gtfs_functions and aux_functions), so I'm not yet sure if I also would need to refactor get_segments_frequency(). For that reason (and also because I know this approach can still cause issues when a feed is built out-of-spec1 I've put it behind an option flag. Users initiate a feed with
fix_loops = True
in order to run with the new segments functionality.I appreciate any thoughts or insights on the method I'm using here. Software Engineering isn't my primary task or line of education.
Footnotes
For example, it is currently failing for UTA's Route 223 because some aspect of an upcoming change seem to have been incorporated into our feed early, breaking stop-line parity ↩