From 2872944cd0bec5d59c56ce634b67b02dc3895b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Wed, 10 Apr 2024 09:41:47 +0200 Subject: [PATCH] BUG: fix compatibility with numpy 2.0.0 (copy semantics) --- ccdproc/tests/test_ccdproc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ccdproc/tests/test_ccdproc.py b/ccdproc/tests/test_ccdproc.py index eac5276a..3811ed7c 100644 --- a/ccdproc/tests/test_ccdproc.py +++ b/ccdproc/tests/test_ccdproc.py @@ -28,6 +28,7 @@ except ImportError: HAS_BLOCK_X_FUNCS = False +_NUMPY_COPY_IF_NEEDED = False if np.__version__.startswith("1.") else None # Test creating deviation # Success expected if u_image * u_gain = u_readnoise @@ -977,7 +978,7 @@ def test_wcs_project_onto_scale_wcs(): # Mask should be true for four pixels (all nearest neighbors) # of the single pixel we masked initially. - new_center = np.array(new_ccd.wcs.wcs.crpix, dtype=int, copy=False) + new_center = np.array(new_ccd.wcs.wcs.crpix, dtype=int, copy=_NUMPY_COPY_IF_NEEDED) assert np.all(new_ccd.mask[new_center[0]:new_center[0]+2, new_center[1]:new_center[1]+2])