Skip to content

Commit 12ea136

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add/fs-conform
2 parents e19b022 + e2f50b4 commit 12ea136

File tree

167 files changed

+5430
-5779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+5430
-5779
lines changed

.azure-pipelines/windows.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
variables:
1212
EXTRA_WHEELS: "https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
1313
DEPENDS: numpy scipy matplotlib h5py pydicom
14+
CHECK_TYPE: test
1415
strategy:
1516
matrix:
1617
${{ insert }}: ${{ parameters.matrix }}
@@ -29,19 +30,20 @@ jobs:
2930
displayName: 'Update build tools'
3031
- script: |
3132
python -m pip install --find-links %EXTRA_WHEELS% %DEPENDS%
32-
python -m pip install nose mock coverage codecov pytest
3333
displayName: 'Install dependencies'
3434
- script: |
35-
python -m pip install .
35+
python -m pip install .[$(CHECK_TYPE)]
3636
SET NIBABEL_DATA_DIR=%CD%\\nibabel-data
3737
displayName: 'Install nibabel'
3838
- script: |
3939
mkdir for_testing
4040
cd for_testing
4141
cp ../.coveragerc .
42-
nosetests --with-doctest --with-coverage --cover-package nibabel nibabel
43-
displayName: 'Nose tests'
42+
pytest --doctest-modules --cov nibabel -v --pyargs nibabel
43+
displayName: 'Pytest tests'
44+
condition: and(succeeded(), eq(variables['CHECK_TYPE'], 'test'))
4445
- script: |
46+
python -m pip install codecov
4547
cd for_testing
4648
codecov
4749
displayName: 'Upload To Codecov'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,4 @@ doc/source/reference
8585
venv/
8686
.buildbot.patch
8787
.vscode
88+
for_testing/

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ B. Nolan Nichols <[email protected]> Nolan Nichols <[email protected]
1313
Basile Pinsard <[email protected]> bpinsard <[email protected]>
1414
Basile Pinsard <[email protected]> bpinsard <[email protected]>
1515
Ben Cipollini <[email protected]> Ben Cipollini <[email protected]>
16+
Benjamin C Darwin <[email protected]>
1617
Bertrand Thirion <[email protected]> bthirion <[email protected]>
1718
1819
Christian Haselgrove <[email protected]> Christian Haselgrove <[email protected]>

.travis.yml

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,91 +4,104 @@
44
# for it to be on multiple physical lines, so long as you remember: - There
55
# can't be any leading "-"s - All newlines will be removed, so use ";"s
66

7+
os: linux
78
dist: xenial
8-
sudo: true
99
language: python
10-
1110
cache: pip
11+
1212
env:
1313
global:
1414
- SETUP_REQUIRES="pip setuptools>=30.3.0 wheel"
1515
- DEPENDS="numpy scipy matplotlib h5py pillow pydicom indexed_gzip"
1616
- INSTALL_TYPE="setup"
1717
- CHECK_TYPE="test"
18-
- OLD_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
1918
- EXTRA_WHEELS="https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com"
2019
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
21-
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS --find-links=$OLD_WHEELS"
20+
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
2221
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
2322

2423
python:
25-
- 3.6
2624
- 3.7
2725
- 3.8
2826

29-
matrix:
27+
jobs:
3028
include:
3129
# Basic dependencies only
32-
- python: 3.5
30+
- python: 3.6
3331
env:
3432
- DEPENDS="-r requirements.txt"
3533
# Clean install
36-
- python: 3.5
34+
- python: 3.6
3735
env:
3836
- DEPENDS=""
3937
- CHECK_TYPE=skiptests
4038
# Absolute minimum dependencies
41-
- python: 3.5
39+
- python: 3.6
4240
env:
4341
- SETUP_REQUIRES="setuptools==30.3.0"
4442
- DEPENDS="-r min-requirements.txt"
4543
# Absolute minimum dependencies plus oldest MPL
46-
- python: 3.5
44+
- python: 3.6
4745
env:
48-
- DEPENDS="-r min-requirements.txt matplotlib==1.3.1"
46+
- DEPENDS="-r min-requirements.txt matplotlib==1.5.3"
4947
# Minimum pydicom dependency
50-
- python: 3.5
48+
- python: 3.6
5149
env:
5250
- DEPENDS="-r min-requirements.txt pydicom==0.9.9 pillow==2.6"
5351
# pydicom master branch
54-
- python: 3.5
52+
- python: 3.6
5553
env:
5654
- DEPENDS="numpy git+https://github.com/pydicom/pydicom.git@master"
57-
# test 3.7 against pre-release builds of everything
58-
- python: 3.7
55+
# test 3.8 against pre-release builds of everything
56+
- python: 3.8
57+
env:
58+
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
59+
# OSX Python support is basically accidental. Take whatever version we can
60+
# get and test with full dependencies...
61+
- os: osx
62+
language: minimal
63+
# and pre-releases. No min-requirements.txt because we can't assume a wheel that old.
64+
- os: osx
65+
language: minimal
5966
env:
6067
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
61-
- python: 3.5
68+
# Test that PyPI installs from source pass
69+
- python: 3.6
6270
env:
6371
- INSTALL_TYPE=sdist
64-
- python: 3.5
72+
# Wheels (binary distributions)
73+
- python: 3.6
6574
env:
6675
- INSTALL_TYPE=wheel
67-
- python: 3.5
76+
# Install from git archive (e.g., https://github.com/nipy/nibabel/archive/master.zip)
77+
- python: 3.6
6878
env:
6979
- INSTALL_TYPE=archive
70-
- python: 3.5
80+
# Run flake8... Might not be needed now we have pep8speaks
81+
- python: 3.6
7182
env:
7283
- CHECK_TYPE="style"
7384
# Documentation doctests
74-
- python: 3.5
85+
- python: 3.6
7586
env:
7687
- CHECK_TYPE="doc"
7788

7889
# Set up virtual environment, build package, build from depends
7990
before_install:
80-
- travis_retry python -m pip install --upgrade pip virtualenv
81-
- virtualenv --python=python venv
91+
- travis_retry python3 -m pip install --upgrade pip virtualenv
92+
- virtualenv --python=python3 venv
8293
- source venv/bin/activate
83-
- python --version # just to check
84-
- travis_retry pip install -U $SETUP_REQUIRES
94+
- python3 --version # just to check
95+
- travis_retry python3 -m pip install -U $SETUP_REQUIRES
96+
- which python3
97+
- which pip
8598
- |
8699
if [ "$INSTALL_TYPE" == "sdist" ]; then
87-
python setup.py egg_info # check egg_info while we're here
88-
python setup.py sdist
100+
python3 setup.py egg_info # check egg_info while we're here
101+
python3 setup.py sdist
89102
export ARCHIVE=$( ls dist/*.tar.gz )
90103
elif [ "$INSTALL_TYPE" == "wheel" ]; then
91-
python setup.py bdist_wheel
104+
python3 setup.py bdist_wheel
92105
export ARCHIVE=$( ls dist/*.whl )
93106
elif [ "$INSTALL_TYPE" == "archive" ]; then
94107
export ARCHIVE="package.tar.gz"
@@ -100,19 +113,19 @@ before_install:
100113
install:
101114
- |
102115
if [ "$INSTALL_TYPE" == "setup" ]; then
103-
python setup.py install
116+
python3 setup.py install
104117
else
105118
pip install $EXTRA_PIP_FLAGS $ARCHIVE
106119
fi
107120
# Basic import check
108-
- python -c 'import nibabel; print(nibabel.__version__)'
121+
- python3 -c 'import nibabel; print(nibabel.__version__)'
109122
- if [ "$CHECK_TYPE" == "skiptests" ]; then exit 0; fi
110123

111124
before_script:
112125
# Point to nibabel data directory
113126
- export NIBABEL_DATA_DIR="$PWD/nibabel-data"
114127
# Because nibabel is already installed, will just look up the extra
115-
- pip install $EXTRA_PIP_FLAGS "nibabel[$CHECK_TYPE]"
128+
- python3 -m pip install $EXTRA_PIP_FLAGS "nibabel[$CHECK_TYPE]"
116129

117130
# command to run tests, e.g. python setup.py test
118131
script:
@@ -122,20 +135,19 @@ script:
122135
flake8 nibabel
123136
elif [ "${CHECK_TYPE}" == "doc" ]; then
124137
cd doc
125-
make html;
126-
make doctest;
138+
make html && make doctest
127139
elif [ "${CHECK_TYPE}" == "test" ]; then
128140
# Change into an innocuous directory and find tests from installation
129141
mkdir for_testing
130142
cd for_testing
131143
cp ../.coveragerc .
132-
nosetests --with-doctest --with-coverage --cover-package nibabel nibabel
144+
pytest --doctest-modules --cov nibabel -v --pyargs nibabel
133145
else
134146
false
135147
fi
136148
137149
after_script:
138-
- travis_retry pip install codecov
150+
- travis_retry python3 -m pip install codecov
139151
- codecov
140152

141153
notifications:

.zenodo.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@
259259
{
260260
"name": "Schwartz, Yannick"
261261
},
262+
{
263+
"affiliation": "Hospital for Sick Children",
264+
"name": "Darwin, Benjamin C"
265+
},
262266
{
263267
"affiliation": "INRIA",
264268
"name": "Thirion, Bertrand",
@@ -319,6 +323,9 @@
319323
"name": "Reddam, Venkateswara Reddy",
320324
"orcid": "0000-0001-6817-2966"
321325
},
326+
{
327+
"name": "Baratz, Zvi"
328+
},
322329
{
323330
"name": "freec84"
324331
}

Changelog

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,40 @@ Eric Larson (EL), Demian Wassermann, and Stephan Gerhard.
2525

2626
References like "pr/298" refer to github pull request numbers.
2727

28-
3.0.0 (To Be Determined)
29-
========================
28+
3.0.2 (Monday 9 March 2020)
29+
===========================
30+
31+
Bug fixes
32+
---------
33+
* Attempt to find versioneer version when building docs (pr/894) (CM)
34+
* Delay import of h5py until neded (backport of pr/889) (YOH, reviewed by CM)
35+
36+
Maintenance
37+
-----------
38+
* Fix typo in documentation (backport of pr/893) (Zvi Baratz, reviewed by CM)
39+
* Set minimum matplotlib to 1.5.3 to ensure wheels are available on all
40+
supported Python versions. (backport of pr/887) (CM)
41+
* Remove ``pyproject.toml`` for now. (issue/859) (CM)
42+
43+
44+
3.0.1 (Monday 27 January 2020)
45+
==============================
46+
47+
Bug fixes
48+
---------
49+
* Test failed by using array method on tuple. (pr/860) (Ben Darwin, reviewed by
50+
CM)
51+
* Validate ``ExpiredDeprecationError``\s, promoted by 3.0 release from
52+
``DeprecationWarning``\s. (pr/857) (CM)
53+
54+
Maintenance
55+
-----------
56+
* Remove logic accommodating numpy without float16 types. (pr/866) (CM)
57+
* Accommodate new numpy dtype strings. (pr/858) (CM)
58+
59+
60+
3.0.0 (Wednesday 18 December 2019)
61+
==================================
3062

3163
New features
3264
------------
@@ -63,9 +95,11 @@ Enhancements
6395

6496
Bug fixes
6597
---------
66-
* Sliced ``Tractogram``s no longer ``apply_affine`` to the original
98+
* Sliced ``Tractogram``\s no longer ``apply_affine`` to the original
6799
``Tractogram``'s streamlines. (pr/811) (MC, reviewed by Serge Koudoro,
68100
Philippe Poulin, CM, MB)
101+
* Change strings with invalid escapes to raw strings (pr/827) (EL, reviewed
102+
by CM)
69103
* Re-import externals/netcdf.py from scipy to resolve numpy deprecation
70104
(pr/821) (CM)
71105

@@ -79,6 +113,10 @@ Maintenance
79113

80114
API changes and deprecations
81115
----------------------------
116+
* Fully remove deprecated ``checkwarns`` and ``minc`` modules. (pr/852) (CM)
117+
* The ``keep_file_open`` argument to file load operations and ``ArrayProxy``\s
118+
no longer acccepts the value ``"auto"``, raising a ``ValueError``. (pr/852)
119+
(CM)
82120
* Deprecate ``ArraySequence.data`` in favor of ``ArraySequence.get_data()``,
83121
which will return a copy. ``ArraySequence.data`` now returns a read-only
84122
view. (pr/811) (MC, reviewed by Serge Koudoro, Philippe Poulin, CM, MB)
@@ -398,7 +436,7 @@ New features
398436
* Support for MRtrix TCK streamlines file format (pr/486) (MC, reviewed by
399437
MB, Arnaud Bore, J-Donald Tournier, Jean-Christophe Houde)
400438
* Added ``get_fdata()`` as default method to retrieve scaled floating point
401-
data from ``DataobjImage``s (pr/551) (MB, reviewed by CM, SG)
439+
data from ``DataobjImage``\s (pr/551) (MB, reviewed by CM, SG)
402440

403441
Enhancements
404442
------------

azure-pipelines.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ jobs:
66
vmImage: windows-2019
77
matrix:
88
py35-x86:
9-
PYTHON_VERSION: '3.5'
10-
PYTHON_ARCH: 'x86'
11-
py35-x64:
12-
PYTHON_VERSION: '3.5'
13-
PYTHON_ARCH: 'x64'
14-
py35-h5py-check:
15-
PYTHON_VERSION: '3.5'
16-
PYTHON_ARCH: 'x64'
17-
PYTHONHASHSEED: 283137131
18-
DEPENDS: "h5py==2.9.0"
199
py36-x86:
2010
PYTHON_VERSION: '3.6'
2111
PYTHON_ARCH: 'x86'

dev-requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Requirements for running tests
22
-r requirements.txt
3-
nose
4-
mock
3+
pytest

doc-requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
sphinx
44
numpydoc
55
texext
6-
matplotlib>=1.3
7-
mock
6+
matplotlib >=1.3.1

doc/source/conf.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121

2222
import sys
2323
import os
24-
try:
25-
from configparser import ConfigParser
26-
except ImportError:
27-
from ConfigParser import ConfigParser # PY2
24+
from runpy import run_path
25+
from configparser import ConfigParser
2826

2927
# Check for external Sphinx extensions we depend on
3028
try:
@@ -51,9 +49,7 @@
5149
# -- General configuration ----------------------------------------------------
5250

5351
# We load the nibabel release info into a dict by explicit execution
54-
rel = {}
55-
with open(os.path.join('..', '..', 'nibabel', 'info.py'), 'r') as fobj:
56-
exec(fobj.read(), rel)
52+
rel = run_path(os.path.join('..', '..', 'nibabel', 'info.py'))
5753

5854
# Write long description from info
5955
with open('_long_description.inc', 'wt') as fobj:
@@ -62,10 +58,7 @@
6258
# Load metadata from setup.cfg
6359
config = ConfigParser()
6460
config.read(os.path.join('..', '..', 'setup.cfg'))
65-
try:
66-
metadata = config['metadata']
67-
except AttributeError:
68-
metadata = dict(config.items('metadata')) # PY2
61+
metadata = config['metadata']
6962

7063
# Add any Sphinx extension module names here, as strings. They can be
7164
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
@@ -99,7 +92,7 @@
9992

10093
# General information about the project.
10194
project = u'NiBabel'
102-
copyright = u'2006-2019, %(maintainer)s <%(author_email)s>' % metadata
95+
copyright = u'2006-2020, %(maintainer)s <%(author_email)s>' % metadata
10396

10497
# The version info for the project you're documenting, acts as replacement for
10598
# |version| and |release|, also used in various other places throughout the

0 commit comments

Comments
 (0)