Skip to content

Commit 2b1dd2f

Browse files
committed
fix: resolved conflicts
2 parents 9caabb9 + 0c429fe commit 2b1dd2f

Some content is hidden

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

53 files changed

+3787
-1130
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "nibabel-data/parrec_oblique"]
1414
path = nibabel-data/parrec_oblique
1515
url = https://github.com/grlee77/parrec_oblique.git
16+
[submodule "nibabel-data/nitest-cifti2"]
17+
path = nibabel-data/nitest-cifti2
18+
url = https://github.com/demianw/nibabel-nitest-cifti2.git

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ env:
2424
- PYDICOM=1
2525
- INSTALL_TYPE="setup"
2626
python:
27-
- 2.6
2827
- 3.3
2928
- 3.4
3029
- 3.5
@@ -38,6 +37,10 @@ matrix:
3837
env:
3938
- DEPENDS=numpy==1.5.1 PYDICOM=0
4039
# Absolute minimum dependencies plus oldest MPL
40+
# Check these against:
41+
# doc/source/installation.rst
42+
# requirements.txt
43+
# .travis.yml
4144
- python: 2.7
4245
env:
4346
- DEPENDS="numpy==1.5.1 matplotlib==1.3.1" PYDICOM=0

appveyor.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ environment:
1717
PYTHON_VERSION: "3.4"
1818
PYTHON_ARCH: "64"
1919

20+
- PYTHON: "C:\\Python35-conda64"
21+
PYTHON_VERSION: "3.5"
22+
PYTHON_ARCH: "64"
23+
24+
- PYTHON: "C:\\Python35-conda32"
25+
PYTHON_VERSION: "3.5"
26+
PYTHON_ARCH: "32"
27+
2028
install:
2129
# Install miniconda Python
2230
- "powershell ./tools/install_python.ps1"
@@ -26,6 +34,13 @@ install:
2634
# the parent CMD process).
2735
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
2836

37+
# Set up a conda environment:
38+
- conda config --set always_yes yes
39+
- conda update -q conda
40+
- conda info -a
41+
- conda create -q -n test-environment python=%PYTHON_VERSION%
42+
- activate test-environment
43+
2944
# Check that we have the expected version and architecture for Python
3045
- "python --version"
3146
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""

doc/source/installation.rst

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ the source from `NiBabel pypi`_ . Go to the pypi page and select the source
4848
distribution you want. Download the distribution, unpack it, and then, from
4949
the unpacked directory, run::
5050

51-
python setup.py install
51+
pip install .
5252

53-
or (if you need root permission to install on a unix system)::
53+
If you get permission errors, this may be because ``pip`` is trying to install
54+
to the system directories. You can solve this error by using ``sudo``, but we
55+
strongly suggest you either do an install into your "user" directories, like
56+
this::
5457

55-
sudo python setup.py install
58+
pip install --user .
59+
60+
or you work inside a virtualenv_.
5661

5762
.. _install_debian:
5863

@@ -66,60 +71,56 @@ their repositories. Once this is done, installing NiBabel is::
6671
apt-get update
6772
apt-get install python-nibabel
6873

69-
Install from source
70-
===================
74+
Install a development version
75+
=============================
7176

72-
If no installer or package is provided for your platform, you can install
73-
NiBabel from source.
77+
If you want to test the latest development version of nibabel, or you'd like to
78+
help by contributing bug-fixes or new features (excellent!), then this section
79+
is for you.
7480

7581
Requirements
7682
------------
7783

78-
* Python_ 2.6 or greater
79-
* NumPy_ 1.5 or greater
80-
* SciPy_ (for full SPM-ANALYZE support)
81-
* PyDICOM_ 0.9.7 or greater (for DICOM support)
82-
* `Python Imaging Library`_ (for PNG conversion in DICOMFS)
83-
* nose_ 0.11 or greater (to run the tests)
84-
* sphinx_ (to build the documentation)
84+
.. check these against:
85+
nibabel/info.py
86+
requirements.txt
87+
.travis.yml
8588
86-
Get the sources
87-
---------------
89+
* Python_ 2.7 or greater
90+
* NumPy_ 1.5 or greater
91+
* SciPy_ (optional, for full SPM-ANALYZE support)
92+
* PyDICOM_ 0.9.7 or greater (optional, for DICOM support)
93+
* `Python Imaging Library`_ (optional, for PNG conversion in DICOMFS)
94+
* nose_ 0.11 or greater (optional, to run the tests)
95+
* sphinx_ (optional, to build the documentation)
8896

89-
The latest release is always available from `NiBabel pypi`_.
97+
Get the development sources
98+
---------------------------
9099

91-
Alternatively, you can download a tarball of the latest development snapshot
92-
(i.e. the current state of the *master* branch of the NiBabel source code
93-
repository) from the `NiBabel github`_ page.
100+
You can download a tarball of the latest development snapshot (i.e. the current
101+
state of the *master* branch of the NiBabel source code repository) from the
102+
`NiBabel github`_ page.
94103

95104
If you want to have access to the full NiBabel history and the latest
96-
development code, do a full clone (aka checkout) of the NiBabel
105+
development code, do a full clone (AKA checkout) of the NiBabel
97106
repository::
98107

99-
git clone git://github.com/nipy/nibabel.git
100-
101-
or::
102-
103108
git clone https://github.com/nipy/nibabel.git
104109

105-
(The first may be faster, the second more likely to work behind a firewall).
106-
107110
Installation
108111
------------
109112

110113
Just install the modules by invoking::
111114

112-
sudo python setup.py install
113-
114-
If sudo is not configured (or even installed) you might have to use
115-
``su`` instead.
115+
pip install .
116116

117+
See :ref:`install-pypi` for advice on what to do for permission errors.
117118

118119
Validating your install
119120
-----------------------
120121

121-
For a basic test of your installation, fire up Python and try importing the module to see if everything is fine.
122-
It should look something like this::
122+
For a basic test of your installation, fire up Python and try importing the
123+
module to see if everything is fine. It should look something like this::
123124

124125
Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35)
125126
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
@@ -128,8 +129,10 @@ It should look something like this::
128129
>>>
129130

130131

131-
To run the nibabel test suite, from the terminal run ``nosetests nibabel`` or ``python -c "import nibabel; nibabel.test()``.
132+
To run the nibabel test suite, from the terminal run ``nosetests nibabel`` or
133+
``python -c "import nibabel; nibabel.test()``.
132134

133-
To run an extended test suite that validates ``nibabel`` for long-running and resource-intensive cases, please see :ref:`advanced_testing`.
135+
To run an extended test suite that validates ``nibabel`` for long-running and
136+
resource-intensive cases, please see :ref:`advanced_testing`.
134137

135138
.. include:: links_names.txt

doc/source/links_names.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
https://pip.readthedocs.org/en/latest/installing.html
109109
.. _twine: https://pypi.python.org/pypi/twine
110110
.. _datapkg: https://pythonhosted.org/datapkg/
111-
.. _python imaging library: http://pythonware.com/products/pil/
111+
.. _python imaging library: https://pypi.python.org/pypi/Pillow
112112

113113
.. Python imaging projects
114114
.. _PyMVPA: http://www.pymvpa.org

nibabel-data/nitest-cifti2

Submodule nitest-cifti2 added at 26b7cb9

nibabel/arrayproxy.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
"""
2828
import warnings
2929

30+
import numpy as np
31+
3032
from .volumeutils import array_from_file, apply_read_scaling
3133
from .fileslice import fileslice
3234
from .keywordonly import kw_only_meth
@@ -111,8 +113,12 @@ def shape(self):
111113
return self._shape
112114

113115
@property
114-
def is_proxy(self):
115-
return True
116+
def dtype(self):
117+
return self._dtype
118+
119+
@property
120+
def offset(self):
121+
return self._offset
116122

117123
@property
118124
def slope(self):
@@ -123,8 +129,8 @@ def inter(self):
123129
return self._inter
124130

125131
@property
126-
def offset(self):
127-
return self._offset
132+
def is_proxy(self):
133+
return True
128134

129135
def get_unscaled(self):
130136
''' Read of data from file
@@ -164,3 +170,10 @@ def is_proxy(obj):
164170
return obj.is_proxy
165171
except AttributeError:
166172
return False
173+
174+
175+
def reshape_dataobj(obj, shape):
176+
""" Use `obj` reshape method if possible, else numpy reshape function
177+
"""
178+
return (obj.reshape(shape) if hasattr(obj, 'reshape')
179+
else np.reshape(obj, shape))

nibabel/arraywriters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def _check_nan2zero(self, nan2zero):
194194
raise WriterError('Deprecated `nan2zero` argument to `to_fileobj` '
195195
'must be same as class value set in __init__')
196196
warnings.warn('Please remove `nan2zero` from call to ' '`to_fileobj` '
197-
'and use in instance __init__ instead',
197+
'and use in instance __init__ instead.\n'
198+
'* deprecated in version: 2.0\n'
199+
'* will raise error in version: 4.0\n',
198200
DeprecationWarning, stacklevel=3)
199201

200202
def _needs_nan2zero(self):

nibabel/cifti2/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
cifti2
1717
"""
1818

19-
from .parse_cifti2_fast import Cifti2Extension
19+
from .parse_cifti2 import Cifti2Extension
2020
from .cifti2 import (Cifti2MetaData, Cifti2Header, Cifti2Image, Cifti2Label,
2121
Cifti2LabelTable, Cifti2VertexIndices,
2222
Cifti2VoxelIndicesIJK, Cifti2BrainModel, Cifti2Matrix,
2323
Cifti2MatrixIndicesMap, Cifti2NamedMap, Cifti2Parcel,
24-
Cifti2Surface, Cifti2TransformationMatrixVoxelIndicesIJKtoXYZ,
25-
Cifti2Vertices, Cifti2Volume, CIFTI_BrainStructures,
26-
Cifti2DenseDataSeries, CIFTI_MODEL_TYPES, load, save)
24+
Cifti2Surface,
25+
Cifti2TransformationMatrixVoxelIndicesIJKtoXYZ,
26+
Cifti2Vertices, Cifti2Volume, CIFTI_BRAIN_STRUCTURES,
27+
Cifti2HeaderError, CIFTI_MODEL_TYPES, load, save)

0 commit comments

Comments
 (0)