@@ -410,7 +410,7 @@ def test_crop(ndcube_4d_ln_lt_l_t):
410410 upper_corner = [coord [- 1 ] for coord in intervals ]
411411 expected = cube [1 :3 , 0 :2 , 0 :2 , 0 :3 ]
412412 output = cube .crop (lower_corner , upper_corner )
413- helpers .assert_cubes_equal (output , expected )
413+ helpers .assert_cubes_equal (output , expected , check_data = True )
414414
415415
416416def test_crop_tuple_non_tuple_input (ndcube_2d_ln_lt ):
@@ -420,7 +420,7 @@ def test_crop_tuple_non_tuple_input(ndcube_2d_ln_lt):
420420 upper_corner = SkyCoord (Tx = 0.0044444444 , Ty = 0.0011111111 , unit = "deg" , frame = frame )
421421 cropped_by_tuples = cube .crop ((lower_corner ,), (upper_corner ,))
422422 cropped_by_coords = cube .crop (lower_corner , upper_corner )
423- helpers .assert_cubes_equal (cropped_by_tuples , cropped_by_coords )
423+ helpers .assert_cubes_equal (cropped_by_tuples , cropped_by_coords , check_data = True )
424424
425425
426426def test_crop_with_nones (ndcube_4d_ln_lt_l_t ):
@@ -432,31 +432,31 @@ def test_crop_with_nones(ndcube_4d_ln_lt_l_t):
432432 upper_corner [0 ] = interval0 [- 1 ]
433433 expected = cube [:, :, :, 0 :3 ]
434434 output = cube .crop (lower_corner , upper_corner )
435- helpers .assert_cubes_equal (output , expected )
435+ helpers .assert_cubes_equal (output , expected , check_data = True )
436436
437437
438438def test_crop_1d_independent (ndcube_4d_ln_lt_l_t ):
439439 cube_1d = ndcube_4d_ln_lt_l_t [0 , 0 , :, 0 ]
440440 wl_range = SpectralCoord ([3e-11 , 4.5e-11 ], unit = u .m )
441441 expected = cube_1d [0 :2 ]
442442 output = cube_1d .crop ([wl_range [0 ]], [wl_range [- 1 ]])
443- helpers .assert_cubes_equal (output , expected )
443+ helpers .assert_cubes_equal (output , expected , check_data = True )
444444
445445
446446def test_crop_1d_dependent (ndcube_4d_ln_lt_l_t ):
447447 cube_1d = ndcube_4d_ln_lt_l_t [0 , :, 0 , 0 ]
448448 sky_range = cube_1d .wcs .array_index_to_world ([0 , 1 ])
449449 expected = cube_1d [0 :2 ]
450450 output = cube_1d .crop ([sky_range [0 ]], [sky_range [- 1 ]])
451- helpers .assert_cubes_equal (output , expected )
451+ helpers .assert_cubes_equal (output , expected , check_data = True )
452452
453453
454454def test_crop_reduces_dimensionality (ndcube_4d_ln_lt_l_t ):
455455 cube = ndcube_4d_ln_lt_l_t
456456 point = (None , SpectralCoord ([3e-11 ], unit = u .m ), None )
457457 expected = cube [:, :, 0 , :]
458458 output = cube .crop (point )
459- helpers .assert_cubes_equal (output , expected )
459+ helpers .assert_cubes_equal (output , expected , check_data = True )
460460
461461
462462def test_crop_scalar_valuerror (ndcube_2d_ln_lt ):
@@ -502,7 +502,7 @@ def test_crop_by_values(ndcube_4d_ln_lt_l_t):
502502 upper_corner [- 1 ] = upper_corner [- 1 ].to (units [- 1 ])
503503 expected = cube [1 :3 , 0 :2 , 0 :2 , 0 :3 ]
504504 output = cube .crop_by_values (lower_corner , upper_corner )
505- helpers .assert_cubes_equal (output , expected )
505+ helpers .assert_cubes_equal (output , expected , check_data = True )
506506
507507
508508def test_crop_by_values_with_units (ndcube_4d_ln_lt_l_t ):
@@ -518,7 +518,7 @@ def test_crop_by_values_with_units(ndcube_4d_ln_lt_l_t):
518518 units [0 ] = None
519519 expected = ndcube_4d_ln_lt_l_t [1 :3 , 0 :2 , 0 :2 , 0 :3 ]
520520 output = ndcube_4d_ln_lt_l_t .crop_by_values (lower_corner , upper_corner , units = units )
521- helpers .assert_cubes_equal (output , expected )
521+ helpers .assert_cubes_equal (output , expected , check_data = True )
522522
523523
524524def test_crop_by_values_with_equivalent_units (ndcube_2d_ln_lt ):
@@ -528,7 +528,7 @@ def test_crop_by_values_with_equivalent_units(ndcube_2d_ln_lt):
528528 upper_corner = [(coord [- 1 ]* u .deg ).to (u .arcsec ) for coord in intervals ]
529529 expected = ndcube_2d_ln_lt [0 :4 , 1 :7 ]
530530 output = ndcube_2d_ln_lt .crop_by_values (lower_corner , upper_corner )
531- helpers .assert_cubes_equal (output , expected )
531+ helpers .assert_cubes_equal (output , expected , check_data = True )
532532
533533
534534def test_crop_by_values_with_nones (ndcube_4d_ln_lt_l_t ):
@@ -539,15 +539,15 @@ def test_crop_by_values_with_nones(ndcube_4d_ln_lt_l_t):
539539 upper_corner [0 ] = 1.1 * u .min
540540 expected = cube [:, :, :, 0 :3 ]
541541 output = cube .crop_by_values (lower_corner , upper_corner )
542- helpers .assert_cubes_equal (output , expected )
542+ helpers .assert_cubes_equal (output , expected , check_data = True )
543543
544544
545545def test_crop_by_values_all_nones (ndcube_4d_ln_lt_l_t ):
546546 cube = ndcube_4d_ln_lt_l_t
547547 lower_corner = [None ] * 4
548548 upper_corner = [None ] * 4
549549 output = cube .crop_by_values (lower_corner , upper_corner )
550- helpers .assert_cubes_equal (output , cube )
550+ helpers .assert_cubes_equal (output , cube , check_data = True )
551551
552552
553553def test_crop_by_values_valueerror1 (ndcube_4d_ln_lt_l_t ):
@@ -594,7 +594,7 @@ def test_crop_by_values_1d_dependent(ndcube_4d_ln_lt_l_t):
594594 upper_corner = [lat_range [- 1 ] * u .deg , lon_range [- 1 ] * u .deg ]
595595 expected = cube_1d [0 :2 ]
596596 output = cube_1d .crop_by_values (lower_corner , upper_corner )
597- helpers .assert_cubes_equal (output , expected )
597+ helpers .assert_cubes_equal (output , expected , check_data = True )
598598
599599
600600def test_crop_by_extra_coords (ndcube_3d_ln_lt_l_ec_time ):
@@ -603,7 +603,7 @@ def test_crop_by_extra_coords(ndcube_3d_ln_lt_l_ec_time):
603603 upper_corner = (Time ("2000-01-01T20:00:00" , scale = "utc" , format = "fits" ), None )
604604 output = cube .crop (lower_corner , upper_corner , wcs = cube .extra_coords )
605605 expected = cube [0 ]
606- helpers .assert_cubes_equal (output , expected )
606+ helpers .assert_cubes_equal (output , expected , check_data = True )
607607
608608
609609def test_crop_by_extra_coords_values (ndcube_3d_ln_lt_l_ec_time ):
@@ -612,7 +612,7 @@ def test_crop_by_extra_coords_values(ndcube_3d_ln_lt_l_ec_time):
612612 upper_corner = (8 * 60 * 60 * u .s , 2 * u .pix )
613613 output = cube .crop_by_values (lower_corner , upper_corner , wcs = cube .extra_coords )
614614 expected = cube [0 ]
615- helpers .assert_cubes_equal (output , expected )
615+ helpers .assert_cubes_equal (output , expected , check_data = True )
616616
617617
618618def test_crop_by_extra_coords_all_axes_with_coord (ndcube_3d_ln_lt_l_ec_all_axes ):
@@ -624,7 +624,7 @@ def test_crop_by_extra_coords_all_axes_with_coord(ndcube_3d_ln_lt_l_ec_all_axes)
624624 upper_corner = (interval0 [1 ], interval1 [1 ], interval2 [1 ])
625625 output = cube .crop (lower_corner , upper_corner , wcs = cube .extra_coords )
626626 expected = cube [0 , 0 :2 , 1 :4 ]
627- helpers .assert_cubes_equal (output , expected )
627+ helpers .assert_cubes_equal (output , expected , check_data = True )
628628
629629
630630def test_crop_by_extra_coords_values_all_axes_with_coord (ndcube_3d_ln_lt_l_ec_all_axes ):
@@ -636,7 +636,7 @@ def test_crop_by_extra_coords_values_all_axes_with_coord(ndcube_3d_ln_lt_l_ec_al
636636 upper_corner = (interval0 [1 ], interval1 [1 ], interval2 [1 ])
637637 output = cube .crop_by_values (lower_corner , upper_corner , wcs = cube .extra_coords )
638638 expected = cube [0 , 0 :2 , 1 :4 ]
639- helpers .assert_cubes_equal (output , expected )
639+ helpers .assert_cubes_equal (output , expected , check_data = True )
640640
641641
642642def test_crop_by_extra_coords_shared_axis (ndcube_3d_ln_lt_l_ec_sharing_axis ):
@@ -645,7 +645,7 @@ def test_crop_by_extra_coords_shared_axis(ndcube_3d_ln_lt_l_ec_sharing_axis):
645645 upper_corner = (2 * u .m , 2 * u .keV )
646646 output = cube .crop (lower_corner , upper_corner , wcs = cube .extra_coords )
647647 expected = cube [:, 1 :3 ]
648- helpers .assert_cubes_equal (output , expected )
648+ helpers .assert_cubes_equal (output , expected , check_data = True )
649649
650650
651651def test_crop_by_extra_coords_values_shared_axis (ndcube_3d_ln_lt_l_ec_sharing_axis ):
@@ -654,7 +654,7 @@ def test_crop_by_extra_coords_values_shared_axis(ndcube_3d_ln_lt_l_ec_sharing_ax
654654 upper_corner = (2 * u .m , 2 * u .keV )
655655 output = cube .crop_by_values (lower_corner , upper_corner , wcs = cube .extra_coords )
656656 expected = cube [:, 1 :3 ]
657- helpers .assert_cubes_equal (output , expected )
657+ helpers .assert_cubes_equal (output , expected , check_data = True )
658658
659659
660660def test_crop_rotated_celestial (ndcube_4d_ln_lt_l_t ):
0 commit comments