[med-svn] [Git][med-team/nipy][master] 5 commits: More of _configtest files to ignore and clean
Yaroslav Halchenko
gitlab at salsa.debian.org
Sat Feb 20 15:02:57 GMT 2021
Yaroslav Halchenko pushed to branch master at Debian Med / nipy
Commits:
650e4758 by Yaroslav Halchenko at 2021-02-18T16:15:00-05:00
More of _configtest files to ignore and clean
- - - - -
7ef946f0 by Yaroslav Halchenko at 2021-02-19T18:58:59-05:00
debian/patches + 0001-BF-avoid-relying-on-Pythonic-casting-of-bool-into-nu.patch
for compatibility with sympy >= 1.6
- - - - -
c9f384b2 by Yaroslav Halchenko at 2021-02-19T19:01:13-05:00
Skip one test and pretend to be Andreas
- - - - -
43c448a5 by Yaroslav Halchenko at 2021-02-20T02:57:27-05:00
exclude resample_outvalue for now, reported upstream https://github.com/nipy/nipy/issues/471
- - - - -
ee195806 by Yaroslav Halchenko at 2021-02-20T10:02:10-05:00
Merge remote-tracking branch 'salsa/master' into debian
* salsa/master:
better doc generation
compile against external lapack
debian/rules: skip remaining two failing tests
debian/control: add Multi-Arch metadata as per the hinter
debian/watch: modernize to version 4
Add sympy 1.6+ support
Conflicts:
debian/changelog - initiated -2
debian/rules - took Michael's version for excluding -- more explicit
- - - - -
5 changed files:
- debian/changelog
- debian/clean
- + debian/patches/0001-BF-avoid-relying-on-Pythonic-casting-of-bool-into-nu.patch
- debian/patches/series
- debian/source/options
Changes:
=====================================
debian/changelog
=====================================
@@ -1,4 +1,16 @@
-nipy (0.4.3~rc1-1) UNRELEASED; urgency=medium
+nipy (0.4.3~rc1-2) UNRELEASED; urgency=medium
+
+ [ Andreas Tille ]
+ [ Michael R. Crusoe ]
+ * debian/patches: 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
+
+ -- Yaroslav Halchenko <debian at onerussian.com> Sat, 20 Feb 2021 10:00:57 -0500
+
+nipy (0.4.3~rc1-1) unstable; urgency=medium
[ Andreas Tille ]
* Team upload.
@@ -12,15 +24,18 @@ 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
+ [ Yaroslav Halchenko ]
+ * debian/patches
+ + 0001-BF-avoid-relying-on-Pythonic-casting-of-bool-into-nu.patch
+ for compatibility with sympy >= 1.6
+ * debian/rules
+ - exclude test_interpolator test for now, failing, reported upstream
+ https://github.com/nipy/nipy/issues/468
+ due to scipy jump from 1.5.4-1+b1 to 1.6.0-2
+ - exclude resample_outvalue for now, reported upstream
+ https://github.com/nipy/nipy/issues/471
- -- Andreas Tille <tille at debian.org> Fri, 29 May 2020 11:41:36 +0200
+ -- Yaroslav Halchenko <debian at onerussian.com> Sat, 20 Feb 2021 02:57:19 -0500
nipy (0.4.2-3) unstable; urgency=medium
=====================================
debian/clean
=====================================
@@ -1 +1,5 @@
_configtest.o.d
+_configtest.c
+_configtest.o
+_configtest
+
=====================================
debian/patches/0001-BF-avoid-relying-on-Pythonic-casting-of-bool-into-nu.patch
=====================================
@@ -0,0 +1,105 @@
+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: [PATCH] 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 6cd10283..635c15b9 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 @@ dglover = implemented_function('dglover', dglovert)
+ 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 0d8f8edf..e91a5908 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 test_convolve_functions():
+ 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 test_convolve_functions():
+ 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 f88ce1fe..710e8d0c 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
+--
+2.29.2
+
=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
sympy_1.6+.patch
local-mathjax.patch
python3
+0001-BF-avoid-relying-on-Pythonic-casting-of-bool-into-nu.patch
=====================================
debian/source/options
=====================================
@@ -1 +1 @@
-extend-diff-ignore = "(^|/)(nipy/COMMIT_INFO.txt|\.gitignore|_configtest.o.d)$"
+extend-diff-ignore = "(^|/)(nipy/COMMIT_INFO.txt|\.gitignore|_configtest.*)$"
View it on GitLab: https://salsa.debian.org/med-team/nipy/-/compare/31d62f21b89e0438771e14e259dd9251ce506504...ee19580629439e1143bdc7a600c8ee3434f2f5b4
--
View it on GitLab: https://salsa.debian.org/med-team/nipy/-/compare/31d62f21b89e0438771e14e259dd9251ce506504...ee19580629439e1143bdc7a600c8ee3434f2f5b4
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/26341569/attachment-0001.htm>
More information about the debian-med-commit
mailing list