[med-svn] [Git][med-team/nitime][master] 2 commits: Adapt to numpy 1.24

Andreas Tille (@tille) gitlab at salsa.debian.org
Fri Jan 20 19:40:57 GMT 2023



Andreas Tille pushed to branch master at Debian Med / nitime


Commits:
88b90af1 by Andreas Tille at 2023-01-20T19:54:57+01:00
Adapt to numpy 1.24

- - - - -
039897c4 by Andreas Tille at 2023-01-20T20:40:33+01:00
Fix numpydoc 1.24 issues

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/numpy_1.24.patch
- + debian/patches/numpydoc_1.24.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+nitime (0.9-5) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Adapt to numpy 1.24
+    Closes: #1029245
+  * Fix numpydoc 1.24 issues
+
+ -- Andreas Tille <tille at debian.org>  Fri, 20 Jan 2023 19:21:34 +0100
+
 nitime (0.9-4) unstable; urgency=medium
 
   * Add patch to fix test_psd_matlab (Closes: #1027550)


=====================================
debian/patches/numpy_1.24.patch
=====================================
@@ -0,0 +1,71 @@
+Description: Adapt to numpy 1.24
+Bug-Debian: https://bugs.debian.org/1029245
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Fri, 20 Jan 2023 19:21:34 +0100
+
+--- a/nitime/algorithms/cohere.py
++++ b/nitime/algorithms/cohere.py
+@@ -1005,7 +1005,7 @@ def cache_fft(time_series, ij, lb=0, ub=
+     FFT_conj_slices = {}
+ 
+     for i_channel in all_channels:
+-        Slices = np.zeros((n_slices, n_freqs), dtype=np.complex)
++        Slices = np.zeros((n_slices, n_freqs), dtype=complex)
+         for iSlice in range(n_slices):
+             thisSlice = time_series[i_channel,
+                                     i_times[iSlice]:i_times[iSlice] + NFFT]
+@@ -1161,7 +1161,7 @@ def cache_to_relative_phase(cache, ij):
+     channels_i = max(1, max(ij_array[:, 0]) + 1)
+     channels_j = max(1, max(ij_array[:, 1]) + 1)
+     # Pre-allocate for speed:
+-    Phi_xy = np.zeros((channels_i, channels_j, freqs), dtype=np.complex)
++    Phi_xy = np.zeros((channels_i, channels_j, freqs), dtype=complex)
+ 
+     # These checks take time, so do them up front, not in every iteration:
+     if list(FFT_slices.items())[0][1].shape[0] > 1:
+@@ -1221,7 +1221,7 @@ def cache_to_coherency(cache, ij):
+ 
+     channels_i = max(1, max(ij_array[:, 0]) + 1)
+     channels_j = max(1, max(ij_array[:, 1]) + 1)
+-    Cxy = np.zeros((channels_i, channels_j, freqs), dtype=np.complex)
++    Cxy = np.zeros((channels_i, channels_j, freqs), dtype=complex)
+ 
+     #These checks take time, so do them up front, not in every iteration:
+     if list(FFT_slices.items())[0][1].shape[0] > 1:
+--- a/nitime/analysis/coherence.py
++++ b/nitime/analysis/coherence.py
+@@ -653,10 +653,10 @@ class SeedCoherenceAnalyzer(object):
+         if len(self.seed.shape) > 1:
+             Cxy = np.empty((self.seed.data.shape[0],
+                             self.target.data.shape[0],
+-                            self.frequencies.shape[0]), dtype=np.complex)
++                            self.frequencies.shape[0]), dtype=complex)
+         else:
+             Cxy = np.empty((self.target.data.shape[0],
+-                            self.frequencies.shape[0]), dtype=np.complex)
++                            self.frequencies.shape[0]), dtype=complex)
+ 
+         #Get the fft window cache for the target time-series:
+         cache = self.target_cache
+--- a/nitime/tests/test_algorithms.py
++++ b/nitime/tests/test_algorithms.py
+@@ -145,7 +145,7 @@ def test_psd_matlab():
+     ts = np.loadtxt(os.path.join(test_dir_path, 'tseries12.txt'))
+ 
+     #Complex signal!
+-    ts0 = ts[1] + ts[0] * np.complex(0, 1)
++    ts0 = ts[1] + ts[0] * complex(0, 1)
+ 
+     NFFT = 256
+     Fs = 1.0
+--- a/nitime/analysis/correlation.py
++++ b/nitime/analysis/correlation.py
+@@ -147,7 +147,7 @@ class SeedCorrelationAnalyzer(object):
+ 
+             # Preallocate results
+             Cxy = np.empty((self.seed.data.shape[0],
+-                            self.target.data.shape[0]), dtype=np.float)
++                            self.target.data.shape[0]), dtype=float)
+ 
+             for seed_idx, this_seed in enumerate(self.seed.data):
+ 


=====================================
debian/patches/numpydoc_1.24.patch
=====================================
@@ -0,0 +1,18 @@
+Description: Adapt to numpydoc 1.24
+Bug-Debian: https://bugs.debian.org/1029245
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Fri, 20 Jan 2023 19:21:34 +0100
+
+--- a/doc/sphinxext/docscrape.py
++++ b/doc/sphinxext/docscrape.py
+@@ -428,8 +428,8 @@ class FunctionDoc(NumpyDocString):
+             func, func_name = self.get_func()
+             try:
+                 # try to read signature
+-                argspec = inspect.getargspec(func)
+-                argspec = inspect.formatargspec(*argspec)
++                argspec = inspect.getfullargspec(func)
++                # FIXME: No idea what to do here - just commenting it out# argspec = inspect.formatargspec(*argspec)
+                 argspec = argspec.replace('*','\*')
+                 signature = '%s%s' % (func_name, argspec)
+             except TypeError as e:


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,5 @@ python3
 sphinx_ignore_github.patch
 do-not-set-lowerbound-zero-in-iir.patch
 fix-psd-test.patch
+numpy_1.24.patch
+numpydoc_1.24.patch



View it on GitLab: https://salsa.debian.org/med-team/nitime/-/compare/e863169b4b32411a5aebd8f55aa0b471c62460ca...039897c46ec436a513463fcfa997d02dcbea1417

-- 
View it on GitLab: https://salsa.debian.org/med-team/nitime/-/compare/e863169b4b32411a5aebd8f55aa0b471c62460ca...039897c46ec436a513463fcfa997d02dcbea1417
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230120/6f744582/attachment-0001.htm>


More information about the debian-med-commit mailing list