@@ -139,7 +139,8 @@ def test_ndvi_cupy_equals_numpy():
139
139
test_result = ndvi (nir_cupy , red_cupy )
140
140
141
141
assert isinstance (test_result .data , cupy .ndarray )
142
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
142
+ assert np .isclose (
143
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
143
144
144
145
145
146
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Device not Available" )
@@ -158,7 +159,8 @@ def test_ndvi_dask_cupy_equals_numpy():
158
159
assert is_dask_cupy (test_result )
159
160
160
161
test_result .data = test_result .data .compute ()
161
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
162
+ assert np .isclose (
163
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
162
164
163
165
164
166
# SAVI -------------
@@ -210,7 +212,8 @@ def test_savi_cupy_equals_numpy():
210
212
test_result = savi (nir_cupy , red_cupy )
211
213
212
214
assert isinstance (test_result .data , cupy .ndarray )
213
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
215
+ assert np .isclose (
216
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
214
217
215
218
216
219
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Device not Available" )
@@ -227,7 +230,8 @@ def test_savi_dask_cupy_equals_numpy():
227
230
228
231
assert is_dask_cupy (test_result )
229
232
test_result .data = test_result .data .compute ()
230
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
233
+ assert np .isclose (
234
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
231
235
232
236
233
237
# arvi -------------
@@ -280,7 +284,8 @@ def test_arvi_cupy_equals_numpy():
280
284
test_result = arvi (nir_cupy , red_cupy , blue_cupy )
281
285
282
286
assert isinstance (test_result .data , cupy .ndarray )
283
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
287
+ assert np .isclose (
288
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
284
289
285
290
286
291
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Device not Available" )
@@ -300,7 +305,8 @@ def test_arvi_dask_cupy_equals_numpy():
300
305
assert is_dask_cupy (test_result )
301
306
302
307
test_result .data = test_result .data .compute ()
303
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
308
+ assert np .isclose (
309
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
304
310
305
311
306
312
# EVI -------------
@@ -357,7 +363,8 @@ def test_evi_cupy_equals_numpy():
357
363
test_result = evi (nir_cupy , red_cupy , blue_cupy )
358
364
359
365
assert isinstance (test_result .data , cupy .ndarray )
360
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
366
+ assert np .isclose (
367
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
361
368
362
369
363
370
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Device not Available" )
@@ -377,7 +384,8 @@ def test_evi_dask_cupy_equals_numpy():
377
384
assert is_dask_cupy (test_result )
378
385
379
386
test_result .data = test_result .data .compute ()
380
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
387
+ assert np .isclose (
388
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
381
389
382
390
383
391
# GCI -------------
@@ -424,7 +432,8 @@ def test_gci_cupy_equals_numpy():
424
432
test_result = gci (nir_cupy , green_cupy )
425
433
426
434
assert isinstance (test_result .data , cupy .ndarray )
427
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
435
+ assert np .isclose (
436
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
428
437
429
438
430
439
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Dgcice not Available" )
@@ -442,7 +451,8 @@ def test_gci_dask_cupy_equals_numpy():
442
451
assert is_dask_cupy (test_result )
443
452
444
453
test_result .data = test_result .data .compute ()
445
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
454
+ assert np .isclose (
455
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
446
456
447
457
448
458
# SIPI -------------
@@ -495,7 +505,8 @@ def test_sipi_cupy_equals_numpy():
495
505
test_result = sipi (nir_dask , red_dask , blue_dask )
496
506
497
507
assert isinstance (test_result .data , cupy .ndarray )
498
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
508
+ assert np .isclose (
509
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
499
510
500
511
501
512
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Device not Available" )
@@ -514,7 +525,8 @@ def test_sipi_dask_cupy_equals_numpy():
514
525
515
526
assert is_dask_cupy (test_result )
516
527
test_result .data = test_result .data .compute ()
517
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
528
+ assert np .isclose (
529
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
518
530
519
531
520
532
# NBR -------------
@@ -561,7 +573,8 @@ def test_nbr_cupy_equals_numpy():
561
573
test_result = nbr (nir_cupy , swir_cupy )
562
574
563
575
assert isinstance (test_result .data , cupy .ndarray )
564
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
576
+ assert np .isclose (
577
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
565
578
566
579
567
580
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Device not Available" )
@@ -579,7 +592,8 @@ def test_nbr_dask_cupy_equals_numpy():
579
592
assert is_dask_cupy (test_result )
580
593
581
594
test_result .data = test_result .data .compute ()
582
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
595
+ assert np .isclose (
596
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
583
597
584
598
585
599
# NBR2 -------------
@@ -627,7 +641,8 @@ def test_nbr2_cupy_equals_numpy():
627
641
test_result = nbr2 (swir1_cupy , swir2_cupy )
628
642
629
643
assert isinstance (test_result .data , cupy .ndarray )
630
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
644
+ assert np .isclose (
645
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
631
646
632
647
633
648
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Dnbr2ce not Available" )
@@ -644,7 +659,8 @@ def test_nbr2_dask_cupy_equals_numpy():
644
659
645
660
assert is_dask_cupy (test_result )
646
661
test_result .data = test_result .data .compute ()
647
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
662
+ assert np .isclose (
663
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
648
664
649
665
650
666
# NDMI -------------
@@ -692,7 +708,8 @@ def test_ndmi_cupy_equals_numpy():
692
708
test_result = ndmi (nir_cupy , swir1_cupy )
693
709
694
710
assert isinstance (test_result .data , cupy .ndarray )
695
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
711
+ assert np .isclose (
712
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
696
713
697
714
698
715
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Device not Available" )
@@ -709,7 +726,8 @@ def test_ndmi_dask_cupy_equals_numpy():
709
726
710
727
assert is_dask_cupy (test_result )
711
728
test_result .data = test_result .data .compute ()
712
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
729
+ assert np .isclose (
730
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
713
731
714
732
715
733
# EBBI -------------
@@ -761,7 +779,8 @@ def test_ebbi_cupy_equals_numpy():
761
779
test_result = ebbi (red_dask , swir_dask , tir_dask )
762
780
763
781
assert isinstance (test_result .data , cupy .ndarray )
764
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
782
+ assert np .isclose (
783
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
765
784
766
785
767
786
@pytest .mark .skipif (doesnt_have_cuda (), reason = "CUDA Device not Available" )
@@ -780,7 +799,8 @@ def test_ebbi_dask_cupy_equals_numpy():
780
799
781
800
assert is_dask_cupy (test_result )
782
801
test_result .data = test_result .data .compute ()
783
- assert np .isclose (numpy_result , test_result , equal_nan = True ).all ()
802
+ assert np .isclose (
803
+ numpy_result , test_result .data .get (), equal_nan = True ).all ()
784
804
785
805
786
806
def test_true_color_cpu ():
0 commit comments