def test_centers(self, data): # this only checks the edges. If you know an alternative # algorithm that isn't an exact duplicate of the one in # g.centers to test this please implement it. g = Grid(data['griddata'], origin=np.ones(3), delta=data['delta']) centers = np.array(list(g.centers())) assert_array_equal(centers[0], g.origin) assert_array_equal(centers[-1] - g.origin, (np.array(g.grid.shape) - 1) * data['delta'])