[med-svn] [Git][med-team/nitime][upstream] New upstream version 0.10.2

Andreas Tille (@tille) gitlab at salsa.debian.org
Mon Dec 11 13:58:44 GMT 2023



Andreas Tille pushed to branch upstream at Debian Med / nitime


Commits:
405e6811 by Andreas Tille at 2023-12-11T14:49:05+01:00
New upstream version 0.10.2
- - - - -


23 changed files:

- + .git_archival.txt
- + .gitattributes
- .github/workflows/test.yml
- .github/workflows/wheels.yml
- .gitignore
- − MANIFEST.in
- README.txt
- + min-requirements.txt
- nitime/__init__.py
- nitime/algorithms/spectral.py
- nitime/algorithms/tests/test_coherence.py
- nitime/algorithms/tests/test_spectral.py
- nitime/tests/test_algorithms.py
- nitime/tests/test_lazy.py
- nitime/utils.py
- − nitime/version.py
- nitime/viz.py
- pyproject.toml
- requirements-dev.txt
- requirements.txt
- setup.py
- − setup_egg.py
- + tools/update_requirements.py


Changes:

=====================================
.git_archival.txt
=====================================
@@ -0,0 +1,4 @@
+node: 1dc1d22c239664e2cba9756f61d86bd7467d5d5a
+node-date: 2023-10-02T11:16:01-07:00
+describe-name: 0.10.2
+ref-names: HEAD -> master, tag: 0.10.2


=====================================
.gitattributes
=====================================
@@ -0,0 +1 @@
+.git_archival.txt  export-subst


=====================================
.github/workflows/test.yml
=====================================
@@ -16,13 +16,16 @@ concurrency:
 
 
 jobs:
-  build:
+  test:
 
     runs-on: ubuntu-latest
     strategy:
-      max-parallel: 4
       matrix:
-        python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
+        python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
+        requires: ['requirements.txt']
+        include:
+          - python-version: '3.8'
+            requires: 'min-requirements.txt'
 
     steps:
     - name: Checkout repo
@@ -31,10 +34,11 @@ jobs:
       uses: actions/setup-python at v4
       with:
         python-version: ${{ matrix.python-version }}
+        allow-prereleases: true
     - name: Install
       run: |
         python -m pip install --upgrade pip
-        python -m pip install -r requirements.txt
+        python -m pip install -r ${{ matrix.requires }}
         python -m pip install -r requirements-dev.txt
         python -m pip install .
     - name: Lint
@@ -42,4 +46,4 @@ jobs:
         pipx run flake8 --ignore N802,N806,W504 --select W503 nitime/ tools/
     - name: Test
       run: |
-        cd && mkdir for_test && cd for_test && pytest --pyargs nitime --cov-report term-missing --cov=AFQ
+        mkdir ~/for_test && cd ~/for_test && pytest --pyargs nitime --cov-report term-missing --cov=nitime


=====================================
.github/workflows/wheels.yml
=====================================
@@ -40,6 +40,8 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout at v3
+        with:
+          fetch-depth: 0
       - name: Build sdist
         run: pipx run build -s
       - uses: actions/upload-artifact at v3
@@ -59,16 +61,23 @@ jobs:
           - [ubuntu-20.04, musllinux_x86_64]
           - [macos-12, macosx_*]
           - [windows-2019, win_amd64]
-        python: ["cp37", "cp38", "cp39", "cp310", "cp311"]
+        python: ["cp38", "cp39", "cp310", "cp311", "cp312"]
         include:
           # Manylinux builds are cheap, do all in one
           - { buildplat: ["ubuntu-20.04", "manylinux_x86_64"], python: "*" }
 
     steps:
       - uses: actions/checkout at v3
+        with:
+          fetch-depth: 0
+
+      - uses: actions/setup-python at v3
+
+      - name: Update pip/pipx
+        run: pip install --upgrade pip pipx
 
       - name: Build wheel(s)
-        run: pipx run cibuildwheel
+        run: pipx run --spec "cibuildwheel>=2.15" cibuildwheel
         env:
           CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
 


=====================================
.gitignore
=====================================
@@ -1,6 +1,16 @@
+# Compiled python files
 *.pyc
+
+# Editor swap files
 *~
+.*.swp
 
+# Build artifacts
 *.so
 *.c
+*.egg-info/
 build/
+dist/
+
+# setuptools_scm
+nitime/_version.py


=====================================
MANIFEST.in deleted
=====================================
@@ -1,18 +0,0 @@
-include *.txt *.py
-include THANKS
-include LICENSE
-include INSTALL
-
-graft nitime
-graft doc
-graft tools
-
-# docs subdirs we want to skip
-prune doc/_build
-prune doc/api/generated
-
-global-exclude *~
-global-exclude *.flc
-global-exclude *.pyc
-global-exclude .dircopy.log
-global-exclude .git


=====================================
README.txt
=====================================
@@ -21,7 +21,7 @@ Mailing Lists
 
 Please see the developer's list here::
 
-    http://mail.scipy.org/mailman/listinfo/nipy-devel
+    https://mail.python.org/mailman/listinfo/neuroimaging
 
 Code
 ====
@@ -48,5 +48,5 @@ for usage, and a DISCLAIMER OF ALL WARRANTIES.
 
 All trademarks referenced herein are property of their respective holders.
 
-Copyright (c) 2006-2011, NIPY Developers
+Copyright (c) 2006-2023, NIPY Developers
 All rights reserved.


=====================================
min-requirements.txt
=====================================
@@ -0,0 +1,8 @@
+# Auto-generated by tools/update_requirements.py
+--only-binary numpy,scipy
+--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
+matplotlib==3.5
+numpy==1.22
+scipy==1.8
+networkx==2.7
+nibabel==4.0


=====================================
nitime/__init__.py
=====================================
@@ -21,7 +21,7 @@ have all of these things at their fingertips.
 
 __docformat__ = 'restructuredtext'
 
-from .version import  __version__
+from ._version import  __version__
 
 from . import algorithms
 from . import timeseries


=====================================
nitime/algorithms/spectral.py
=====================================
@@ -523,7 +523,7 @@ def multi_taper_psd(
     """
     # have last axis be time series for now
     N = s.shape[-1]
-    M = int(np.product(s.shape[:-1]))
+    M = int(np.prod(s.shape[:-1]))
 
     if BW is not None:
         # BW wins in a contest (since it was the original implementation)
@@ -663,7 +663,7 @@ def multi_taper_csd(s, Fs=2 * np.pi, NW=None, BW=None, low_bias=True,
     """
     # have last axis be time series for now
     N = s.shape[-1]
-    M = int(np.product(s.shape[:-1]))
+    M = int(np.prod(s.shape[:-1]))
 
     if BW is not None:
         # BW wins in a contest (since it was the original implementation)


=====================================
nitime/algorithms/tests/test_coherence.py
=====================================
@@ -8,7 +8,7 @@ import warnings
 
 import numpy as np
 import numpy.testing as npt
-from scipy.signal import signaltools
+from scipy import signal
 import pytest
 
 import matplotlib
@@ -203,7 +203,7 @@ def test_correlation_spectrum():
 # XXX FIXME: http://github.com/nipy/nitime/issues/issue/1
 @pytest.mark.skipif(True, reason="http://github.com/nipy/nitime/issues/issue/1")
 def test_coherence_linear_dependence():
-    """
+    r"""
     Tests that the coherence between two linearly dependent time-series
     behaves as expected.
 
@@ -239,7 +239,7 @@ def test_coherence_linear_dependence():
               "Fs": 2 * np.pi}
 
     f, c = tsa.coherence(np.vstack([x, y]), csd_method=method)
-    c_t = np.abs(signaltools.resample(c_t, c.shape[-1]))
+    c_t = np.abs(signal.resample(c_t, c.shape[-1]))
 
     npt.assert_array_almost_equal(c[0, 1], c_t, 2)
 


=====================================
nitime/algorithms/tests/test_spectral.py
=====================================
@@ -70,12 +70,12 @@ def test_get_spectra_complex():
         r, _, _ = utils.ar_generator(N=2 ** 16)  # It needs to be that long for
                                                  # the answers to converge
         c, _, _ = utils.ar_generator(N=2 ** 16)
-        arsig1 = r + c * scipy.sqrt(-1)
+        arsig1 = r + c * 1j
 
         r, _, _ = utils.ar_generator(N=2 ** 16)
         c, _, _ = utils.ar_generator(N=2 ** 16)
 
-        arsig2 = r + c * scipy.sqrt(-1)
+        arsig2 = r + c * 1j
         avg_pwr1.append((arsig1 * arsig1.conjugate()).mean())
         avg_pwr2.append((arsig2 * arsig2.conjugate()).mean())
 
@@ -118,7 +118,7 @@ def test_periodogram():
     N = 1024
     r, _, _ = utils.ar_generator(N=N)
     c, _, _ = utils.ar_generator(N=N)
-    arsig = r + c * scipy.sqrt(-1)
+    arsig = r + c * 1j
 
     f, c = tsa.periodogram(arsig)
     npt.assert_equal(f.shape[0], N)  # Should be N, not the one-sided N/2 + 1
@@ -143,11 +143,11 @@ def test_periodogram_csd():
     N = 1024
     r, _, _ = utils.ar_generator(N=N)
     c, _, _ = utils.ar_generator(N=N)
-    arsig1 = r + c * scipy.sqrt(-1)
+    arsig1 = r + c * 1j
 
     r, _, _ = utils.ar_generator(N=N)
     c, _, _ = utils.ar_generator(N=N)
-    arsig2 = r + c * scipy.sqrt(-1)
+    arsig2 = r + c * 1j
 
     tseries = np.vstack([arsig1, arsig2])
 


=====================================
nitime/tests/test_algorithms.py
=====================================
@@ -3,8 +3,7 @@ import os
 import numpy as np
 import numpy.testing as npt
 
-from scipy.signal import signaltools
-from scipy import fftpack
+from scipy import fftpack, signal
 
 import nitime
 from nitime import algorithms as tsa
@@ -24,16 +23,16 @@ def test_scipy_resample():
          for f in freq_list]
     tst = np.array(a).sum(axis=0)
     # interpolate to 128 Hz sampling
-    t_up = signaltools.resample(tst, 128)
+    t_up = signal.resample(tst, 128)
     np.testing.assert_array_almost_equal(t_up[::2], tst)
     # downsample to 32 Hz
-    t_dn = signaltools.resample(tst, 32)
+    t_dn = signal.resample(tst, 32)
     np.testing.assert_array_almost_equal(t_dn, tst[::2])
 
     # downsample to 48 Hz, and compute the sampling analytically for comparison
     dn_samp_ana = np.array([np.sin(2 * np.pi * f * np.linspace(0, 1, 48, endpoint=False))
                             for f in freq_list]).sum(axis=0)
-    t_dn2 = signaltools.resample(tst, 48)
+    t_dn2 = signal.resample(tst, 48)
     npt.assert_array_almost_equal(t_dn2, dn_samp_ana)
 
 


=====================================
nitime/tests/test_lazy.py
=====================================
@@ -37,6 +37,6 @@ def test_lazy_noreload():
         with pytest.raises(ImportError) as e_info:
             reload(mod)
     elif major == 3:
-        import imp
+        import importlib
         with pytest.raises(ImportError) as e_info:
-            imp.reload(mod)
+            importlib.reload(mod)


=====================================
nitime/utils.py
=====================================
@@ -730,9 +730,8 @@ def tapered_spectra(s, tapers, NFFT=None, low_bias=True):
     if NFFT is None or NFFT < N:
         NFFT = N
     rest_of_dims = s.shape[:-1]
-    M = int(np.product(rest_of_dims))
 
-    s = s.reshape(int(np.product(rest_of_dims)), N)
+    s = s.reshape(-1, N)
     # de-mean this sucker
     s = remove_bias(s, axis=-1)
 
@@ -1193,7 +1192,7 @@ def fftconvolve(in1, in2, mode="full", axis=None):
     if mode == "full":
         return ret
     elif mode == "same":
-        if np.product(s1, axis=0) > np.product(s2, axis=0):
+        if np.prod(s1, axis=0) > np.prod(s2, axis=0):
             osize = s1
         else:
             osize = s2


=====================================
nitime/version.py deleted
=====================================
@@ -1,99 +0,0 @@
-"""nitime version/release information"""
-
-# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
-_version_major = 0
-_version_minor = 10
-_version_micro = 1  # use '' for first of series, number for 1 and above
-# _version_extra = 'dev'
-_version_extra = ''  # Uncomment this for full releases
-
-# Construct full version string from these.
-_ver = [_version_major, _version_minor]
-if _version_micro:
-    _ver.append(_version_micro)
-if _version_extra:
-    _ver.append(_version_extra)
-
-__version__ = '.'.join(map(str, _ver))
-
-CLASSIFIERS = ["Development Status :: 3 - Alpha",
-               "Environment :: Console",
-               "Intended Audience :: Science/Research",
-               "License :: OSI Approved :: BSD License",
-               "Operating System :: OS Independent",
-               "Programming Language :: Python",
-               "Topic :: Scientific/Engineering"]
-
-description = "Nitime: timeseries analysis for neuroscience data"
-
-# Note: this long_description is actually a copy/paste from the top-level
-# README.txt, so that it shows up nicely on PyPI.  So please remember to edit
-# it only in one place and sync it correctly.
-long_description = """
-===================================================
- Nitime: timeseries analysis for neuroscience data
-===================================================
-
-Nitime is library of tools and algorithms for the analysis of time-series data
-from neuroscience experiments. It contains a implementation of numerical
-algorithms for time-series analysis both in the time and spectral domains, a
-set of container objects to represent time-series, and auxiliary objects that
-expose a high level interface to the numerical machinery and make common
-analysis tasks easy to express with compact and semantically clear code.
-
-Website and mailing list
-========================
-
-Current information can always be found at the nitime `website`_. Questions and
-comments can be directed to the mailing `list`_.
-
-.. _website: http://nipy.org/nitime
-.. _list: http://mail.scipy.org/mailman/listinfo/nipy-devel
-
-Code
-====
-
-You can find our sources and single-click downloads:
-
-* `Main repository`_ on Github.
-* Documentation_ for all releases and current development tree.
-* Download as a tar/zip file the `current trunk`_.
-* Downloads of all `available releases`_.
-
-.. _main repository: http://github.com/nipy/nitime
-.. _Documentation: http://nipy.org/nitime
-.. _current trunk: http://github.com/nipy/nitime/archives/master
-.. _available releases: http://github.com/nipy/nitime/downloads
-
-
-License information
-===================
-
-Nitime is licensed under the terms of the new BSD license. See the file
-"LICENSE" for information on the history of this software, terms & conditions
-for usage, and a DISCLAIMER OF ALL WARRANTIES.
-
-All trademarks referenced herein are property of their respective holders.
-
-Copyright (c) 2006-2020, NIPY Developers
-All rights reserved.
-"""
-
-NAME = "nitime"
-MAINTAINER = "Nipy Developers"
-MAINTAINER_EMAIL = "neuroimaging at python.org"
-DESCRIPTION = description
-LONG_DESCRIPTION = long_description
-URL = "http://nipy.org/nitime"
-DOWNLOAD_URL = "http://github.com/nipy/nitime/downloads"
-LICENSE = "Simplified BSD"
-AUTHOR = "Nitime developers"
-AUTHOR_EMAIL = "neuroimaging at python.org"
-PLATFORMS = "OS Independent"
-MAJOR = _version_major
-MINOR = _version_minor
-MICRO = _version_micro
-VERSION = __version__
-PACKAGE_DATA = {"nitime": ["LICENSE", "tests/*.txt", "tests/*.npy",
-                           "data/*.nii.gz", "data/*.txt", "data/*.csv"]}
-PYTHON_REQUIRES = ">=3.7"


=====================================
nitime/viz.py
=====================================
@@ -680,7 +680,7 @@ def draw_graph(G,
 
     # Build a 'weighted degree' array obtained by adding the (absolute value)
     # of the weights for all edges pointing to each node:
-    amat = nx.adjacency_matrix(G).todense()  # get a normal array out of it
+    amat = nx.to_numpy_array(G)  # get a normal array out of it
     degarr = abs(amat).sum(0)  # weights are sums across rows
 
     # Map the degree to the 0-1 range so we can use it for sizing the nodes.


=====================================
pyproject.toml
=====================================
@@ -1,19 +1,63 @@
 [build-system]
 requires = [
   "setuptools",
+  "setuptools_scm[toml]>=6.2",
   "cython",
-  # Newer than NEP29-minimum: compile against oldest numpy available
-  "numpy==1.24; python_version >= '3.11'",
-  "numpy==1.22; python_version >= '3.10' and python_version < '3.11'",
-  # NEP29-minimum as of Jan 31, 2023
-  "numpy==1.21; python_version >= '3.7' and python_version < '3.10'",
+  # As of numpy 1.25, you can now build against older APIs.
+  # https://numpy.org/doc/stable/release/1.25.0-notes.html
+  "numpy>=1.25; python_version > '3.8'",
+  # NEP29-minimum as of Aug 17, 2023 (1.25 doesn't support 3.8)
+  "numpy==1.22; python_version == '3.8'",
 ]
 build-backend = "setuptools.build_meta"
 
+[project]
+name = "nitime"
+dynamic = ["version"]
+description = "Nitime: timeseries analysis for neuroscience data"
+readme = "README.txt"
+license = { file = "LICENSE" }
+requires-python = ">=3.8"
+authors = [
+    { name = "Nitime developers", email = "neuroimaging at python.org" },
+]
+maintainers = [
+    { name = "Nipy Developers", email = "neuroimaging at python.org" },
+]
+classifiers = [
+    "Development Status :: 3 - Alpha",
+    "Environment :: Console",
+    "Intended Audience :: Science/Research",
+    "License :: OSI Approved :: BSD License",
+    "Operating System :: OS Independent",
+    "Programming Language :: Python",
+    "Topic :: Scientific/Engineering",
+]
+dependencies = [
+    "matplotlib>=3.5",
+    "numpy>=1.22",
+    "scipy>=1.8",
+]
+
+[project.optional-dependencies]
+full = [
+    "networkx>=2.7",
+    "nibabel>=4.0",
+]
+
+[project.urls]
+Download = "http://github.com/nipy/nitime/downloads"
+Homepage = "http://nipy.org/nitime"
+
+[tool.setuptools.packages.find]
+include = ["nitime*"]
+
+[tool.setuptools_scm]
+write_to = "nitime/_version.py"
+
 [tool.cibuildwheel]
-# Disable CPython 3.6 here; if project.requires-python gets defined,
-# cp36* can be removed
-skip = "pp* cp36*"
+# Disable PyPy
+skip = "pp*"
 
 # 64-bit builds only; 32-bit builds seem pretty niche these days, so
 # don't bother unless someone asks


=====================================
requirements-dev.txt
=====================================
@@ -3,3 +3,4 @@ pytest
 pytest-cov
 nibabel
 networkx
+tomli; python_version < '3.11'


=====================================
requirements.txt
=====================================
@@ -1,6 +1,8 @@
-numpy
-cython
-scipy
-matplotlib
-networkx
-nibabel
+# Auto-generated by tools/update_requirements.py
+--only-binary numpy,scipy
+--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
+matplotlib>=3.5
+numpy>=1.22
+scipy>=1.8
+networkx>=2.7
+nibabel>=4.0


=====================================
setup.py
=====================================
@@ -1,63 +1,29 @@
 #!/usr/bin/env python
-"""Setup file for the Python nitime package."""
+"""Setup file for the Python nitime package.
 
-import os
-import sys
-
-# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
-# update it when the contents of directories change.
-if os.path.exists('MANIFEST'):
-    os.remove('MANIFEST')
-
-from setuptools import find_packages, setup
-
-# Get version and release info, which is all stored in nitime/version.py
-ver_file = os.path.join('nitime', 'version.py')
-with open(ver_file) as f:
-    exec(f.read())
-
-REQUIRES = []
-
-with open('requirements.txt') as f:
-    ll = f.readline()[:-1]
-    while ll:
-        REQUIRES.append(ll)
-        ll = f.readline()[:-1]
-
-PACKAGES = find_packages()
-
-
-opts = dict(name=NAME,
-            maintainer=MAINTAINER,
-            maintainer_email=MAINTAINER_EMAIL,
-            description=DESCRIPTION,
-            long_description=LONG_DESCRIPTION,
-            url=URL,
-            download_url=DOWNLOAD_URL,
-            license=LICENSE,
-            classifiers=CLASSIFIERS,
-            author=AUTHOR,
-            author_email=AUTHOR_EMAIL,
-            platforms=PLATFORMS,
-            version=VERSION,
-            packages=PACKAGES,
-            package_data=PACKAGE_DATA,
-            install_requires=REQUIRES,
-            requires=REQUIRES,
-            python_requires=PYTHON_REQUIRES,
-            )
+This file only contains cython components.
+See pyproject.toml for the remaining configuration.
+"""
+from setuptools import setup
 
 try:
     from setuptools import Extension
     from Cython.Build import cythonize
     from numpy import get_include
+
     # add Cython extensions to the setup options
-    exts = [Extension('nitime._utils', ['nitime/_utils.pyx'],
-                      include_dirs=[get_include()])]
-    opts['ext_modules'] = cythonize(exts, language_level='3')
+    exts = [
+        Extension(
+            'nitime._utils',
+            ['nitime/_utils.pyx'],
+            include_dirs=[get_include()],
+            define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')],
+        )
+    ]
+    opts = {'ext_modules': cythonize(exts, language_level='3')}
 except ImportError:
     # no loop for you!
-    pass
+    opts = {}
 
 # Now call the actual setup function
 if __name__ == '__main__':


=====================================
setup_egg.py deleted
=====================================
@@ -1,2 +0,0 @@
-from setuptools import setup
-execfile('setup.py')


=====================================
tools/update_requirements.py
=====================================
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+import sys
+from pathlib import Path
+
+try:
+    import tomllib
+except ImportError:
+    import tomli as tomllib
+
+repo_root = Path(__file__).parent.parent
+pyproject_toml = repo_root / 'pyproject.toml'
+reqs = repo_root / 'requirements.txt'
+min_reqs = repo_root / 'min-requirements.txt'
+
+with open(pyproject_toml, 'rb') as fobj:
+    config = tomllib.load(fobj)
+    project = config['project']
+requirements = project['dependencies'] + project['optional-dependencies']['full']
+
+script_name = Path(__file__).relative_to(repo_root)
+
+lines = [
+    f'# Auto-generated by {script_name}',
+    '--only-binary numpy,scipy',
+    '--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple',
+    '',
+]
+start = len(lines) - 1
+
+# Write requirements
+lines[start:-1] = requirements
+reqs.write_text('\n'.join(lines))
+
+# Write minimum requirements
+lines[start:-1] = [req.replace('>=', '==').replace('~=', '==') for req in requirements]
+min_reqs.write_text('\n'.join(lines))



View it on GitLab: https://salsa.debian.org/med-team/nitime/-/commit/405e681117cd6b22255c6111f1258e82c9c58796

-- 
View it on GitLab: https://salsa.debian.org/med-team/nitime/-/commit/405e681117cd6b22255c6111f1258e82c9c58796
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/20231211/187d0373/attachment-0001.htm>


More information about the debian-med-commit mailing list