[med-svn] [Git][med-team/nipy][master] 6 commits: Add sympy 1.6+ support

Michael R. Crusoe gitlab at salsa.debian.org
Sat Feb 20 09:56:12 GMT 2021



Michael R. Crusoe pushed to branch master at Debian Med / nipy


Commits:
db1d4c56 by Michael R. Crusoe at 2021-02-20T09:50:55+01:00
Add sympy 1.6+ support

- - - - -
594a4f39 by Michael R. Crusoe at 2021-02-20T09:50:59+01:00
debian/watch: modernize to version 4

- - - - -
56bd2376 by Michael R. Crusoe at 2021-02-20T09:50:59+01:00
debian/control: add Multi-Arch metadata as per the hinter

- - - - -
916951e8 by Michael R. Crusoe at 2021-02-20T10:51:01+01:00
debian/rules: skip remaining two failing tests

- - - - -
82a06280 by Michael R. Crusoe at 2021-02-20T10:51:01+01:00
compile against external lapack

- - - - -
31d62f21 by Michael R. Crusoe at 2021-02-20T10:55:50+01:00
better doc generation

- - - - -


16 changed files:

- − debian/TODO
- debian/changelog
- debian/control
- − debian/patches/deb_no_ipython_console_highlight
- − debian/patches/deb_no_texext
- − debian/patches/jaunty-dsc-patch-nodbg
- − debian/patches/karmic-dsc-patch-nodbg
- − debian/patches/lenny-dsc-patch-nodbg
- debian/patches/local-mathjax.patch
- − debian/patches/lucid-dsc-patch-nodbg
- − debian/patches/lucid-dsc-patch-nodoc
- debian/patches/python3
- debian/patches/series
- + debian/patches/sympy_1.6+.patch
- debian/rules
- debian/watch


Changes:

=====================================
debian/TODO deleted
=====================================
@@ -1 +0,0 @@
-- package https://github.com/matthew-brett/texext  used in the documentation


=====================================
debian/changelog
=====================================
@@ -1,5 +1,6 @@
 nipy (0.4.3~rc1-1) UNRELEASED; urgency=medium
 
+  [ Andreas Tille ]
   * Team upload.
   * Resolve nipy autopkgtest failure due to numpy testing decorators
     Closes: #959138
@@ -11,6 +12,14 @@ nipy (0.4.3~rc1-1) UNRELEASED; urgency=medium
   * watch file standard 4 (routine-update)
   * Do not force maintainers to install Build-Depends on local machine
 
+  [ Michael R. Crusoe ]
+  * debian/patches: Added patch for sympy 1.6+ compat from upstream
+                    removed very old patches
+                    cleaned up patch headers
+  * debian/watch: modernize to version 4
+  * debian/control: add Multi-Arch metadata as per the hinter
+  * debian/rules: skip remaining two failing tests
+
  -- Andreas Tille <tille at debian.org>  Fri, 29 May 2020 11:41:36 +0200
 
 nipy (0.4.2-3) unstable; urgency=medium


=====================================
debian/control
=====================================
@@ -13,12 +13,15 @@ Build-Depends: debhelper-compat (= 13),
                python3-numpy,
                python3-matplotlib,
                python3-sphinx,
+               python3-texext,
                cython3,
                python3-numpydoc,
                python3-nibabel,
                python3-nose,
+               python3-nose-exclude,
                python3-sympy,
                liblapack-dev,
+               libblas-dev,
                python3-all-dbg,
                python3-numpy-dbg,
                python3-scipy-dbg,
@@ -62,6 +65,7 @@ Description: Analysis of structural and functional neuroimaging data
 
 Package: python3-nipy-lib
 Architecture: any
+Multi-Arch: same
 Depends: ${shlibs:Depends},
          ${misc:Depends},
          ${python3:Depends}
@@ -73,6 +77,7 @@ Description: Analysis of structural and functional neuroimaging data (compiled m
 
 Package: python3-nipy-lib-dbg
 Architecture: any
+Multi-Arch: same
 Section: debug
 Depends: ${shlibs:Depends},
          ${misc:Depends},
@@ -87,6 +92,8 @@ Description: Analysis of structural and functional neuroimaging data (debug symb
 
 Package: python-nipy-doc
 Architecture: all
+Multi-Arch: foreign
+Built-Using: ${sphinxdoc:Built-Using}
 Section: doc
 Depends: libjs-mathjax,
          ${misc:Depends},


=====================================
debian/patches/deb_no_ipython_console_highlight deleted
=====================================
@@ -1,21 +0,0 @@
-Index: nipy-0.4.2/doc/conf.py
-===================================================================
---- nipy-0.4.2.orig/doc/conf.py
-+++ nipy-0.4.2/doc/conf.py
-@@ -45,10 +45,15 @@ extensions = [
-     'numpydoc',
-     'sphinx.ext.inheritance_diagram',
-     'matplotlib.sphinxext.plot_directive',
--    'IPython.sphinxext.ipython_console_highlighting',
- ]
- 
- try:
-+    import IPython.sphinxext.ipython_console_highlighting
-+    extensions += ['IPython.sphinxext.ipython_console_highlighting']
-+except ImportError:
-+    pass
-+
-+try:
-     import texext.mathcode
-     import texext.math_dollar
-     extensions += [


=====================================
debian/patches/deb_no_texext deleted
=====================================
@@ -1,37 +0,0 @@
-From: Yaroslav Halchenko <debian at onerussian.com>
-Subject: depends on not yet packaged https://github.com/matthew-brett/texext
-
-Origin: NeuroDebian
-Last-Update: 2018-02-19
-
---- a/doc/conf.py
-+++ b/doc/conf.py
-@@ -38,18 +38,26 @@ needs_sphinx = '1.0'
- # Add any Sphinx extension module names here, as strings. They can be extensions
- # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
- extensions = [
--    'texext.mathcode',
-     'sphinx.ext.autodoc',
-     'sphinx.ext.doctest',
-     'sphinx.ext.mathjax',
-     'sphinx.ext.autosummary',
--    'texext.math_dollar',
-     'numpydoc',
-     'sphinx.ext.inheritance_diagram',
-     'matplotlib.sphinxext.plot_directive',
-     'IPython.sphinxext.ipython_console_highlighting',
- ]
- 
-+try:
-+    import texext.mathcode
-+    import texext.math_dollar
-+    extensions += [
-+        'texext.mathcode',
-+        'texext.math_dollar',
-+    ]
-+except ImportError:
-+    pass
-+
- # Autosummary on
- autosummary_generate=True
- 


=====================================
debian/patches/jaunty-dsc-patch-nodbg deleted
=====================================
@@ -1 +0,0 @@
-lenny-dsc-patch-nodbg
\ No newline at end of file


=====================================
debian/patches/karmic-dsc-patch-nodbg deleted
=====================================
@@ -1 +0,0 @@
-lenny-dsc-patch-nodbg
\ No newline at end of file


=====================================
debian/patches/lenny-dsc-patch-nodbg deleted
=====================================
@@ -1,37 +0,0 @@
-From: Yaroslav Halchenko <debian at onerussian.com>
-Subject: Disable building of -dbg packages since distribution lacks scipy-dbg
-
-Vendor: Debian
-
---- a/debian/control
-+++ b/debian/control
-@@ -8,7 +8,6 @@
- 			   python-sphinx (>= 0.6), cython,
- 			   python-nibabel, python-nose, python-sympy (>= 0.6.6),
- 			   liblapack-dev,
--			   python-all-dbg, python-numpy-dbg, python-scipy-dbg, cython-dbg,
- 			   graphviz, dvipng
- Standards-Version: 3.9.2
- Homepage: http://neuroimaging.scipy.org
-@@ -52,21 +51,6 @@
-  This package provides architecture-dependent builds of the libraries.
- 
- 
--Package: python-nipy-lib-dbg
--Architecture: any
--Section: debug
--Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends},
--         python-nipy-lib (= ${binary:Version})
--Provides: ${python:Provides}
--XB-Python-Version: ${python:Versions}
--Description: Analysis of structural and functional neuroimaging data
-- NiPy is a Python-based framework for the analysis of structural and
-- functional neuroimaging data.
-- .
-- This package provides debugging symbols for architecture-dependent
-- builds of the libraries.
--
--
- Package: python-nipy-doc
- Architecture: all
- Section: doc


=====================================
debian/patches/local-mathjax.patch
=====================================
@@ -1,3 +1,7 @@
+Author: Stuart Prescott <stuart at debian.org>
+Description: Use mathjax package
+Forwarded: not-needed
+Last-Updated: 2020-01-31
 --- a/doc/conf.py
 +++ b/doc/conf.py
 @@ -224,3 +224,5 @@


=====================================
debian/patches/lucid-dsc-patch-nodbg deleted
=====================================
@@ -1 +0,0 @@
-lenny-dsc-patch-nodbg
\ No newline at end of file


=====================================
debian/patches/lucid-dsc-patch-nodoc deleted
=====================================
@@ -1,60 +0,0 @@
-From: Yaroslav Halchenko <debian at onerussian.com>
-Subject: Do not build -doc package on older releases lacking necessary build-depends
-Origin: Debian
-Last-Update: 2012-07-22
-
-diff --git a/debian/control b/debian/control
-index 5387753..4689327 100644
---- a/debian/control
-+++ b/debian/control
-@@ -5,11 +5,10 @@ Maintainer: NeuroDebian Team <team at neuro.debian.net>
- Uploaders: Yaroslav Halchenko <debian at onerussian.com>, Michael Hanke <michael.hanke at gmail.com>
- Build-Depends: debhelper (>= 7.0.50~), python-all-dev (>= 2.5), python-support (>= 0.6),
- 			   python-scipy (>= 0.5), python-numpy (>= 1:1.2), python-matplotlib (>= 0.98.3),
--			   python-sphinx (>= 0.6), cython,
-+			   cython,
- 			   python-nibabel, python-nose, python-sympy (>= 0.6.6),
- 			   liblapack-dev,
- 			   python-all-dbg, python-numpy-dbg, python-scipy-dbg, cython-dbg,
--			   graphviz, dvipng
- Standards-Version: 3.9.3
- Homepage: http://neuroimaging.scipy.org
- Vcs-Browser: http://git.debian.org/?p=pkg-exppsy/nipy.git
-@@ -67,16 +66,3 @@ Description: Analysis of structural and functional neuroimaging data
-  .
-  This package provides debugging symbols for architecture-dependent
-  builds of the libraries.
--
--
--Package: python-nipy-doc
--Architecture: all
--Section: doc
--Depends: ${misc:Depends}, libjs-jquery
--Recommends: python-nipy
--Description: documentation and examples for NiPy
-- This package contains NiPy documentation in various formats (HTML,
-- TXT) including
--  * User manual
--  * Developer guidelines
--  * API documentation
-diff --git a/debian/rules b/debian/rules
-index 908535e..c37d763 100755
---- a/debian/rules
-+++ b/debian/rules
-@@ -29,7 +29,7 @@ doc-stamp:
- 	: # I: Generate documentation
- 	export PYTHONPATH=$$PWD/`/bin/ls -d build/lib.*$(PYVER)` \
- 		   MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \
--     cd doc; $(MAKE) html
-+     cd doc; # $(MAKE) html
- 	: # I: Use jquery from Debian package
- 	-rm doc/build/html/_static/jquery.js
- 	touch $@
-@@ -83,6 +83,6 @@ override_dh_clean:
- 
- 
- # We build documentation only for -indep
--binary-indep: doc-stamp
-+binary-indep:
- 
- binary: binary-arch binary-indep


=====================================
debian/patches/python3
=====================================
@@ -1,5 +1,6 @@
-Author: Michael R. Crusoe <michael.crusoe at gmail.com>
-Description: s/python/python3/g
+From: Michael R. Crusoe <michael.crusoe at gmail.com>
+Subject: s/python/python3/g
+Forwarded: https://github.com/nipy/nipy/pull/473
 --- nipy.orig/doc/devel/tools/tricked_out_emacs.rst
 +++ nipy/doc/devel/tools/tricked_out_emacs.rst
 @@ -83,7 +83,7 @@


=====================================
debian/patches/series
=====================================
@@ -1,4 +1,3 @@
+sympy_1.6+.patch
 local-mathjax.patch
-deb_no_texext
-deb_no_ipython_console_highlight
 python3


=====================================
debian/patches/sympy_1.6+.patch
=====================================
@@ -0,0 +1,101 @@
+From 38f2641454ece6b099400df6d625d4d2bd30052e Mon Sep 17 00:00:00 2001
+From: Yaroslav Halchenko <debian at onerussian.com>
+Date: Fri, 19 Feb 2021 18:34:32 -0500
+Subject: BF: avoid relying on Pythonic casting of bool into numeric for sympy expressions
+
+sympy 1.6 introduced breaking change (see
+https://github.com/sympy/sympy/wiki/Release-Notes-for-1.6 for full log):
+
+    Relational is no longer a subclass of Expr and does not produce nonsensical
+    results in arithmetic operations. This affects all Relational subclasses (Eq,
+    Ne, Gt, Ge, Lt, Le). It is no longer possible to call meaningless Expr methods
+    like as_coeff_Mul on Relational instances. (#18053 by @oscarbenjamin)
+
+which broke all Pythonish expressions like (x > 0) * (x < 1) to define a square
+wave.  Thanks to guidance from @oscarbenjamin in
+https://github.com/sympy/sympy/issues/20981 I RFed all such uses to use
+sympy.Piecewise instead to make it more explicit.
+
+While at it, I also adjusted comments claiming intervals like [0, 1] (which
+includes the endpoints), whenever in reality they were (0, 1) (endpoints not
+included).
+
+This is closes #466 AFAIK
+---
+ nipy/modalities/fmri/hrf.py              | 5 +++--
+ nipy/modalities/fmri/tests/test_utils.py | 8 ++++----
+ nipy/modalities/fmri/utils.py            | 4 ++--
+ 3 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/nipy/modalities/fmri/hrf.py b/nipy/modalities/fmri/hrf.py
+index 6cd10283a..635c15b94 100644
+--- a/nipy/modalities/fmri/hrf.py
++++ b/nipy/modalities/fmri/hrf.py
+@@ -103,7 +103,8 @@ def gamma_params(peak_location, peak_fwhm):
+ def gamma_expr(peak_location, peak_fwhm):
+     shape, scale, coef = gamma_params(peak_location, peak_fwhm)
+     return (
+-        coef * ((T >= 0) * (T+1.0e-14))**(shape-1)
++        coef
++        * sympy.Piecewise((T + 1e-14, T >= 0), (0, True))**(shape-1)
+         * sympy.exp(-(T+1.0e-14)/scale)
+         )
+ 
+@@ -140,7 +141,7 @@ def _get_num_int(lf, dt=0.02, t=50):
+ del(_gexpr); del(_dpos); del(_dgexpr)
+ 
+ # AFNI's HRF
+-_aexpr = ((T >= 0) * T)**8.6 * sympy.exp(-T/0.547)
++_aexpr = sympy.Piecewise((T, T >= 0), (0, True))**8.6 * sympy.exp(-T/0.547)
+ _aexpr = _aexpr / _get_sym_int(_aexpr)
+ # Numerical function
+ afnit = lambdify_t(_aexpr)
+diff --git a/nipy/modalities/fmri/tests/test_utils.py b/nipy/modalities/fmri/tests/test_utils.py
+index 0d8f8edf1..e91a5908d 100644
+--- a/nipy/modalities/fmri/tests/test_utils.py
++++ b/nipy/modalities/fmri/tests/test_utils.py
+@@ -170,8 +170,8 @@ def numerical_convolve(func1, func2, interval, dt):
+ 
+ def test_convolve_functions():
+     # replicate convolution
+-    # This is a square wave on [0,1]
+-    f1 = (t > 0) * (t < 1)
++    # This is a square wave on (0,1)
++    f1 = sympy.Piecewise((0, t <= 0), (1, t < 1), (0, True))
+     # ff1 is the numerical implementation of same
+     ff1 = lambdify(t, f1)
+     # Time delta
+@@ -205,7 +205,7 @@ def kern_conv2(f1, f2, f1_interval, f2_interval, dt, fill=0, name=None):
+             y = ftri(time)
+             assert_array_almost_equal(value, y)
+         # offset square wave by 1 - offset triangle by 1
+-        f2 = (t > 1) * (t < 2)
++        f2 = sympy.Piecewise((0, t <= 1), (1, t < 2), (0, True))
+         tri = cfunc(f1, f2, [0, 3], [0, 3], dt)
+         ftri = lambdify(t, tri)
+         o1_time = np.arange(0, 3, dt)
+@@ -221,7 +221,7 @@ def kern_conv2(f1, f2, f1_interval, f2_interval, dt, fill=0, name=None):
+         o2_time = np.arange(0, 4, dt)
+         assert_array_almost_equal(ftri(o2_time), np.r_[z1s, z1s, value])
+         # offset by -0.5 - offset triangle by -0.5
+-        f3 = (t > -0.5) * (t < 0.5)
++        f3 = sympy.Piecewise((0, t <= -0.5), (1, t < 0.5), (0, True))
+         tri = cfunc(f1, f3, [0, 2], [-0.5, 1.5], dt)
+         ftri = lambdify(t, tri)
+         o1_time = np.arange(-0.5, 1.5, dt)
+diff --git a/nipy/modalities/fmri/utils.py b/nipy/modalities/fmri/utils.py
+index f88ce1fe3..710e8d0c5 100644
+--- a/nipy/modalities/fmri/utils.py
++++ b/nipy/modalities/fmri/utils.py
+@@ -528,9 +528,9 @@ def convolve_functions(f, g, f_interval, g_interval, dt,
+     >>> from nipy.algorithms.statistics.formula.formulae import Term
+     >>> t = Term('t')
+ 
+-    This is a square wave on [0,1]
++    This is a square wave on (0,1)
+ 
+-    >>> f1 = (t > 0) * (t < 1)
++    >>> f1 = sympy.Piecewise((0, t <= 0), (1, t < 1), (0, True))
+ 
+     The convolution of ``f1`` with itself is a triangular wave on [0, 2],
+     peaking at 1 with height 1


=====================================
debian/rules
=====================================
@@ -14,6 +14,8 @@ export PYBUILD_NAME = nipy
 # -shared) we just unexport LDFLAGS
 unexport LDFLAGS
 
+export NIPY_EXTERNAL_LAPACK=1
+
 # stop matplotlib from thinking it should display plots
 export MPLBACKEND=Agg
 
@@ -62,7 +64,7 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
      PATH=$(wildcard $(CURDIR)/build/scripts*$(PYVER)):$$PATH \
 	  PYTHONPATH=$(shell pybuild --print build_dir --interpreter python$(PYVER)):$$PYTHONPATH \
      MPLCONFIGDIR=$(CURDIR)/build \
-	  ../tools/nipnost nipy
+	  ../tools/nipnost nipy --exclude-test=nipy.algorithms.tests.test_resample.test_resample_outvalue --exclude-test=nipy.algorithms.tests.test_interpolator.test_interpolator
 else
 	: # Skip unittests due to nocheck
 endif


=====================================
debian/watch
=====================================
@@ -1,4 +1,3 @@
-# Compulsory line, this is a version 3 file
 version=4
-opts="uversionmangle=s/rc/~rc/, filenamemangle=s/.*\/(.*)/nipy-$1/" \
-  https://github.com/nipy/nipy/tags .*archive/(\d[\d\.a-z]+)\.tar\.gz
+opts="uversionmangle=s/rc/~rc/, filenamemangle=s%(?:.*?)?(\d[\d.]*)\.tar\.gz%@PACKAGE at -$1.tar.gz%" \
+  https://github.com/nipy/nipy/releases .*archive/@ANY_VERSION@\.tar\.gz



View it on GitLab: https://salsa.debian.org/med-team/nipy/-/compare/3ea7ce503c10f87635e10ea15faaaa46aa009b36...31d62f21b89e0438771e14e259dd9251ce506504

-- 
View it on GitLab: https://salsa.debian.org/med-team/nipy/-/compare/3ea7ce503c10f87635e10ea15faaaa46aa009b36...31d62f21b89e0438771e14e259dd9251ce506504
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/20210220/4b131c06/attachment-0001.html>


More information about the debian-med-commit mailing list