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

Reading of GTFS frequencies.txt is inconsistently implemented and not reliably read #389

Closed
carlhiggs opened this issue Mar 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@carlhiggs
Copy link
Member

Describe the bug
Historically, reading of frequencies.txt in GTFS feeds (an optional file) was done as part of our code, checking if the file existed within a folder, else setting as an empty string. However, last year we shifted to using a GTFS library (gtfs-lite) that can read GTFS files from zip files, including the GTFS frequencies text file (if it exists, else None).

However, we never ported the frequencies reading code over to ensure that where this file exists it is read when included in a zip file (ie. if the configured gtfs feed were a zip file, it would be skipped).

The very concrete implication of this is that for a zipped gtfs feed of Madrid Metro, analysis would result in 0/290 metro stops aligned with departure times instead of 290/290. This issue was reported by @marcdmallafre.

The fix is simple: rather than use our own code to seperately check for and read in frequencies.txt, use the loaded_feeds.frequencies object (if it doesn't exist, it has value of None). This fixes the issue.

@carlhiggs carlhiggs added the bug Something isn't working label Mar 12, 2024
@carlhiggs carlhiggs self-assigned this Mar 12, 2024
carlhiggs added a commit that referenced this issue Mar 12, 2024
carlhiggs added a commit that referenced this issue Mar 12, 2024
addressed frequncies.txt misreading, to ensure the copy read by gtfs-lite is used, as per #389
carlhiggs added a commit that referenced this issue Mar 15, 2024
…erms of length (!=0) rather than 'is not None', to avoid edge case crash for TMB Barcelona reported by @marcdmallafre; relate to changes made for #389
@carlhiggs carlhiggs mentioned this issue May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant