From 3e9592a0cea215b6f9af71a0b0721135fd29c75f 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 (5694194) --- diff --git a/.gitignore b/.gitignore index 4816d65..0393e96 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /nipy-7eede02471567487e454016c1e7cf637d3afac9e.tar.gz /nipy-5d539326c92f23a2fa782a70d5b4b5f70a0097d7.tar.gz /nipy-27da5902fb7aae18961c2c8dca7c4317f94ecb16.tar.gz +/nipy-5694194165c2533d40c88df94e820194016d4841.tar.gz diff --git a/511.patch b/511.patch deleted file mode 100644 index 5073825..0000000 --- a/511.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 7c131e7487c39d30d278b0f07e59b80ee04a6f0d Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Thu, 21 Sep 2023 10:35:47 -0400 -Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20use=20nose.tools.assert=5Fequal?= - =?UTF-8?q?s?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Use nose.tools.assert_equal instead. - -Since unittest.TestCase.assertEquals is a deprecated alias for -unittest.TestCase.TestCase.assertEqual, and is removed in Python 3.12, -and since the nose.tools assertion names are apparently automagically -generated from the unittest.TestCase assertion methods, -nose.tools.assert_equals is also removed in Python 3.12 (when nose is -otherwise patched to work with Python 3.12). ---- - nipy/labs/datasets/tests/test_converters.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/nipy/labs/datasets/tests/test_converters.py b/nipy/labs/datasets/tests/test_converters.py -index 98aff00da0..55451625ec 100644 ---- a/nipy/labs/datasets/tests/test_converters.py -+++ b/nipy/labs/datasets/tests/test_converters.py -@@ -18,9 +18,9 @@ def test_conversion(): - - brifti_obj = nib.load(data_file) - vol_img = as_volume_img(data_file) -- yield nose.tools.assert_equals, as_volume_img(vol_img), \ -+ yield nose.tools.assert_equal, as_volume_img(vol_img), \ - vol_img -- yield nose.tools.assert_equals, as_volume_img(brifti_obj), \ -+ yield nose.tools.assert_equal, as_volume_img(brifti_obj), \ - vol_img - - -@@ -42,7 +42,7 @@ def test_save(): - import nifti - def test_from_nifti(): - nim = nifti.NiftiImage(data_file) -- yield nose.tools.assert_equals, as_volume_img(data_file), \ -+ yield nose.tools.assert_equal, as_volume_img(data_file), \ - as_volume_img(nim) - - except ImportError: diff --git a/9fbe55494c62727006f143dc66cf6423c0884a56.patch b/9fbe55494c62727006f143dc66cf6423c0884a56.patch deleted file mode 100644 index b0988c4..0000000 --- a/9fbe55494c62727006f143dc66cf6423c0884a56.patch +++ /dev/null @@ -1,221 +0,0 @@ -From 9fbe55494c62727006f143dc66cf6423c0884a56 Mon Sep 17 00:00:00 2001 -From: Chris Markiewicz -Date: Wed, 5 Apr 2023 13:46:10 -0400 -Subject: [PATCH] FIX: Rename setattr_on_read to auto_attr - ---- - nipy/algorithms/statistics/models/model.py | 8 ++--- - .../statistics/models/regression.py | 30 +++++++++---------- - nipy/core/image/image.py | 12 ++++---- - 3 files changed, 25 insertions(+), 25 deletions(-) - -diff --git a/nipy/algorithms/statistics/models/model.py b/nipy/algorithms/statistics/models/model.py -index 88a46e3d77..b3535bc626 100644 ---- a/nipy/algorithms/statistics/models/model.py -+++ b/nipy/algorithms/statistics/models/model.py -@@ -6,7 +6,7 @@ - - from scipy.stats import t as t_distribution - --from nibabel.onetime import setattr_on_read -+from nibabel.onetime import auto_attr - - from ...utils.matrices import pos_recipr - -@@ -121,14 +121,14 @@ def __init__(self, theta, Y, model, cov=None, dispersion=1., nuisance=None, - # put this as a parameter of LikelihoodModel - self.df_resid = self.df_total - self.df_model - -- @setattr_on_read -+ @auto_attr - def logL(self): - """ - The maximized log-likelihood - """ - return self.model.logL(self.theta, self.Y, nuisance=self.nuisance) - -- @setattr_on_read -+ @auto_attr - def AIC(self): - """ - Akaike Information Criterion -@@ -136,7 +136,7 @@ def AIC(self): - p = self.theta.shape[0] - return -2 * self.logL + 2 * p - -- @setattr_on_read -+ @auto_attr - def BIC(self): - """ - Schwarz's Bayesian Information Criterion -diff --git a/nipy/algorithms/statistics/models/regression.py b/nipy/algorithms/statistics/models/regression.py -index 947950d1ee..e665936c09 100644 ---- a/nipy/algorithms/statistics/models/regression.py -+++ b/nipy/algorithms/statistics/models/regression.py -@@ -30,7 +30,7 @@ - from scipy import stats - import scipy.linalg as spl - --from nibabel.onetime import setattr_on_read -+from nibabel.onetime import auto_attr - - from nipy.algorithms.utils.matrices import matrix_rank, pos_recipr - -@@ -262,7 +262,7 @@ def whiten(self, X): - """ - return X - -- @setattr_on_read -+ @auto_attr - def has_intercept(self): - """ - Check if column of 1s is in column space of design -@@ -274,7 +274,7 @@ def has_intercept(self): - return True - return False - -- @setattr_on_read -+ @auto_attr - def rank(self): - """ Compute rank of design matrix - """ -@@ -715,14 +715,14 @@ def __init__(self, theta, Y, model, wY, wresid, cov=None, dispersion=1., - self.wY = wY - self.wresid = wresid - -- @setattr_on_read -+ @auto_attr - def resid(self): - """ - Residuals from the fit. - """ - return self.Y - self.predicted - -- @setattr_on_read -+ @auto_attr - def norm_resid(self): - """ - Residuals, normalized to have unit length. -@@ -742,7 +742,7 @@ def norm_resid(self): - """ - return self.resid * pos_recipr(np.sqrt(self.dispersion)) - -- @setattr_on_read -+ @auto_attr - def predicted(self): - """ Return linear predictor values from a design matrix. - """ -@@ -751,7 +751,7 @@ def predicted(self): - X = self.model.design - return np.dot(X, beta) - -- @setattr_on_read -+ @auto_attr - def R2_adj(self): - """Return the R^2 value for each row of the response Y. - -@@ -768,7 +768,7 @@ def R2_adj(self): - d *= ((self.df_total - 1.) / self.df_resid) - return 1 - d - -- @setattr_on_read -+ @auto_attr - def R2(self): - """ - Return the adjusted R^2 value for each row of the response Y. -@@ -782,7 +782,7 @@ def R2(self): - d = self.SSE / self.SST - return 1 - d - -- @setattr_on_read -+ @auto_attr - def SST(self): - """Total sum of squares. If not from an OLS model this is "pseudo"-SST. - """ -@@ -791,34 +791,34 @@ def SST(self): - "SST inappropriate") - return ((self.wY - self.wY.mean(0)) ** 2).sum(0) - -- @setattr_on_read -+ @auto_attr - def SSE(self): - """Error sum of squares. If not from an OLS model this is "pseudo"-SSE. - """ - return (self.wresid ** 2).sum(0) - -- @setattr_on_read -+ @auto_attr - def SSR(self): - """ Regression sum of squares """ - return self.SST - self.SSE - -- @setattr_on_read -+ @auto_attr - def MSR(self): - """ Mean square (regression)""" - return self.SSR / (self.df_model - 1) - -- @setattr_on_read -+ @auto_attr - def MSE(self): - """ Mean square (error) """ - return self.SSE / self.df_resid - -- @setattr_on_read -+ @auto_attr - def MST(self): - """ Mean square (total) - """ - return self.SST / (self.df_total - 1) - -- @setattr_on_read -+ @auto_attr - def F_overall(self): - """ Overall goodness of fit F test, - comparing model to a model with just an intercept. -diff --git a/nipy/core/image/image.py b/nipy/core/image/image.py -index 96c4859674..1b2e7ba0ee 100644 ---- a/nipy/core/image/image.py -+++ b/nipy/core/image/image.py -@@ -19,7 +19,7 @@ - - import numpy as np - --from nibabel.onetime import setattr_on_read -+from nibabel.onetime import auto_attr - - # These imports are used in the fromarray and subsample functions only, not in - # Image -@@ -80,27 +80,27 @@ class Image(object): - np.diag([3,5,7,1])) - _doc['coordmap'] = "Affine transform mapping from axes coordinates to reference coordinates." - -- @setattr_on_read -+ @auto_attr - def shape(self): - return self._data.shape - _doc['shape'] = "Shape of data array." - -- @setattr_on_read -+ @auto_attr - def ndim(self): - return len(self._data.shape) - _doc['ndim'] = "Number of data dimensions." - -- @setattr_on_read -+ @auto_attr - def reference(self): - return self.coordmap.function_range - _doc['reference'] = "Reference coordinate system." - -- @setattr_on_read -+ @auto_attr - def axes(self): - return self.coordmap.function_domain - _doc['axes'] = "Axes of image." - -- @setattr_on_read -+ @auto_attr - def affine(self): - if hasattr(self.coordmap, "affine"): - return self.coordmap.affine diff --git a/python-nipy.spec b/python-nipy.spec index 7abb3b8..77c6b6b 100644 --- a/python-nipy.spec +++ b/python-nipy.spec @@ -10,7 +10,7 @@ # https://github.com/nipy/nipy/pull/503#issuecomment-1421508175 %bcond_with doc_pdf -%global commit 27da5902fb7aae18961c2c8dca7c4317f94ecb16 +%global commit 5694194165c2533d40c88df94e820194016d4841 %global snapdate 20230921 Name: python-nipy @@ -33,17 +33,6 @@ Source14: nipy_tsdiffana.1 # Account for nibabel 5.0.0 removal of .py3k shim - use numpy.compat.py3k # https://github.com/nipy/nipy/pull/512 Patch: https://github.com/nipy/nipy/pull/512.patch -# FIX: Rename setattr_on_read to auto_attr -# https://github.com/nipy/nipy/pull/507 -# -# Fixes: -# -# Nipy using deprecated nibabel decorator -# https://github.com/nipy/nipy/issues/505 -Patch: https://github.com/nipy/nipy/pull/507/commits/9fbe55494c62727006f143dc66cf6423c0884a56.patch -# Don’t use nose.tools.assert_equals -# https://github.com/nipy/nipy/pull/511 -Patch: https://github.com/nipy/nipy/pull/511.patch BuildRequires: gcc BuildRequires: flexiblas-devel diff --git a/sources b/sources index b5cd35e..24292a3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (nipy-27da5902fb7aae18961c2c8dca7c4317f94ecb16.tar.gz) = 8048a9d569dcca1fb4cf8c4f35924d17059837a1010962e76228794584243070b8854fa767f7dba150c086959508b565d65f088480a0e0f0ea8aab20125ab871 +SHA512 (nipy-5694194165c2533d40c88df94e820194016d4841.tar.gz) = 44b0f9c75a5580f86aea9349c4fb1dc3a20233877e66f641e2e997163ed2a708d497610ee2790b70a21f99a791ddf2622325c00a85b0a744bec043d7963de998