Skip to content

Commit 62a0d3f

Browse files
authored
Merge pull request #586 from astrofrog/fix-deprecated-shape
2 parents ff43d3f + bc02fca commit 62a0d3f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

reproject/adaptive/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def _reproject_adaptive_2d(
177177
bad_fill_value=bad_fill_value,
178178
)
179179

180-
array_out.shape = shape_out
180+
array_out = array_out.reshape(shape_out)
181181

182182
if return_footprint:
183183
output_footprint[:] = (~np.isnan(array_out)).astype(float)

reproject/adaptive/tests/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,8 @@ def test_broadcast_reprojection(input_extra_dims, output_shape, input_as_wcs, ou
865865
# Test both single and multiple dimensions being broadcast
866866
if input_extra_dims == 2:
867867
image_stack = image_stack.reshape((2, 2, *image_stack.shape[-2:]))
868-
array_ref.shape = image_stack.shape
869-
footprint_ref.shape = image_stack.shape
868+
array_ref = array_ref.reshape(image_stack.shape)
869+
footprint_ref = footprint_ref.reshape(image_stack.shape)
870870

871871
# Test different ways of providing the output shape
872872
if output_shape == "single":

reproject/interpolation/tests/test_core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,8 @@ def test_broadcast_reprojection(input_extra_dims, output_shape, input_as_wcs, ou
662662
# Test both single and multiple dimensions being broadcast
663663
if input_extra_dims == 2:
664664
image_stack = image_stack.reshape((2, 2, *image_stack.shape[-2:]))
665-
array_ref.shape = image_stack.shape
666-
footprint_ref.shape = image_stack.shape
665+
array_ref = array_ref.reshape(image_stack.shape)
666+
footprint_ref = footprint_ref.reshape(image_stack.shape)
667667

668668
# Test different ways of providing the output shape
669669
if output_shape == "single":
@@ -706,8 +706,8 @@ def test_blocked_broadcast_reprojection(input_extra_dims, output_shape, parallel
706706
# Test both single and multiple dimensions being broadcast
707707
if input_extra_dims == 2:
708708
image_stack = image_stack.reshape((2, 2, *image_stack.shape[-2:]))
709-
array_ref.shape = image_stack.shape
710-
footprint_ref.shape = image_stack.shape
709+
array_ref = array_ref.reshape(image_stack.shape)
710+
footprint_ref = footprint_ref.reshape(image_stack.shape)
711711

712712
# Test different ways of providing the output shape
713713
if output_shape == "single":

reproject/spherical_intersect/tests/test_high_level.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def test_broadcast_reprojection(input_extra_dims, output_shape, input_as_wcs, ou
138138
# Test both single and multiple dimensions being broadcast
139139
if input_extra_dims == 2:
140140
image_stack = image_stack.reshape((2, 2, *image_stack.shape[-2:]))
141-
array_ref.shape = image_stack.shape
142-
footprint_ref.shape = image_stack.shape
141+
array_ref = array_ref.reshape(image_stack.shape)
142+
footprint_ref = footprint_ref.reshape(image_stack.shape)
143143

144144
# Test different ways of providing the output shape
145145
if output_shape == "single":
@@ -174,8 +174,8 @@ def test_broadcast_parallel_reprojection(input_extra_dims, output_shape, paralle
174174
# Test both single and multiple dimensions being broadcast
175175
if input_extra_dims == 2:
176176
image_stack = image_stack.reshape((2, 2, *image_stack.shape[-2:]))
177-
array_ref.shape = image_stack.shape
178-
footprint_ref.shape = image_stack.shape
177+
array_ref = array_ref.reshape(image_stack.shape)
178+
footprint_ref = footprint_ref.reshape(image_stack.shape)
179179

180180
# Test different ways of providing the output shape
181181
if output_shape == "single":

0 commit comments

Comments
 (0)