Skip to content

Commit a536d2a

Browse files
committed
added dask cupy test for slope func
1 parent 885f9a2 commit a536d2a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ In the GIS world, rasters are used for representing continuous phenomena (e.g. e
211211
| [Aspect](xrspatial/aspect.py) | ✅️ | ✅️ | ✅️ | ✅️ |
212212
| [Curvature](xrspatial/curvature.py) | ✅️ | | | ⚠️ |
213213
| [Hillshade](xrspatial/hillshade.py) | ✅️ | ✅️ | | |
214-
| [Slope](xrspatial/slope.py) | ✅️ | ✅️ | ✅️ | ⚠️ |
214+
| [Slope](xrspatial/slope.py) | ✅️ | ✅️ | ✅️ | ⚠️✅️ |
215215
| [Terrain Generation](xrspatial/terrain.py) | ✅️ | ✅️ | ✅️ | |
216216
| [Viewshed](xrspatial/viewshed.py) | ✅️ | | | |
217217
| [Perlin Noise](xrspatial/perlin.py) | ✅️ | ✅️ | ✅️ | |

xrspatial/tests/test_slope.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from xrspatial import slope
55
from xrspatial.tests.general_checks import (assert_nan_edges_effect, assert_numpy_equals_cupy,
6+
assert_numpy_equals_dask_cupy,
67
assert_numpy_equals_dask_numpy, create_test_raster,
78
cuda_and_cupy_available, general_output_checks)
89

@@ -63,3 +64,13 @@ def test_numpy_equals_cupy_qgis_data(elevation_raster):
6364
numpy_agg = input_data(elevation_raster, 'numpy')
6465
cupy_agg = input_data(elevation_raster, 'cupy')
6566
assert_numpy_equals_cupy(numpy_agg, cupy_agg, slope)
67+
68+
69+
@cuda_and_cupy_available
70+
@pytest.mark.parametrize("size", [(2, 4), (10, 15)])
71+
@pytest.mark.parametrize(
72+
"dtype", [np.int32, np.int64, np.uint32, np.uint64, np.float32, np.float64])
73+
def test_numpy_equals_dask_cupy_random_data(random_data):
74+
numpy_agg = create_test_raster(random_data, backend='numpy')
75+
dask_cupy_agg = create_test_raster(random_data, backend='dask+cupy')
76+
assert_numpy_equals_dask_cupy(numpy_agg, dask_cupy_agg, slope, atol=1e-6, rtol=1e-6)

0 commit comments

Comments
 (0)