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
239 stars 57 forks source link

stop_times_int is never calculated #15

Closed kuanb closed 7 years ago

kuanb commented 7 years ago

I'm not certain this is the case, but am a bit confused as it appears that, although stop_times_int is instantiated during the init of a class object from this class, it is never updated.

Specifically, in urbanaccess.gtfs.load.gtfsfeed_to_df, in load.py, the following attributes are updated:

    # set gtfsfeeds_df object to merged GTFS dfs
    gtfsfeeds_df.stops = merged_stops_df
    gtfsfeeds_df.routes = merged_routes_df
    gtfsfeeds_df.trips = merged_trips_df
    gtfsfeeds_df.stop_times = merged_stop_times_df
    gtfsfeeds_df.calendar = merged_calendar_df
    gtfsfeeds_df.calendar_dates = merged_calendar_dates_df

That is, all but stop_times_int. Yet, subsequent steps, such as urbanaccess.gtfs.headways.headways check to ensure that stop_times_int is not False or .empty(). I suspect there is an intermediary step that is missing (?).

kuanb commented 7 years ago

Looking at this a bit more, it seems that the sole purpose of that attribute is to be fed through timeselector(). If that is the case, and we just want interpolated departure times, then perhaps it might make more sense to just include this on the main stop_times data frame as an additional column, rather than a whole new dataframe?

kuanb commented 7 years ago

Looks like in network.py create_transit_net(), it's calculated:

gtfsfeeds_df.stop_times_int = interpolatestoptimes(stop_times_df=gtfsfeeds_df.stop_times,
     calendar_selected_trips_df=calendar_selected_trips_df, day=day)

gtfsfeeds_df.stop_times_int = timedifference(stop_times_df=gtfsfeeds_df.stop_times_int)

If that works, I'll just make a note of it here and close this out.

sablanchard commented 7 years ago

Yes that is correct. This repo is still in alpha so things like your suggestion for the function underscores would be really helpful in cases like these where specific functions are not designed to be run in isolation. Also a demo for a the full workflow is still in progress but will be here soon. Please close this when you can.