From 8aeb320d8b0c68785127b7f1140b341a383617b4 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Sep 25 2023 17:04:00 +0000 Subject: Update to a current snapshot (5d53932) --- diff --git a/.gitignore b/.gitignore index 7048709..1c43c2d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /nipy-35a5f5205ba2aa54f1f0524564a6f1f8dafb237f.tar.gz /nipy-9512cd93b7215b4c750be3968a600c06f2bd22f6.tar.gz /nipy-7eede02471567487e454016c1e7cf637d3afac9e.tar.gz +/nipy-5d539326c92f23a2fa782a70d5b4b5f70a0097d7.tar.gz diff --git a/0001-Account-for-nibabel-5.0.0-removal-of-.py3k-shim-use-.patch b/0001-Account-for-nibabel-5.0.0-removal-of-.py3k-shim-use-.patch index 7da6010..7211eb7 100644 --- a/0001-Account-for-nibabel-5.0.0-removal-of-.py3k-shim-use-.patch +++ b/0001-Account-for-nibabel-5.0.0-removal-of-.py3k-shim-use-.patch @@ -1,4 +1,4 @@ -From a8faab52ca5e59069ac871f63a8604d2ac26c433 Mon Sep 17 00:00:00 2001 +From 86bed318417caa13c4a95ffb027d7c98edd3067c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 7 Feb 2023 17:49:20 -0500 Subject: [PATCH] Account for nibabel 5.0.0 removal of .py3k shim - use @@ -57,7 +57,7 @@ index c349e381..72c5a096 100644 True """ diff --git a/nipy/core/image/tests/test_image_spaces.py b/nipy/core/image/tests/test_image_spaces.py -index 262b27f7..528bdf7f 100644 +index f48317d1..41bf724f 100644 --- a/nipy/core/image/tests/test_image_spaces.py +++ b/nipy/core/image/tests/test_image_spaces.py @@ -34,7 +34,7 @@ def test_image_xyz_affine(): @@ -70,7 +70,7 @@ index 262b27f7..528bdf7f 100644 assert_array_equal(xyz_affine(nimg), aff) # Any dimensions not spatial, AxesError @@ -77,7 +77,7 @@ def test_image_as_xyz_image(): - assert_array_equal(img.get_data(), img_t0_r.get_data()) + assert_array_equal(img.get_fdata(), img_t0_r.get_fdata()) assert_equal(img.coordmap, img_t0_r.coordmap) # Test against nibabel image - nimg = nib.Nifti1Image(arr, np.diag([2,3,4,1])) @@ -79,10 +79,10 @@ index 262b27f7..528bdf7f 100644 assert_true(nimg is nimg_r) # It's sometimes impossible to make an xyz affable image diff --git a/nipy/io/tests/test_image_io.py b/nipy/io/tests/test_image_io.py -index 5c5d940f..b15fea54 100644 +index 695f9313..37aaaca3 100644 --- a/nipy/io/tests/test_image_io.py +++ b/nipy/io/tests/test_image_io.py -@@ -44,7 +44,7 @@ def test_badfile(): +@@ -45,7 +45,7 @@ def test_badfile(): # nibabel prior 2.1.0 was throwing a ImageFileError for the not-recognized # file type. >=2.1.0 give a FileNotFoundError. try: @@ -92,7 +92,7 @@ index 5c5d940f..b15fea54 100644 FileNotFoundError = IOError assert_raises((ImageFileError, FileNotFoundError), load_image, filename) diff --git a/nipy/labs/spatial_models/parcel_io.py b/nipy/labs/spatial_models/parcel_io.py -index 89030f8d..934d9faa 100644 +index d50f50d2..4eed7931 100644 --- a/nipy/labs/spatial_models/parcel_io.py +++ b/nipy/labs/spatial_models/parcel_io.py @@ -53,7 +53,7 @@ def mask_parcellation(mask_images, nb_parcel, threshold=0, output_image=None): @@ -127,22 +127,22 @@ index c2c6ece2..d3b269dc 100644 ddom = grid_domain_from_image(mim) ddom.make_feature_from_image(nim, 'noise') diff --git a/nipy/labs/spatial_models/tests/test_mroi.py b/nipy/labs/spatial_models/tests/test_mroi.py -index 7f8c5420..0ceb7ad8 100644 +index 26b02da9..4c5cc35c 100644 --- a/nipy/labs/spatial_models/tests/test_mroi.py +++ b/nipy/labs/spatial_models/tests/test_mroi.py @@ -205,8 +205,8 @@ def test_example(): # Test example runs correctly eg_img = pjoin(dirname(__file__), 'some_blobs.nii') nim = load(eg_img) -- mask_image = Nifti1Image((nim.get_data() ** 2 > 0).astype('u8'), +- mask_image = Nifti1Image((nim.get_fdata() ** 2 > 0).astype('u8'), - get_affine(nim)) -+ arr = nim.get_data() ** 2 > 0 ++ arr = nim.get_fdata() ** 2 > 0 + mask_image = Nifti1Image(arr.astype('u1'), get_affine(nim)) domain = grid_domain_from_image(mask_image) - data = nim.get_data() + data = nim.get_fdata() values = data[data != 0] diff --git a/nipy/labs/spatial_models/tests/test_parcel_io.py b/nipy/labs/spatial_models/tests/test_parcel_io.py -index 62d03318..87e8f26b 100644 +index c158841f..4d880c59 100644 --- a/nipy/labs/spatial_models/tests/test_parcel_io.py +++ b/nipy/labs/spatial_models/tests/test_parcel_io.py @@ -17,7 +17,7 @@ def test_mask_parcel(): @@ -152,7 +152,7 @@ index 62d03318..87e8f26b 100644 - mask_image = Nifti1Image(np.ones(shape), np.eye(4)) + mask_image = Nifti1Image(np.ones(shape).astype('u1'), np.eye(4)) wim = mask_parcellation(mask_image, n_parcels) - assert_equal(np.unique(wim.get_data()), np.arange(n_parcels)) + assert_equal(np.unique(wim.get_fdata()), np.arange(n_parcels)) @@ -33,8 +33,8 @@ def test_mask_parcel_multi_subj(): with InTemporaryDirectory(): @@ -231,5 +231,5 @@ index d3fd0fab..e98c47ce 100755 from argparse import ArgumentParser, RawDescriptionHelpFormatter -- -2.39.1 +2.41.0 diff --git a/509.patch b/509.patch deleted file mode 100644 index cbd9961..0000000 --- a/509.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b0de4e839a968520d569a021327df81e5c3841a9 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Thu, 21 Sep 2023 09:34:56 -0400 -Subject: [PATCH] Stop using deprecated unittest.TestCase.assert_() alias - -This was removed in Python 3.12. ---- - nipy/algorithms/clustering/tests/test_clustering.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/nipy/algorithms/clustering/tests/test_clustering.py b/nipy/algorithms/clustering/tests/test_clustering.py -index 361315701..d365748b8 100644 ---- a/nipy/algorithms/clustering/tests/test_clustering.py -+++ b/nipy/algorithms/clustering/tests/test_clustering.py -@@ -17,7 +17,7 @@ def testkmeans1(self): - X = X + 3 * A; - L = np.array([0, 0, 0, 0, 0, 1, 1, 1, 1, 1]) - C, L, J = kmeans(X, 2, L) -- self.assert_(np.mean(L[:7]) < 0.5) -+ self.assertLess(np.mean(L[:7]), 0.5) - - def testkmeans2(self): - X = nr.randn(10000, 2) -@@ -26,7 +26,7 @@ def testkmeans2(self): - L = np.concatenate([np.ones(5000), np.zeros(5000)]).astype(np.int_) - C, L, J = kmeans(X, 2, L) - l = L[:7000].astype(np.float64) -- self.assert_(np.mean(l) > 0.9) -+ self.assertGreater(np.mean(l), 0.9) - - - if __name__ == '__main__': diff --git a/python-nipy.spec b/python-nipy.spec index 0072d10..7f953c1 100644 --- a/python-nipy.spec +++ b/python-nipy.spec @@ -10,8 +10,8 @@ # https://github.com/nipy/nipy/pull/503#issuecomment-1421508175 %bcond_with doc_pdf -%global commit 7eede02471567487e454016c1e7cf637d3afac9e -%global snapdate 20230405 +%global commit 5d539326c92f23a2fa782a70d5b4b5f70a0097d7 +%global snapdate 20230921 Name: python-nipy Version: 0.5.0^%{snapdate}git%(c='%{commit}'; echo "${c:0:7}") @@ -49,9 +49,6 @@ Patch: https://github.com/nipy/nipy/pull/504/commits/a6de01c7484114aa52 # Nipy using deprecated nibabel decorator # https://github.com/nipy/nipy/issues/505 Patch: https://github.com/nipy/nipy/pull/507/commits/9fbe55494c62727006f143dc66cf6423c0884a56.patch -# Stop using deprecated unittest.TestCase.assert_() alias -# https://github.com/nipy/nipy/pull/509 -Patch: https://github.com/nipy/nipy/pull/509.patch BuildRequires: gcc BuildRequires: flexiblas-devel diff --git a/sources b/sources index 730d68c..5d041ef 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nipy-7eede02471567487e454016c1e7cf637d3afac9e.tar.gz) = b9bc48965590d7ad3059cb9468e8add69a345c332bd7af80987ad960cd5ca3b4046d76af1d2ca2e7d29b9721ceb16337ef6c9d40de9ae372a5f299494c613f1e +SHA512 (nipy-5d539326c92f23a2fa782a70d5b4b5f70a0097d7.tar.gz) = 3a84f92272d7219e9f1e20d98812c3d11434350e17559c47416c6a0fc276db55079b226e5b599379412133e64b8d15023d8e98fd5b9eb231ccc0881f0f2e51c0