Skip to content

Commit 5f2afe2

Browse files
committed
Merge remote-tracking branch 'upstream/master' into enh/cifti2
* upstream/master: WIP: debugging round trip error BF: add requirements.txt to MANIFEST.in TST: Add sdist, wheel & requirements INSTALL_TYPEs TST: Travis with pydicom > 0.9.9 git commit BF: Prepare for pydicom 1.0 DOC: include all copyright information in greyed box. DOC: change URL to numpy docstring style guide (partial fix for #376) DOC: fix openhub.net badge (#378), prevent overflow of sidebar content. DOC: Add six copyright (#375) DOC: remove trailing sentence RF: remove doctest string markup TST: enable Python 3.5 tests RF+API: TripWireError subclasses AttributeError
2 parents d03f68d + cf99743 commit 5f2afe2

22 files changed

+207
-1334
lines changed

.travis.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ env:
2121
global:
2222
- DEPENDS="numpy scipy matplotlib h5py"
2323
- PYDICOM=1
24+
- INSTALL_TYPE="setup"
2425
python:
2526
- 2.6
2627
- 3.2
2728
- 3.3
2829
- 3.4
30+
- 3.5
2931
matrix:
3032
include:
3133
- python: 2.7
@@ -39,20 +41,37 @@ matrix:
3941
- python: 2.7
4042
env:
4143
- DEPENDS="numpy==1.5.1 pydicom==0.9.7"
44+
# pydicom 1.0 (currently unreleased)
45+
- python: 2.7
46+
env:
47+
- PYDICOM="v1.0"
4248
# Documentation doctests
4349
- python: 2.7
4450
env:
4551
- DOC_DOC_TEST=1
52+
- python: 2.7
53+
env:
54+
- INSTALL_TYPE=sdist
55+
- python: 2.7
56+
env:
57+
- INSTALL_TYPE=wheel
58+
- python: 2.7
59+
env:
60+
- INSTALL_TYPE=requirements
4661
before_install:
62+
- source tools/travis_tools.sh
4763
- virtualenv --python=python venv
4864
- source venv/bin/activate
4965
- python --version # just to check
50-
- pip install nose # always
51-
- pip install --no-index -f http://travis-wheels.scikit-image.org $DEPENDS
66+
- pip install -U pip # upgrade to latest pip to find 3.5 wheels
67+
- retry pip install nose # always
68+
- wheelhouse_pip_install $DEPENDS
5269
# pydicom <= 0.9.8 doesn't install on python 3
5370
- if [ "${TRAVIS_PYTHON_VERSION:0:1}" == "2" ]; then
5471
if [ "$PYDICOM" == "1" ]; then
5572
pip install pydicom;
73+
elif [ "$PYDICOM" == "v1.0" ]; then
74+
pip install git+https://github.com/darcymason/pydicom.git@43f278444d5cb2e4648135d3edcd430c363c6975;
5675
fi
5776
fi
5877
- if [ "${COVERAGE}" == "1" ]; then
@@ -61,7 +80,21 @@ before_install:
6180
fi
6281
# command to install dependencies
6382
install:
64-
- python setup.py install
83+
- |
84+
if [ "$INSTALL_TYPE" == "setup" ]; then
85+
python setup.py install
86+
elif [ "$INSTALL_TYPE" == "sdist" ]; then
87+
python setup_egg.py egg_info # check egg_info while we're here
88+
python setup_egg.py sdist
89+
wheelhouse_pip_install dist/*.tar.gz
90+
elif [ "$INSTALL_TYPE" == "wheel" ]; then
91+
pip install wheel
92+
python setup_egg.py bdist_wheel
93+
wheelhouse_pip_install dist/*.whl
94+
elif [ "$INSTALL_TYPE" == "requirements" ]; then
95+
wheelhouse_pip_install -r requirements.txt
96+
python setup.py install
97+
fi
6598
# Point to nibabel data directory
6699
- export NIBABEL_DATA_DIR="$PWD/nibabel-data"
67100
# command to run tests, e.g. python setup.py test

COPYING

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -128,27 +128,29 @@ In ``nibabel/externals/ordereddict.py``
128128

129129
Copied from: https://pypi.python.org/packages/source/o/ordereddict/ordereddict-1.1.tar.gz#md5=a0ed854ee442051b249bfad0f638bbec
130130

131-
Copyright (c) 2009 Raymond Hettinger
132-
133-
Permission is hereby granted, free of charge, to any person
134-
obtaining a copy of this software and associated documentation files
135-
(the "Software"), to deal in the Software without restriction,
136-
including without limitation the rights to use, copy, modify, merge,
137-
publish, distribute, sublicense, and/or sell copies of the Software,
138-
and to permit persons to whom the Software is furnished to do so,
139-
subject to the following conditions:
140-
141-
The above copyright notice and this permission notice shall be
142-
included in all copies or substantial portions of the Software.
143-
144-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
145-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
146-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
147-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
148-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
149-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
150-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
151-
OTHER DEALINGS IN THE SOFTWARE.
131+
::
132+
133+
Copyright (c) 2009 Raymond Hettinger
134+
135+
Permission is hereby granted, free of charge, to any person
136+
obtaining a copy of this software and associated documentation files
137+
(the "Software"), to deal in the Software without restriction,
138+
including without limitation the rights to use, copy, modify, merge,
139+
publish, distribute, sublicense, and/or sell copies of the Software,
140+
and to permit persons to whom the Software is furnished to do so,
141+
subject to the following conditions:
142+
143+
The above copyright notice and this permission notice shall be
144+
included in all copies or substantial portions of the Software.
145+
146+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
147+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
148+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
149+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
150+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
151+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
152+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
153+
OTHER DEALINGS IN THE SOFTWARE.
152154

153155
mni_icbm152_t1_tal_nlin_asym_09a
154156
--------------------------------
@@ -158,6 +160,8 @@ The file ``doc/source/someone.nii.gz`` is a subsampled version of the file
158160
archive ``mni_icbm152_t1_tal_nlin_asym_09a``. The original image has the
159161
following license (where 'softwware' refers to the image):
160162

163+
::
164+
161165
Copyright (C) 1993-2004 Louis Collins, McConnell Brain Imaging Centre,
162166
Montreal Neurological Institute, McGill University.
163167

@@ -209,3 +213,34 @@ the PDDL version 1.0 available at http://opendatacommons.org/licenses/pddl/1.0/
209213

210214
is courtesy of the University of Massachusetts Medical School, also released
211215
under the PDDL.
216+
217+
218+
Six
219+
--------------------
220+
221+
In ``nibabel/externals/six.py``
222+
223+
Copied from: https://pypi.python.org/packages/source/s/six/six-1.3.0.tar.gz#md5=ec47fe6070a8a64c802363d2c2b1e2ee
224+
225+
::
226+
227+
Copyright (c) 2010-2013 Benjamin Peterson
228+
229+
Permission is hereby granted, free of charge, to any person obtaining a copy of
230+
this software and associated documentation files (the "Software"), to deal in
231+
the Software without restriction, including without limitation the rights to
232+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
233+
the Software, and to permit persons to whom the Software is furnished to do so,
234+
subject to the following conditions:
235+
236+
The above copyright notice and this permission notice shall be included in all
237+
copies or substantial portions of the Software.
238+
239+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
240+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
241+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
242+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
243+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
244+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
245+
246+

Changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ References like "pr/298" refer to github pull request numbers.
3434
are raising a DataError if the track is truncated when ``strict=True``
3535
(the default), rather than a TypeError when trying to create the points
3636
array.
37+
* tripwire.TripWire object now raises subclass of AttributeError when trying
38+
to get an attribute, rather than a direct subclass of Exception. This
39+
prevents Python 3.5 triggering the tripwire when doing inspection prior to
40+
running doctests.
41+
* Minor API change for tripwire.TripWire object; code that checked for
42+
AttributeError will now also catch TripWireError.
3743

3844
* 2.0.1 (Saturday 27 June 2015)
3945

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include AUTHOR COPYING Makefile* MANIFEST.in setup* README.*
2-
include Changelog TODO
2+
include Changelog TODO requirements.txt
33
recursive-include doc *
44
recursive-include bin *
55
recursive-include tools *

doc/source/_static/nibabel.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ div.footer {
3131
div.body {
3232
background-color: white;
3333
}
34+
35+
.sphinxsidebarwrapper {
36+
/* don't let anything exceed sidebar boundaries */
37+
overflow: hidden;
38+
}

doc/source/_templates/indexsidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h3>Quick links</h3>
66
<li><a href="https://mail.python.org/pipermail/neuroimaging">Mailing list archive</a></li>
77
</ul>
88

9-
<script type="text/javascript" src="https://www.ohloh.net/projects/480908/widgets/project_partner_badge"></script>
9+
<script type='text/javascript' src='https://www.openhub.net/p/nibabel/widgets/project_thin_badge?format=js'></script>
1010

1111
<h3>Search mailing list archive</h3>
1212
<script type="text/javascript">

doc/source/devel/devguide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Code Documentation
2828

2929
All documentation should be written using Numpy documentation conventions:
3030

31-
http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard
31+
https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard
3232

3333

3434
Git Repository

doc/source/dicom/dcm2nii_algorithms.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,4 @@ Sort compares two dicom images, call them ``dcm1`` and ``dcm2``. Tests are:
8989

9090
Next remove repeated values as found in the first step above.
9191

92-
There's a function ``
93-
94-
9592
.. include:: ../links_names.txt

nibabel/nicom/dicomwrappers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,13 @@ def wrapper_from_file(file_like, *args, **kwargs):
4949
dcm_w : ``dicomwrappers.Wrapper`` or subclass
5050
DICOM wrapper corresponding to DICOM data type
5151
"""
52-
import dicom
52+
try:
53+
from dicom import read_file
54+
except ImportError:
55+
from pydicom.dicomio import read_file
5356

5457
with ImageOpener(file_like) as fobj:
55-
dcm_data = dicom.read_file(fobj, *args, **kwargs)
58+
dcm_data = read_file(fobj, *args, **kwargs)
5659
return wrapper_from_data(dcm_data)
5760

5861

nibabel/nicom/tests/test_csareader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ def test_csa_header_read():
3131
assert_true(csa.is_mosaic(hdr))
3232
# Get a shallow copy of the data, lacking the CSA marker
3333
# Need to do it this way because del appears broken in pydicom 0.9.7
34-
from dicom.dataset import Dataset
34+
try:
35+
from dicom.dataset import Dataset
36+
except ImportError:
37+
from pydicom.dataset import Dataset
3538
data2 = Dataset()
3639
for element in DATA:
3740
if (element.tag.group, element.tag.elem) != (0x29, 0x10):

0 commit comments

Comments
 (0)