def test_IpolBase(self): """testing the basic behaviour of the base class""" ip = ipol.IpolBase(self.src, self.trg) res = ip(self.vals) self.assertEqual(res, None) # Check behaviour if args are passed as lists src = [self.src[:, 0], self.src[:, 1]] trg = [self.trg[:, 0], self.trg[:, 1]] ip = ipol.IpolBase(src, trg) self.assertEqual(len(self.src), ip.numsources) # Check behaviour if dimension is > 2 ip = ipol.IpolBase(self.src, self.trg) self.assertRaises(Exception, ipol.IpolBase, np.arange(12).reshape((2, 3, 2)), np.arange(20).reshape((2, 2, 5)))
def test_IpolBase(self): """testing the basic behaviour of the base class""" ip = ipol.IpolBase(self.src, self.trg) res = ip(self.vals) assert res is None # Check behaviour if args are passed as lists src = [self.src[:, 0], self.src[:, 1]] trg = [self.trg[:, 0], self.trg[:, 1]] ip = ipol.IpolBase(src, trg) assert len(self.src) == ip.numsources # Check behaviour if dimension is > 2 ip = ipol.IpolBase(self.src, self.trg) with pytest.raises(Exception): ipol.IpolBase( np.arange(12).reshape((2, 3, 2)), np.arange(20).reshape((2, 2, 5)) )