def test_max(self): s=Scheduler() random = RandomTable(10, rows=10000, scheduler=s) max=Max(scheduler=s) max.input.df = random.output.df pr=Print(scheduler=s) pr.input.df = max.output.df s.start() res1 = random.df()[random.columns.difference([random.UPDATE_COLUMN])].max() res2 = last_row(max.df(), remove_update=True) self.assertTrue(np.allclose(res1, res2))
def test_idxmax(self): s=Scheduler() random = RandomTable(10, rows=10000,throttle=1000, scheduler=s) idxmax=IdxMax(scheduler=s) idxmax.input.df = random.output.df max=Max(scheduler=s) max.input.df = random.output.df pr=Print(scheduler=s) pr.input.df = idxmax.output.max s.start() max1=last_row(max.df(),remove_update=True) #print max1 max2=last_row(idxmax.max(),remove_update=True) #print max2 self.assertTrue((max1==max2).all())