Skip to content

Commit 191e878

Browse files
committed
fix: put this back
1 parent 89f2aad commit 191e878

1 file changed

Lines changed: 12 additions & 17 deletions

File tree

tests/test_image.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,24 +2497,19 @@ def test_Image_constructor():
24972497
err_msg="Image constructor mangled input NumPy array.")
24982498

24992499
# Now make an opposite-endian Numpy array, to initialize the Image.
2500-
if is_jax_galsim():
2501-
# as of jax 0.10.0, big-endian arrays with types '>i2'
2502-
# cause issues on construction
2503-
pass
2500+
new_type = array_dtype.newbyteorder('S')
2501+
test_arr = np.ones((3,4), dtype=new_type)
2502+
if np.dtype(types[i]).kind == 'u':
2503+
test_arr[1,3] = -5 % np.iinfo(types[i]).max
25042504
else:
2505-
new_type = array_dtype.newbyteorder('S')
2506-
test_arr = np.ones((3,4), dtype=new_type)
2507-
if np.dtype(types[i]).kind == 'u':
2508-
test_arr[1,3] = -5 % np.iinfo(types[i]).max
2509-
else:
2510-
test_arr[1,3] = -5
2511-
test_arr[2,2] = 7
2512-
# Initialize the Image from it.
2513-
test_im = galsim.Image(test_arr)
2514-
# Check that the image.array attribute matches the original.
2515-
np.testing.assert_array_equal(
2516-
test_arr, test_im.array,
2517-
err_msg="Image constructor mangled input NumPy array (endian issues).")
2505+
test_arr[1,3] = -5
2506+
test_arr[2,2] = 7
2507+
# Initialize the Image from it.
2508+
test_im = galsim.Image(test_arr)
2509+
# Check that the image.array attribute matches the original.
2510+
np.testing.assert_array_equal(
2511+
test_arr, test_im.array,
2512+
err_msg="Image constructor mangled input NumPy array (endian issues).")
25182513

25192514
check_pickle(test_im)
25202515

0 commit comments

Comments
 (0)