Example #1
0
File: tph.py Project: ouyangjn/tph
        else:
            override_direction = False
        target_routes = config.get(section, 'target_routes').split(',')
        target_routes = [route.strip() for route in target_routes]
        target_stopid = config.get(section, 'target_stopid')
        outfile = config.get(section, 'outfile')
        args = {}
        if config.has_option(section, 'direction_0_routes') and \
               config.has_option(section, 'direction_1_routes'):
            args['direction_0_routes'] = [route.strip() for route in \
                                          config.get(section,
                                                     'direction_0_routes').split(',')]
            args['direction_1_routes'] = [route.strip() for route in \
                                          config.get(section,
                                                     'direction_1_routes').split(',')]

        if config.has_option(section, 'direction_0_terminals') and \
               config.has_option(section, 'direction_1_terminals'):
            args['direction_0_terminals'] = [route.strip() for route in \
                                             config.get(section,
                                                        'direction_0_terminals').split(',')]
            args['direction_1_terminals'] = [route.strip() for route in \
                                             config.get(section,
                                                        'direction_1_terminals').split(',')]

        (results,
         target_stop_name) = find_service(schedule, target_date, target_routes,
                                          target_stopid, override_headsign,
                                          override_direction, **args)
        plot_service(results, target_stop_name, target_date, outfile)
Example #2
0
File: tph.py Project: booherbg/tph
        target_routes = [route.strip() for route in target_routes]
        target_stopid = config.get(section, 'target_stopid')
        outfile = config.get(section, 'outfile')
        args = {}
        if config.has_option(section, 'direction_0_routes') and \
               config.has_option(section, 'direction_1_routes'):
            args['direction_0_routes'] = [route.strip() for route in \
                                          config.get(section,
                                                     'direction_0_routes').split(',')]
            args['direction_1_routes'] = [route.strip() for route in \
                                          config.get(section,
                                                     'direction_1_routes').split(',')]

        if config.has_option(section, 'direction_0_terminals') and \
               config.has_option(section, 'direction_1_terminals'):
            args['direction_0_terminals'] = [route.strip() for route in \
                                             config.get(section,
                                                        'direction_0_terminals').split(',')]
            args['direction_1_terminals'] = [route.strip() for route in \
                                             config.get(section,
                                                        'direction_1_terminals').split(',')]

        (results, target_stop_name) = find_service(schedule, target_date,
                                                   target_routes,
                                                   target_stopid,
                                                   override_headsign,
                                                   override_direction,
                                                   **args)
        print outfile
        plot_service(results, target_stop_name, target_date, outfile)
Example #3
0
File: tph.py Project: caywood/tph
                                          config.get(section,
                                                     'direction_1_routes').split(',')]

        if config.has_option(section, 'direction_0_terminals') and \
               config.has_option(section, 'direction_1_terminals'):
            args['direction_0_terminals'] = [route.strip() for route in \
                                             config.get(section,
                                                        'direction_0_terminals').split(',')]
            args['direction_1_terminals'] = [route.strip() for route in \
                                             config.get(section,
                                                        'direction_1_terminals').split(',')]

        (results, target_stop_name, timelist_0, spacing_0, worstspacing_0, timelist_1, spacing_1, worstspacing_1) = \
            find_service(schedule, target_date, intervals,
                                                   target_routes,
                                                   target_stopid,
                                                   override_headsign,
                                                   override_direction,
                                                   **args)
        plot_service(results, target_stop_name, target_date, intervals, outfile)

        (headsigns_0, headsigns_1) = get_merged_headsigns(results)

        if config.has_option(section, 'spacingfile'):
            spacingfile = config.get(section, 'spacingfile')
            plot_spacing(spacingfile,intervals,spacing_0,worstspacing_0,", ".join(headsigns_0),spacing_1,worstspacing_1,", ".join(headsigns_1))
        
        if config.has_option(section, 'stemleaffile'):
            stemleaffile = config.get(section, 'stemleaffile')
            stem_leaf_schedule(timelist_0,", ".join(headsigns_0),timelist_1,", ".join(headsigns_1),stemleaffile)
        
        identify_service_periods_from_timelist(timelist_1)