def testNoData(self):
     fake_user_id = "new_fake"
     esdtmq.make_tour_model_from_raw_user_data(fake_user_id)
     tm = esdtmq.get_tour_model(fake_user_id)
     logging.debug("in testNoData, tour model = %s" % tm)
     self.assertTrue(len(tm["common_places"]) == 0)
     self.assertTrue(len(tm["common_trips"]) == 0)
 def testE2E(self):
     eaist.segment_current_trips(self.testUUID)
     eaiss.segment_current_sections(self.testUUID)
     esdtmq.make_tour_model_from_raw_user_data(self.testUUID)
     tm = esdtmq.get_tour_model(self.testUUID)
     self.assertTrue(len(tm["common_trips"]) > 0)
     self.assertTrue(len(tm["common_places"]) > 0)
 def testE2E(self):
     etc.setupRealExample(self, "emission/tests/data/real_examples/shankari_2015-aug-27")
     eaicf.filter_accuracy(self.testUUID)
     estfm.move_all_filters_to_data()
     eaist.segment_current_trips(self.testUUID)
     eaiss.segment_current_sections(self.testUUID)
     esdtmq.make_tour_model_from_raw_user_data(self.testUUID)
     tm = esdtmq.get_tour_model(self.testUUID)
     self.assertTrue(len(tm["common_trips"]) > 0)
     self.assertTrue(len(tm["common_places"]) > 0)
 def storeCommonTripsToCache(self, time_query):
     """
     Determine which set of common trips to send to the usercache.
     As of now we will run the pipeline on the full set of data and send that up
     """
     tour_model = esdtmpq.get_tour_model(self.user_id)
     uc = enua.UserCache.getUserCache(self.user_id)
     logging.debug("Adding common trips for day %s" % str(pydt.date.today()))
     # We don't really support day-specific common trips in any other format
     # So it doesn't make sense to support it only for the cache, where it will
     # accumulate on the phone uselessly
     # IF we are going to support versioned common trips objects, we should
     # do even outside the cache code
     # uc.putDocument("common_trips-%s" % str(pydt.date.today()),  tour_model)
     # valid_key_list = ["common_trips-%s" % str(pydt.date.today())]
     # self.delete_obsolete_entries(uc, valid_key_list)
     logging.debug("About to save model with len(places) = %d and len(trips) = %d" %
         (len(tour_model["common_places"]), len(tour_model["common_trips"])))
     uc.putDocument("common-trips", tour_model)
示例#5
0
 def storeCommonTripsToCache(self, time_query):
     """ 
     Determine which set of common trips to send to the usercache. 
     As of now we will run the pipeline on the full set of data and send that up
     """
     tour_model = esdtmpq.get_tour_model(self.user_id)
     uc = enua.UserCache.getUserCache(self.user_id)
     logging.debug("Adding common trips for day %s" % str(pydt.date.today()))
     # We don't really support day-specific common trips in any other format
     # So it doesn't make sense to support it only for the cache, where it will
     # accumulate on the phone uselessly
     # IF we are going to support versioned common trips objects, we should
     # do even outside the cache code
     # uc.putDocument("common_trips-%s" % str(pydt.date.today()),  tour_model)
     # valid_key_list = ["common_trips-%s" % str(pydt.date.today())]
     # self.delete_obsolete_entries(uc, valid_key_list)
     logging.debug("About to save model with len(places) = %d and len(trips) = %d" % 
         (len(tour_model["common_places"]), len(tour_model["common_trips"])))
     uc.putDocument("common-trips", tour_model)
示例#6
0
 def testE2E(self):
     etc.runIntakePipeline(self.testUUID)
     esdtmq.make_tour_model_from_raw_user_data(self.testUUID)
     tm = esdtmq.get_tour_model(self.testUUID)
     self.assertTrue(len(tm["common_trips"]) > 0)
     self.assertTrue(len(tm["common_places"]) > 0)
 def testE2E(self):
     etc.runIntakePipeline(self.testUUID)
     esdtmq.make_tour_model_from_raw_user_data(self.testUUID)
     tm = esdtmq.get_tour_model(self.testUUID)
     self.assertTrue(len(tm["common_trips"]) > 0)
     self.assertTrue(len(tm["common_places"]) > 0)
 def testNoData(self):
     fake_user_id = "new_fake"
     esdtmq.make_tour_model_from_raw_user_data(fake_user_id)
     tm = esdtmq.get_tour_model(fake_user_id)
     self.assertTrue(len(tm["common_places"]) == 0)
     self.assertTrue(len(tm["common_trips"]) == 0)