UDST / urbanaccess

A tool for GTFS transit and OSM pedestrian network accessibility analysis by UrbanSim
https://udst.github.io/urbanaccess/index.html
GNU Affero General Public License v3.0
236 stars 56 forks source link

gtfs import fails if `calendar_dates.txt` is missing #69

Closed knaaptime closed 3 years ago

knaaptime commented 4 years ago

calendar_dates.txt is an optional file, but this line raises an error if it's missing. Could this be changed to a warning instead?

sablanchard commented 4 years ago

thanks for the report @knaaptime , if that file is missing that function should never be active. Its only active when there is a txt with that name in the directory via https://github.com/UDST/urbanaccess/blob/09a0133af588b4ba5e1e8c4ac589b5f859d73a62/urbanaccess/gtfs/load.py#L280. It looks like you may have that file but its empty with no records.

I think in this case since its optional I agree it can be changed to a warning. I would want to run a test after the change to make sure allowing an empty df for that file wont impact anything else downstream. If you are open to it, would you like to make a PR with the change and then Ill run a test on it to double check things before we merge it?

knaaptime commented 4 years ago

yup, thats what i meant thanks. will PR

also, some feeds like wmata go with calendar_dates.txt and omit calendar.txt, which is technically allowed. Would you be open to relaxing the check here so that it passes so long as one of the two files is present (or is calendar.txt hardwired into the processing somehow?)

sablanchard commented 4 years ago

that sounds like a great idea @knaaptime . Its like that only because of legacy, the calendar_dates support was added later and is harder for most users to understand how to use correctly to subset the network so it was intentionally discouraged however, there is no need to do that now.

In addition, if there is anything in the calendar dates workflow that you see could be improved or usability could be improved please let us know, open to suggestions.

Agreed in that approach to do a validation check to make sure that at least one of those two files are present and if they are that at least one of them is not empty. Much appreciated your contributions and suggestions!