def test_equivalent_to_rbf_interpolator(self): seq = Halton(1, scramble=False, seed=np.random.RandomState()) x = 3 * seq.random(50) xitp = 3 * seq.random(50) y = _1d_test_function(x) yitp1 = self.build(x, y)(xitp) yitp2 = RBFInterpolator(x, y)(xitp) assert_allclose(yitp1, yitp2, atol=1e-8)
def test_equivalent_to_rbf_interpolator(self): seq = Halton(2, scramble=False, seed=np.random.RandomState()) x = seq.random(100) xitp = seq.random(100) y = _2d_test_function(x) yitp1 = self.build(x, y)(xitp) yitp2 = [] tree = cKDTree(x) for xi in xitp: _, nbr = tree.query(xi, 20) yitp2.append(RBFInterpolator(x[nbr], y[nbr])(xi[None])[0]) assert_allclose(yitp1, yitp2, atol=1e-8)
def build(self, *args, **kwargs): return RBFInterpolator(*args, **kwargs, neighbors=np.inf)
def build(self, *args, **kwargs): return RBFInterpolator(*args, **kwargs)