@@ -421,14 +421,30 @@ def test_hotspots_numpy(data_hotspots):
421
421
data , kernel , expected_result = data_hotspots
422
422
numpy_agg = create_test_raster (data )
423
423
numpy_hotspots = hotspots (numpy_agg , kernel )
424
- general_output_checks (numpy_agg , numpy_hotspots , expected_result )
424
+ general_output_checks (numpy_agg , numpy_hotspots , expected_result , verify_attrs = False )
425
+ # validate attrs
426
+ assert numpy_hotspots .shape == numpy_agg .shape
427
+ assert numpy_hotspots .dims == numpy_agg .dims
428
+ for coord in numpy_agg .coords :
429
+ np .testing .assert_allclose (
430
+ numpy_hotspots [coord ].data , numpy_agg [coord ].data , equal_nan = True
431
+ )
432
+ assert numpy_hotspots .attrs ['unit' ] == '%'
425
433
426
434
427
435
def test_hotspots_dask_numpy (data_hotspots ):
428
436
data , kernel , expected_result = data_hotspots
429
437
dask_numpy_agg = create_test_raster (data , backend = 'dask' )
430
438
dask_numpy_hotspots = hotspots (dask_numpy_agg , kernel )
431
- general_output_checks (dask_numpy_agg , dask_numpy_hotspots , expected_result )
439
+ general_output_checks (dask_numpy_agg , dask_numpy_hotspots , expected_result , verify_attrs = False )
440
+ # validate attrs
441
+ assert dask_numpy_hotspots .shape == dask_numpy_agg .shape
442
+ assert dask_numpy_hotspots .dims == dask_numpy_agg .dims
443
+ for coord in dask_numpy_agg .coords :
444
+ np .testing .assert_allclose (
445
+ dask_numpy_hotspots [coord ].data , dask_numpy_agg [coord ].data , equal_nan = True
446
+ )
447
+ assert dask_numpy_hotspots .attrs ['unit' ] == '%'
432
448
433
449
434
450
@cuda_and_cupy_available
0 commit comments