def test_partitionABCD_3(self):
     """Test function for partitionABCD() 3/5"""
     ar, br, cr, dr = ds.partitionABCD(self.ABCD2, m=2, r=1)
     self.assertTrue(np.allclose(self.at2, ar, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.bt2, br, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.ct2, cr, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.dt2, dr, rtol=1e-5, atol=1e-8))
 def test_partitionABCD_4(self):
     """Test function for partitionABCD() 4/5"""
     ar, br, cr, dr = ds.partitionABCD(self.ABCD2, m=3, r=2)
     self.assertTrue(np.allclose(self.at3, ar, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.bt3, br, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.ct3, cr, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.dt3, dr, rtol=1e-5, atol=1e-8))
示例#3
0
 def test_partitionABCD_2(self):
     """Test function for partitionABCD() 2/2"""
     ar, br, cr, dr = ds.partitionABCD(self.ABCD2, m=2)
     self.assertTrue(np.allclose(self.at, ar, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.bt, br, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.ct, cr, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.dt, dr, rtol=1e-5, atol=1e-8))
 def test_partitionABCD_1(self):
     """Test function for partitionABCD() 1/5"""
     a, b, c, d = ds.partitionABCD(self.ABCD1)
     self.assertTrue(np.allclose(a, self.ob.A, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(b, self.ob.B, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(c, self.ob.C, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(d, self.ob.D, rtol=1e-5, atol=1e-8))
示例#5
0
 def test_partitionABCD_1(self):
     """Test function for partitionABCD() 1/2"""
     a, b, c, d = ds.partitionABCD(self.ABCD1)
     self.assertTrue(np.allclose(a, self.ob.A, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(b, self.ob.B, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(c, self.ob.C, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(d, self.ob.D, rtol=1e-5, atol=1e-8))
 def test_partitionABCD_4(self):
     """Test function for partitionABCD() 4/5"""
     ar, br, cr, dr = ds.partitionABCD(self.ABCD2, m=3, r=2)
     self.assertTrue(np.allclose(self.at3, ar, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.bt3, br, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.ct3, cr, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.dt3, dr, rtol=1e-5, atol=1e-8))
 def test_partitionABCD_3(self):
     """Test function for partitionABCD() 3/5"""
     ar, br, cr, dr = ds.partitionABCD(self.ABCD2, m=2, r=1)
     self.assertTrue(np.allclose(self.at2, ar, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.bt2, br, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.ct2, cr, rtol=1e-5, atol=1e-8))
     self.assertTrue(np.allclose(self.dt2, dr, rtol=1e-5, atol=1e-8))
 def test_partitionABCD_5(self):
     """Test function for partitionABCD() 5/5"""
     ar, br, cr, dr = ds.partitionABCD(self.ABCD2, m=2, r=2)
 def test_partitionABCD_5(self):
     """Test function for partitionABCD() 5/5"""
     with self.assertRaises(ValueError):
         ar, br, cr, dr = ds.partitionABCD(self.ABCD2, m=2, r=2)
 def test_partitionABCD_5(self):
     """Test function for partitionABCD() 5/5"""
     ar, br, cr, dr = ds.partitionABCD(self.ABCD2, m=2, r=2)