Skip to content

Commit

Permalink
test prediction grid interface function
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaelicke committed Jul 17, 2023
1 parent ac3c8b2 commit 074e6f9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions skgstat/tests/test_gstatsim_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,31 @@ def test_prediction_grid_cols_rows():
assert grid.shape == (2652 , 2)


@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires Python >= 3.8 or higher")
def test_prediction_grid_interface():
coords, vals = skg.data.pancake(N=60, seed=42).get('sample')
vario = skg.Variogram(coords, vals, maxlag=0.6, n_lags=12)

# create the grid
grid = vario.gstatsim_prediction_grid(resolution=5)

assert isinstance(grid, Grid)
assert grid.rows == 94
assert grid.cols == 96


@pytest.mark.skipif(sys.version_info < (3, 8), reason="requires Python >= 3.8 or higher")
def test_prediction_grid_interface_as_numpy():
coords, vals = skg.data.pancake(N=60).get('sample')
vario = skg.Variogram(coords, vals, maxlag=0.6, n_lags=12)

# create the grid
grid = vario.gstatsim_prediction_grid(resolution=5, as_numpy=True)

assert isinstance(grid, np.ndarray)
assert grid.shape == (96 * 94, 2)


# Run the tests
if __name__ == '__main__':
pytest.main()

0 comments on commit 074e6f9

Please sign in to comment.