Beispiel #1
0
 def setUp(self):
     odx = ODX(0, 1)
     odx.load_gtsf()
     day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M")
     megas = odx.preprocess_gtsf(day)
     builder = NetworkBuilder(700)
     self.net = builder.build(megas, 1)
Beispiel #2
0
 def test_schedule_maker(self):
     """
     :return:
     """
     odx = ODX(0, 1)
     odx.load_gtsf()
     scheduler = ScheduleMaker(odx.gtsf['trips'], odx.gtsf['calendar'],
                               odx.gtsf['stop_times'], odx.gtsf['stops'],
                               odx.gtsf['routes'])
     day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M")
     train, bus = scheduler.build_daily_table(day)
Beispiel #3
0
 def test_get_megas_stops(self):
     odx = ODX(0, 1)
     odx.load_gtsf()
     day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M")
     megas = odx.preprocess_gtsf(day)
     plotter = PlotStops()
     for stop in megas['51']:
         plotter.add_mega(
             stop)  # for s in stop.stops:  #    plotter.add_stop(s)
     for stop in megas['RAIL']:
         plotter.add_mega(stop)
     plotter.export('test.html')
Beispiel #4
0
class TestODX(unittest.TestCase):
    def setUp(self):
        self.odx = ODX(0, 1)
        self.odx.load_gtsf()
        self.day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M")

    def test_odx_preprocess_gtsf(self):
        self.assertEqual(type(self.odx.preprocess_gtsf(self.day)), dict,
                         "GTSF MegaStops incorrect type")
        i, j = list(self.odx.megas.items())[1]
        self.assertEqual(type(i), str, "Route is incorrect Type")
        self.assertEqual(type(j), list,
                         'Mega Stop collection mapped to incorrect type')
        self.assertEqual(type(j[0]), MegaStop,
                         "Megas does not have mega stops in it")
        i, j = list(self.odx.megas.items())[0]
        self.assertEqual(type(j), list,
                         'Mega Stop collection mapped to incorrect type')
        self.assertEqual(type(j[0]), MegaStop,
                         "Megas does not have mega stops in it")

    def test_odx_build_network(self):
        pass
Beispiel #5
0
 def test_build_ball_tree(self):
     odx = ODX(0, 1)
     odx.load_gtsf()
     day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M")
     odx.preprocess_gtsf(day)
     fac = MegaStopFac(700)
Beispiel #6
0
 def setUp(self):
     odx = ODX(0, 1)
     odx.load_gtsf()
     day = dt.datetime.strptime("01/30/18 00:00", "%m/%d/%y %H:%M")
     self.megas = odx.preprocess_gtsf(day)
Beispiel #7
0
 def test_import_files(self):
     odx = ODX(0, 1)
     odx.load_gtsf()
     scheduler = ScheduleMaker(odx.gtsf['trips'], odx.gtsf['calendar'],
                               odx.gtsf['stop_times'], odx.gtsf['stops'],
                               odx.gtsf['routes'])