Skip to content

Commit 04ed870

Browse files
committed
Merge branch 'maint/3.0.x'
2 parents d9298ed + ff7c276 commit 04ed870

File tree

16 files changed

+92
-66
lines changed

16 files changed

+92
-66
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ script:
136136
flake8 nibabel
137137
elif [ "${CHECK_TYPE}" == "doc" ]; then
138138
cd doc
139-
make html;
140-
make doctest;
139+
make html && make doctest
141140
elif [ "${CHECK_TYPE}" == "test" ]; then
142141
# Change into an innocuous directory and find tests from installation
143142
mkdir for_testing

.zenodo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@
323323
"name": "Reddam, Venkateswara Reddy",
324324
"orcid": "0000-0001-6817-2966"
325325
},
326+
{
327+
"name": "Baratz, Zvi"
328+
},
326329
{
327330
"name": "freec84"
328331
}

Changelog

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ Eric Larson (EL), Demian Wassermann, and Stephan Gerhard.
2525

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

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+
2844
3.0.1 (Monday 27 January 2020)
2945
==============================
3046

@@ -79,7 +95,7 @@ Enhancements
7995

8096
Bug fixes
8197
---------
82-
* Sliced ``Tractogram``s no longer ``apply_affine`` to the original
98+
* Sliced ``Tractogram``\s no longer ``apply_affine`` to the original
8399
``Tractogram``'s streamlines. (pr/811) (MC, reviewed by Serge Koudoro,
84100
Philippe Poulin, CM, MB)
85101
* Change strings with invalid escapes to raw strings (pr/827) (EL, reviewed
@@ -98,7 +114,7 @@ Maintenance
98114
API changes and deprecations
99115
----------------------------
100116
* Fully remove deprecated ``checkwarns`` and ``minc`` modules. (pr/852) (CM)
101-
* The ``keep_file_open`` argument to file load operations and ``ArrayProxy``s
117+
* The ``keep_file_open`` argument to file load operations and ``ArrayProxy``\s
102118
no longer acccepts the value ``"auto"``, raising a ``ValueError``. (pr/852)
103119
(CM)
104120
* Deprecate ``ArraySequence.data`` in favor of ``ArraySequence.get_data()``,
@@ -420,7 +436,7 @@ New features
420436
* Support for MRtrix TCK streamlines file format (pr/486) (MC, reviewed by
421437
MB, Arnaud Bore, J-Donald Tournier, Jean-Christophe Houde)
422438
* Added ``get_fdata()`` as default method to retrieve scaled floating point
423-
data from ``DataobjImage``s (pr/551) (MB, reviewed by CM, SG)
439+
data from ``DataobjImage``\s (pr/551) (MB, reviewed by CM, SG)
424440

425441
Enhancements
426442
------------

doc/source/conf.py

Lines changed: 4 additions & 11 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.

doc/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ contributed code and discussion (in rough order of appearance):
105105
* Dorota Jarecka
106106
* Chris Gorgolewski
107107
* Benjamin C Darwin
108+
* Zvi Baratz
108109

109110
License reprise
110111
===============

doc/tools/build_modref_templates.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# stdlib imports
66
import sys
77
import re
8+
import os
89
from os.path import join as pjoin
910

1011
# local imports
@@ -48,12 +49,25 @@ def abort(error):
4849

4950
installed_version = V(module.__version__)
5051

51-
info_file = pjoin('..', package, 'info.py')
52-
info_lines = open(info_file).readlines()
53-
source_version = '.'.join([v.split('=')[1].strip(" '\n.")
54-
for v in info_lines if re.match(
55-
'^_version_(major|minor|micro|extra)', v
56-
)])
52+
version_file = pjoin('..', package, '_version.py')
53+
source_version = None
54+
if os.path.exists(version_file):
55+
# Versioneer
56+
from runpy import run_path
57+
try:
58+
source_version = run_path(version_file)['get_versions']()['version']
59+
except (FileNotFoundError, KeyError):
60+
pass
61+
if source_version == '0+unknown':
62+
source_version = None
63+
if source_version is None:
64+
# Legacy fall-back
65+
info_file = pjoin('..', package, 'info.py')
66+
info_lines = open(info_file).readlines()
67+
source_version = '.'.join([v.split('=')[1].strip(" '\n.")
68+
for v in info_lines if re.match(
69+
'^_version_(major|minor|micro|extra)', v
70+
)])
5771
print('***', source_version)
5872

5973
if source_version != installed_version:
@@ -68,6 +82,7 @@ def abort(error):
6882
r'.*test.*$',
6983
r'\.info.*$',
7084
r'\.pkg_info.*$',
85+
r'\.py3k.*$',
7186
]
7287
docwriter.write_api_docs(outdir)
7388
docwriter.write_index(outdir, 'index', relative_to=outdir)

nibabel/affines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def obliquity(affine):
306306
This implementation is inspired by `AFNI's implementation
307307
<https://github.com/afni/afni/blob/b6a9f7a21c1f3231ff09efbd861f8975ad48e525/src/thd_coords.c#L660-L698>`_.
308308
For further details about *obliquity*, check `AFNI's documentation
309-
<https://sscc.nimh.nih.gov/sscc/dglen/Obliquity>_.
309+
<https://sscc.nimh.nih.gov/sscc/dglen/Obliquity>`_.
310310
311311
Parameters
312312
----------

nibabel/brikhead.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def __init__(self, file_like, header, *, mmap=True, keep_file_open=None):
248248
a new file handle is created every time the image is accessed.
249249
If ``file_like`` refers to an open file handle, this setting has no
250250
effect. The default value (``None``) will result in the value of
251-
``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT` being used.
251+
``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT`` being used.
252252
"""
253253
super(AFNIArrayProxy, self).__init__(file_like,
254254
header,
@@ -530,7 +530,7 @@ def from_file_map(klass, file_map, *, mmap=True, keep_file_open=None):
530530
a new file handle is created every time the image is accessed.
531531
If ``file_like`` refers to an open file handle, this setting has no
532532
effect. The default value (``None``) will result in the value of
533-
``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT` being used.
533+
``nibabel.arrayproxy.KEEP_FILE_OPEN_DEFAULT`` being used.
534534
"""
535535
with file_map['header'].get_prepare_fileobj('rt') as hdr_fobj:
536536
hdr = klass.header_class.from_fileobj(hdr_fobj)
@@ -550,6 +550,7 @@ def filespec_to_file_map(klass, filespec):
550550
afni.nimh.nih.gov/pub/dist/doc/program_help/README.compression.html.
551551
Thus, if you have AFNI files my_image.HEAD and my_image.BRIK.gz and you
552552
want to load the AFNI BRIK / HEAD pair, you can specify:
553+
553554
* The HEAD filename - e.g., my_image.HEAD
554555
* The BRIK filename w/o compressed extension - e.g., my_image.BRIK
555556
* The full BRIK filename - e.g., my_image.BRIK.gz

nibabel/cifti2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
Cifti2TransformationMatrixVoxelIndicesIJKtoXYZ,
2727
Cifti2Vertices, Cifti2Volume, CIFTI_BRAIN_STRUCTURES,
2828
Cifti2HeaderError, CIFTI_MODEL_TYPES, load, save)
29-
from .cifti2_axes import (Axis, BrainModelAxis, ParcelsAxis, SeriesAxis, LabelAxis, ScalarAxis)
29+
from .cifti2_axes import (Axis, BrainModelAxis, ParcelsAxis, SeriesAxis, LabelAxis, ScalarAxis)

nibabel/cifti2/cifti2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _to_xml_element(self):
171171

172172

173173
class Cifti2LabelTable(xml.XmlSerializable, MutableMapping):
174-
""" CIFTI-2 label table: a sequence of ``Cifti2Label``s
174+
""" CIFTI-2 label table: a sequence of ``Cifti2Label``\s
175175
176176
* Description - Used by NamedMap when IndicesMapToDataType is
177177
"CIFTI_INDEX_TYPE_LABELS" in order to associate names and display colors
@@ -926,8 +926,8 @@ class Cifti2MatrixIndicesMap(xml.XmlSerializable, MutableSequence):
926926
* Text Content: [NA]
927927
* Parent Element - Matrix
928928
929-
Attribute
930-
---------
929+
Attributes
930+
----------
931931
applies_to_matrix_dimension : list of ints
932932
Dimensions of this matrix that follow this mapping
933933
indices_map_to_data_type : str one of CIFTI_MAP_TYPES

0 commit comments

Comments
 (0)