[med-svn] [Git][med-team/nipy][upstream] New upstream version 0.4.3~rc1
Andreas Tille
gitlab at salsa.debian.org
Tue Dec 8 17:59:06 GMT 2020
Andreas Tille pushed to branch upstream at Debian Med / nipy
Commits:
4325c2ec by Andreas Tille at 2020-12-08T12:01:46+01:00
New upstream version 0.4.3~rc1
- - - - -
22 changed files:
- .appveyor.yml
- .travis.yml
- doc-requirements.txt
- nipy/COMMIT_INFO.txt
- nipy/algorithms/clustering/tests/test_vmm.py
- nipy/algorithms/clustering/von_mises_fisher_mixture.py
- nipy/algorithms/diagnostics/tests/test_screen.py
- nipy/algorithms/registration/tests/test_fmri_realign4d.py
- nipy/algorithms/statistics/formula/formulae.py
- nipy/algorithms/statistics/rft.py
- nipy/algorithms/statistics/tests/test_rft.py
- nipy/fixes/numpy/testing/nosetester.py
- nipy/info.py
- nipy/labs/group/permutation_test.py
- nipy/labs/viz_tools/test/test_activation_maps.py
- nipy/labs/viz_tools/test/test_cm.py
- nipy/labs/viz_tools/test/test_slicers.py
- nipy/modalities/fmri/tests/test_aliases.py
- nipy/testing/__init__.py
- nipy/testing/decorators.py
- nipy/tests/test_scripts.py
- requirements.txt
Changes:
=====================================
.appveyor.yml
=====================================
@@ -10,12 +10,12 @@ environment:
- PYTHON: C:\Python27-x64
# Doctest fail from the long Ls, as in (1L, 2L) != (1, 2)
EXTRA_FLAGS: "--without-doctest"
- - PYTHON: C:\Python34
- - PYTHON: C:\Python34-x64
- - PYTHON: C:\Python35
- - PYTHON: C:\Python35-x64
- PYTHON: C:\Python36
- PYTHON: C:\Python36-x64
+ - PYTHON: C:\Python37
+ - PYTHON: C:\Python37-x64
+ - PYTHON: C:\Python38
+ - PYTHON: C:\Python38-x64
install:
# Prepend newly installed Python to the PATH of this build (this cannot be
@@ -29,7 +29,7 @@ install:
- echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64/vcvars64.bat"
# Install the dependencies of the project.
- - pip install numpy Cython nose nibabel sympy scipy
+ - pip install numpy Cython nose nibabel "sympy<1.6" scipy
# Pin wheel to 0.26 to avoid Windows ABI tag for built wheel
- pip install wheel==0.26
# install
=====================================
.travis.yml
=====================================
@@ -14,7 +14,7 @@ cache:
env:
global:
- - DEPENDS="numpy scipy sympy matplotlib nibabel"
+ - DEPENDS="numpy scipy sympy<1.6 matplotlib nibabel"
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
@@ -22,9 +22,9 @@ env:
- INSTALL_TYPE="pip"
python:
- - 3.4
- - 3.5
- 3.6
+ - 3.7
+ - 3.8
matrix:
include:
@@ -38,7 +38,7 @@ matrix:
- PRE_DEPENDS="numpy==1.6.0"
- DEPENDS="scipy==0.9.0 sympy==0.7.0 nibabel==1.2.0"
# Test compiling against external lapack
- - python: 3.4
+ - python: 3.6
env:
- NIPY_EXTERNAL_LAPACK=1
addons:
@@ -59,17 +59,17 @@ matrix:
- INSTALL_TYPE=requirements
- DEPENDS=
# test 3.5 against pre-release builds of everything
- - python: 3.5
+ - python: 3.6
env:
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
# test python setup.py install
- - python: 3.5
+ - python: 3.6
env:
- INSTALL_TYPE=setup
- - python: 3.5
+ - python: 3.6
env:
- INSTALL_TYPE="pip_e"
- - python: 3.5
+ - python: 3.6
env:
- DOC_BUILD=1
addons:
@@ -94,7 +94,9 @@ before_install:
- if [ -n "$PRE_DEPENDS" ]; then
pip install $EXTRA_PIP_FLAGS $PRE_DEPENDS;
fi
- - pip install $EXTRA_PIP_FLAGS $DEPENDS
+ - if [ -n "$DEPENDS" ]; then
+ pip install $EXTRA_PIP_FLAGS $DEPENDS;
+ fi
- if [ "${COVERAGE}" == "1" ]; then
pip install coverage;
pip install coveralls codecov;
=====================================
doc-requirements.txt
=====================================
@@ -1,8 +1,8 @@
# Requirements for building docs
# Check these dependencies against doc/conf.py
-r dev-requirements.txt
-sphinx>=1.0
-numpydoc
+sphinx>=1.0,<3.0
+numpydoc==0.8.0
matplotlib
texext
ipython
=====================================
nipy/COMMIT_INFO.txt
=====================================
@@ -1,6 +1,6 @@
# This is an ini file that may contain information about the code state
[commit hash]
# The line below may contain a valid hash if it has been substituted during 'git archive'
-archive_subst_hash=eb649170
+archive_subst_hash=a2e0e06f5
# This line may be modified by the install process
install_hash=
=====================================
nipy/algorithms/clustering/tests/test_vmm.py
=====================================
@@ -12,8 +12,17 @@ from ..von_mises_fisher_mixture import (VonMisesMixture,
select_vmm,
select_vmm_cv)
-
from nose.tools import assert_true, assert_equal
+try:
+ from numpy.testing import decorators
+except ImportError:
+ from numpy.testing import dec
+ decorators = dec
+
+from nibabel.optpkg import optional_package
+
+matplotlib, HAVE_MPL, _ = optional_package('matplotlib')
+needs_mpl = decorators.skipif(not HAVE_MPL, "Test needs matplotlib")
def test_spherical_area():
@@ -38,6 +47,18 @@ def test_von_mises_fisher_density():
< 1e-2)
+ at needs_mpl
+def test_von_mises_fisher_show():
+ # Smoke test for VonMisesMixture.show
+ x = np.random.randn(100, 3)
+ x = (x.T/np.sqrt(np.sum(x**2, 1))).T
+ vmd = VonMisesMixture(1, 1)
+ # Need to estimate to avoid error in show
+ vmd.estimate(x)
+ # Check that show does not raise an error
+ vmd.show(x)
+
+
def test_dimension_selection_bic():
# Tests whether dimension selection yields correct results
x1 = [0.6, 0.48, 0.64]
=====================================
nipy/algorithms/clustering/von_mises_fisher_mixture.py
=====================================
@@ -233,8 +233,13 @@ class VonMisesMixture(object):
Parameters
----------
- x: array fo shape(n,3)
+ x: array of shape (n, 3)
should be on the unit sphere
+
+ Notes
+ -----
+
+ Uses ``matplotlib``.
"""
# label the data
z = np.argmax(self.responsibilities(x), 1)
@@ -243,7 +248,7 @@ class VonMisesMixture(object):
fig = pylab.figure()
ax = p3.Axes3D(fig)
colors = (['b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'] * \
- (1 + (1 + self.k) / 8))[:self.k + 1]
+ (1 + (1 + self.k) // 8))[:self.k + 1]
if (self.null_class) and (z == 0).any():
ax.plot3D(x[z == 0, 0], x[z == 0, 1], x[z == 0, 2], '.',
color=colors[0])
=====================================
nipy/algorithms/diagnostics/tests/test_screen.py
=====================================
@@ -23,7 +23,13 @@ from nibabel.tmpdirs import InTemporaryDirectory
from nose.tools import (assert_true, assert_false, assert_equal, assert_raises)
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
- assert_almost_equal, decorators)
+ assert_almost_equal)
+
+try:
+ from numpy.testing import decorators
+except ImportError:
+ from numpy.testing import dec
+ decorators = dec
from nipy.testing import funcfile
from nipy.testing.decorators import needs_mpl_agg
=====================================
nipy/algorithms/registration/tests/test_fmri_realign4d.py
=====================================
@@ -120,7 +120,7 @@ def test_realign4d_incompatible_args():
def test_realign4d():
"""
This tests whether realign4d yields the same results depending on
- whether the slice order is input explicitely or as
+ whether the slice order is input explicitly or as
slice_times='ascending'.
Due to the very small size of the image used for testing (only 3
=====================================
nipy/algorithms/statistics/formula/formulae.py
=====================================
@@ -267,10 +267,10 @@ class FactorTerm(Term):
return sympy.Symbol.__mul__(self, other)
-class Beta(sympy.symbol.Dummy):
+class Beta(sympy.Dummy):
''' A symbol tied to a Term `term` '''
def __new__(cls, name, term):
- new = sympy.symbol.Dummy.__new__(cls, name)
+ new = sympy.Dummy.__new__(cls, name)
new._term = term
return new
=====================================
nipy/algorithms/statistics/rft.py
=====================================
@@ -20,7 +20,10 @@ import numpy as np
from numpy.linalg import pinv
from scipy import stats
-from scipy.misc import factorial
+try:
+ from scipy.misc import factorial
+except ImportError:
+ from scipy.special import factorial
from scipy.special import gamma, gammaln, beta, hermitenorm
# Legacy repr printing from numpy.
=====================================
nipy/algorithms/statistics/tests/test_rft.py
=====================================
@@ -6,7 +6,10 @@ import numpy as np
from scipy.special import gammaln, hermitenorm
import scipy.stats
-from scipy.misc import factorial
+try:
+ from scipy.misc import factorial
+except ImportError:
+ from scipy.special import factorial
from .. import rft
=====================================
nipy/fixes/numpy/testing/nosetester.py
=====================================
@@ -21,7 +21,7 @@ def get_package_name(filepath):
Examples
--------
- >>> np.testing.nosetester.get_package_name('nonsense')
+ >>> get_package_name('nonsense')
'numpy'
"""
=====================================
nipy/info.py
=====================================
@@ -7,10 +7,10 @@ docs. In setup.py in particular, we exec this file, so it cannot import nipy
# full release. '.dev' as a _version_extra string means this is a development
# version
_version_major = 0
-_version_minor = 4
-_version_micro = 2
-# _version_extra = '.dev' # For development
-_version_extra = '' # For release
+_version_minor = 5
+_version_micro = 0
+_version_extra = '.dev' # For development
+#_version_extra = '' # For release
# Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z"
__version__ = "%s.%s.%s%s" % (_version_major,
@@ -170,7 +170,7 @@ MINOR = _version_minor
MICRO = _version_micro
ISRELEASE = _version_extra == ''
VERSION = __version__
-REQUIRES = ["numpy", "scipy", "sympy", "nibabel"]
+REQUIRES = ["numpy", "scipy", "sympy(<1.6)", "nibabel"]
STATUS = 'beta'
# Versions and locations of optional data packages
=====================================
nipy/labs/group/permutation_test.py
=====================================
@@ -6,7 +6,10 @@ from __future__ import print_function, absolute_import
# Third-party imports
import numpy as np
-import scipy.misc as sm
+try:
+ from scipy.misc import comb
+except ImportError:
+ from scipy.special import comb
import warnings
# Our own imports
@@ -374,7 +377,7 @@ class permutation_test(object):
elif self.nsamples == 2:
n1,p = self.data1.shape[self.axis], self.data1.shape[1-self.axis]
n2 = self.data2.shape[self.axis]
- max_nperms = sm.comb(n1+n2,n1,exact=1)
+ max_nperms = comb(n1+n2,n1,exact=1)
data = np.concatenate((self.data1,self.data2), self.axis)
if self.vardata1 is not None:
vardata = np.concatenate((self.vardata1,self.vardata2), self.axis)
=====================================
nipy/labs/viz_tools/test/test_activation_maps.py
=====================================
@@ -10,7 +10,7 @@ from nipy.testing.decorators import skipif
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
pl.switch_backend('svg')
except ImportError:
@@ -28,7 +28,7 @@ from ..anat_cache import mni_sform, _AnatCache
def test_demo_plot_map():
# This is only a smoke test
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
pl.switch_backend('svg')
demo_plot_map()
@@ -38,7 +38,7 @@ def test_demo_plot_map():
def test_plot_anat():
# This is only a smoke test
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
pl.switch_backend('svg')
data = np.zeros((20, 20, 20))
@@ -85,7 +85,7 @@ def test_plot_map_empty():
# Test that things don't crash when we give a map with nothing above
# threshold
# This is only a smoke test
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
pl.switch_backend('svg')
data = np.zeros((20, 20, 20))
=====================================
nipy/labs/viz_tools/test/test_cm.py
=====================================
@@ -8,7 +8,7 @@ from nose import SkipTest
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
pl.switch_backend('svg')
except ImportError:
@@ -19,14 +19,14 @@ from ..cm import dim_cmap, replace_inside
def test_dim_cmap():
# This is only a smoke test
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
dim_cmap(pl.cm.jet)
def test_replace_inside():
# This is only a smoke test
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
pl.switch_backend('svg')
replace_inside(pl.cm.jet, pl.cm.hsv, .2, .8)
=====================================
nipy/labs/viz_tools/test/test_slicers.py
=====================================
@@ -7,7 +7,7 @@ import nose
try:
import matplotlib as mp
# Make really sure that we don't try to open an Xserver connection.
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
pl.switch_backend('svg')
except ImportError:
@@ -25,7 +25,7 @@ def test_demo_ortho_slicer():
# conditioned on presence of MNI templated
if not find_mni_template():
raise nose.SkipTest("MNI Template is absent for the smoke test")
- mp.use('svg', warn=False)
+ mp.use('svg')
import pylab as pl
pl.switch_backend('svg')
demo_ortho_slicer()
=====================================
nipy/modalities/fmri/tests/test_aliases.py
=====================================
@@ -44,7 +44,7 @@ def test_implemented_function():
func = sympy.Function('myfunc')
assert_false(hasattr(func, '_imp_'))
f = implemented_function(func, lambda x: 2*x)
- assert_true(hasattr(func, '_imp_'))
+ assert_true(hasattr(f, '_imp_'))
def test_lambdify():
=====================================
nipy/testing/__init__.py
=====================================
@@ -36,6 +36,13 @@ funcfile = os.path.join(basedir, 'functional.nii.gz')
anatfile = os.path.join(basedir, 'anatomical.nii.gz')
from numpy.testing import *
+# Re import decorators/dec depending on numpy's version
+try:
+ from numpy.testing import decorators
+except ImportError:
+ from numpy.testing import dec
+ decorators = dec
+
# Overwrites numpy.testing.Tester
from .nosetester import NipyNoseTester as Tester
test = Tester().test
=====================================
nipy/testing/decorators.py
=====================================
@@ -8,7 +8,10 @@ dependency on nose.
from __future__ import print_function
from __future__ import absolute_import
-from numpy.testing.decorators import *
+try:
+ from numpy.testing.decorators import *
+except ImportError:
+ from numpy.testing._private.decorators import *
from nipy.utils import templates, example_data, DataError
@@ -124,7 +127,7 @@ def needs_mpl_agg(func):
import matplotlib.pyplot as plt
from nose.tools import make_decorator
def agg_func(*args, **kwargs):
- matplotlib.use('agg', warn=False)
+ matplotlib.use('agg')
plt.switch_backend('agg')
return func(*args, **kwargs)
return make_decorator(func)(agg_func)
=====================================
nipy/tests/test_scripts.py
=====================================
@@ -19,7 +19,13 @@ from nipy.core.api import rollimg
from nose.tools import assert_true, assert_false, assert_equal, assert_raises
from ..testing import funcfile
-from numpy.testing import decorators, assert_almost_equal
+from numpy.testing import assert_almost_equal
+
+try:
+ from numpy.testing import decorators
+except ImportError:
+ from numpy.testing import dec
+ decorators = dec
from nipy.testing.decorators import make_label_dec
=====================================
requirements.txt
=====================================
@@ -1,5 +1,5 @@
# See nipy/info.py for requirement definitions
numpy>=1.6.0
scipy>=0.9.0
-sympy>=0.7.0
+sympy>=0.7.0,<1.6
nibabel>=1.2.0
View it on GitLab: https://salsa.debian.org/med-team/nipy/-/commit/4325c2ec656e51a1f09688c9d5497d925cb356bc
--
View it on GitLab: https://salsa.debian.org/med-team/nipy/-/commit/4325c2ec656e51a1f09688c9d5497d925cb356bc
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/20201208/ddd75f4f/attachment-0001.html>
More information about the debian-med-commit
mailing list