def test_padl_2(self): """Test function for padl() 2/3""" # 1-d array tr = padl(self.tv2, n=25, val=1.5) res = np.hstack((1.5*np.ones((1, 15)), self.tv2.reshape((1, -1)))) self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))
def test_padl_3(self): """Test function for padl() 3/3""" # empty matrix array tr = padl(self.tv3, n=25, val=1.5) res = np.hstack((1.5*np.ones((1, 25)), self.tv3.reshape((1, -1)))) self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))
def test_padl_1(self): """Test function for padl() 1/3""" tr = padl(self.tv1, n=25, val=2) res = np.concatenate((2.*np.ones((15, 10)), self.tv1), axis=1) self.assertTrue(np.allclose(tr, res, atol=1e-8, rtol=1e-5))