def test_natural_neighbor_to_points(test_data, test_points): r"""Test natural neighbor interpolation to grid function.""" xp, yp, z = test_data obs_points = np.vstack([xp, yp]).transpose() img = natural_neighbor_to_points(obs_points, z, test_points) with get_test_data('nn_bbox0to100.npz') as fobj: truth = np.load(fobj)['img'].reshape(-1) assert_array_almost_equal(truth, img)