def NOtest_vec_distances(self): s= self.scheduler() vec=VECLoader(get_dataset('warlogs'),scheduler=s) # dis=PairwiseDistances(metric='cosine',scheduler=s) # dis.input.df = vec.output.df # dis.input.array = vec.output.array cnt = Every(proc=self.terse,constant_time=True,scheduler=s) # cnt.input.df = dis.output.dist cnt.input.df = vec.output.table global times times = 0 s.start() table = vec.table()
def test_read_vec(self): module = VECLoader(get_dataset('warlogs'), name='test_read_vec') #self.assertTrue(module.table() is None) module.run(0) s = module.trace_stats(max_runs=1) df = module.table() self.assertFalse(df is None) l = len(df) #self.assertEqual(l, len(df[df[UPDATE_COLUMN]==module.last_update()])) cnt = 1 while not module.is_zombie(): module.run(cnt) cnt += 1 s = module.trace_stats(max_runs=1) df = module.table() ln = len(df) #print ("Run time: %gs, loaded %d rows" % (s['duration'][len(s)-1], ln)) #self.assertEqual(ln-l, len(df[df[UPDATE_COLUMN]==module.last_update()])) l = ln s = module.trace_stats(max_runs=1) ln = len(module.table())