Reading of GTFS frequencies.txt is inconsistently implemented and not reliably read
carlhiggs opened this issue · 0 comments
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.