Skip to content

Commit ad3316f

Browse files
committed
Merge branch 'master' of https://github.com/htwangtw/nibabel into gifti_improve_io
* 'master' of https://github.com/htwangtw/nibabel: (94 commits) Fixed A-P to P-A in coord systems docs DOCTEST: Delete reference to mmap data to avoid warning DOCTEST: Avoid fixed ID in doctest Re-import externals/netcdf.py from scipy DOCTEST: Delete reference to mmap data to avoid warning DOCTEST: Avoid fixed ID in doctest Re-import externals/netcdf.py from scipy MAINT: 2.5.2-dev add @hbraunDSP affiliation and ORCID MAINT: Update setup.cfg nose version to match installation instructions DOC: Add Henry Braun to contributor list MAINT: Update zenodo.json MAINT: Version 2.5.1 DOC: Update changelog for upcoming 2.5.1 release DOC: Update test_image_api docstring for clarity, consistency ENH: Remove img.get_data() from internal use except for appropriate tests TEST: Reproduce gh-802 MAINT: Check nightly builds on 3.7 MAINT: Check nightly builds on 3.7 FIX: Coerce data types on writing GIFTI DataArrays ...
2 parents bd95ce8 + de44a10 commit ad3316f

File tree

170 files changed

+3647
-1201
lines changed

Some content is hidden

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

170 files changed

+3647
-1201
lines changed

.azure-pipelines/windows.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
vmImage: ${{ parameters.vmImage }}
1111
variables:
1212
EXTRA_WHEELS: "https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
13+
DEPENDS: numpy scipy matplotlib h5py pydicom
1314
strategy:
1415
matrix:
1516
${{ insert }}: ${{ parameters.matrix }}
@@ -20,11 +21,14 @@ jobs:
2021
versionSpec: '$(PYTHON_VERSION)'
2122
addToPath: true
2223
architecture: '$(PYTHON_ARCH)'
24+
- script: |
25+
echo %PYTHONHASHSEED%
26+
displayName: 'Display hash seed'
2327
- script: |
2428
python -m pip install --upgrade pip setuptools>=30.3.0 wheel
2529
displayName: 'Update build tools'
2630
- script: |
27-
python -m pip install --find-links %EXTRA_WHEELS% numpy scipy matplotlib h5py pydicom
31+
python -m pip install --find-links %EXTRA_WHEELS% %DEPENDS%
2832
python -m pip install nose mock coverage codecov
2933
displayName: 'Install dependencies'
3034
- script: |

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ omit =
66
*/externals/*
77
*/benchmarks/*
88
*/tests/*
9+
nibabel/_version.py

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nibabel/COMMIT_INFO.txt export-subst
1+
nibabel/_version.py export-subst

.github/CODE_OF_CONDUCT.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Community Guidelines
2+
3+
Nibabel is a [NIPY](https://nipy.org) project, and we strive to adhere to the
4+
[NIPY Community Code](https://nipy.org/conduct.html), reproduced below.
5+
6+
The NIPY community is a community of practice devoted to the use of the Python programming language
7+
in the analysis of neuroimaging data. The following code of conduct is a guideline for our behavior
8+
as we participate in this community.
9+
10+
It is based on, and heavily inspired by a reading of the Python community code of conduct, the
11+
Apache foundation code of conduct, the Debian code of conduct, and the Ten Principles of Burning
12+
Man.
13+
14+
## The code of conduct for the NIPY community
15+
16+
The Neuroimaging in Python (NIPY) community is made up of members with a diverse set of skills,
17+
personalities, background, and experiences. We welcome these differences because they are the
18+
source of diverse ideas, solutions and decisions about our work. Decisions we make affect users,
19+
colleagues, and through scientific results, the general public. We take these consequences
20+
seriously when making decisions. When you are working with members of the community, we encourage
21+
you to follow these guidelines, which help steer our interactions and help keep NIPY a positive,
22+
successful, and growing community.
23+
24+
### A member of the NIPY community is:
25+
26+
#### Open
27+
28+
Members of the community are open to collaboration. Be it on the reuse of data, on the
29+
implementation of methods, on finding technical solutions, establishing best practices, and
30+
otherwise. We are accepting of all who wish to take part in our activities, fostering an
31+
environment where anyone can participate and everyone can make a difference.
32+
33+
#### Be collaborative!
34+
35+
Our work will be used by other people, and in turn we will depend on the work of others. When we
36+
make something for the benefit of others, we are willing to explain to others how it works, so that
37+
they can build on the work to make it even better. We are willing to provide constructive criticism
38+
on the work of others and accept criticism of our own work, as the experiences and skill sets of
39+
other members contribute to the whole of our efforts.
40+
41+
#### Be inquisitive!
42+
43+
Nobody knows everything! Asking questions early avoids many problems later, so questions are
44+
encouraged, though they may be directed to the appropriate forum. Those who are asked should be
45+
responsive and helpful, within the context of our shared goal of improving neuroimaging practice.
46+
47+
#### Considerate
48+
49+
Members of the community are considerate of their peers. We are thoughtful when addressing the
50+
efforts of others, keeping in mind that often-times the labor was completed simply for the good of
51+
the community. We are attentive in our communications, whether in person or online, and we are
52+
tactful when approaching differing views.
53+
54+
#### Be careful in the words that you choose:
55+
56+
We value courtesy, kindness and inclusiveness in all our interactions. Therefore, we take
57+
responsibility for our own speech. In particular, we avoid:
58+
59+
* Personal insults.
60+
* Violent threats or language directed against another person.
61+
* Sexist, racist, or otherwise discriminatory jokes and language.
62+
* Any form of sexual or violent material.
63+
* Sharing private content, such as emails sent privately or non-publicly, or unlogged forums such
64+
as IRC channel history.
65+
* Excessive or unnecessary profanity.
66+
* Repeated harassment of others. In general, if someone asks you to stop, then stop.
67+
* Advocating for, or encouraging, any of the above behaviour.
68+
69+
#### Try to be concise in communication
70+
71+
Keep in mind that what you write once will be read by many others. Writing a short email means
72+
people can understand the conversation as efficiently as possible. Even short emails should always
73+
strive to be empathetic, welcoming, friendly and patient. When a long explanation is necessary,
74+
consider adding a summary.
75+
76+
Try to bring new ideas to a conversation, so that each message adds something unique to the
77+
conversation. Keep in mind that, when using email, the rest of the thread still contains the other
78+
messages with arguments that have already been made.
79+
80+
Try to stay on topic, especially in discussions that are already fairly long and complex.
81+
82+
#### Respectful
83+
84+
Members of the community are respectful. We are respectful of others, their positions, their
85+
skills, their commitments, and their efforts. We are respectful of the volunteer and professional
86+
efforts that permeate the NIPY community. We are respectful of the processes set forth in the
87+
community, and we work within them. When we disagree, we are courteous and kind in raising our
88+
issues.
89+
90+
## Incident Reporting
91+
92+
We put great value on respectful, friendly and helpful communication.
93+
94+
If you feel that any of our Nibabel communications lack respect, or are unfriendly or unhelpful,
95+
please try the following steps:
96+
97+
* If you feel able, please let the person who has sent the email or comment that you found it
98+
disrespectful / unhelpful / unfriendly, and why;
99+
100+
* If you don't feel able to do that, or that didn't work, please contact Chris Markiewicz directly
101+
by email (<[email protected]>), and he will do his best to resolve it.
102+
If you don't feel comfortable contacting Chris, please email Matthew Brett
103+
(<[email protected]>) instead.
104+
105+
## Attribution
106+
107+
The vast majority of the above was taken from the NIPY Code of Conduct.

.github/CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Contributing to NiBabel
2+
3+
Welcome to the NiBabel repository!
4+
We're excited you're here and want to contribute.
5+
6+
Please see the [NiBabel Developer Guidelines][link_devguide] on our
7+
on our [documentation website][link_docs].
8+
9+
These guidelines are designed to make it as easy as possible to get involved.
10+
If you have any questions that aren't discussed in our documentation, or it's
11+
difficult to find what you're looking for, please let us know by opening an
12+
[issue][link_issues]!
13+
14+
[link_docs]: https://nipy.org/nibabel
15+
[link_devguide]: https://nipy.org/nibabel/devel/devguide.html
16+
[link_issues]: https://github.com/poldracklab/fmriprep/issues

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616
[submodule "nibabel-data/nitest-cifti2"]
1717
path = nibabel-data/nitest-cifti2
1818
url = https://github.com/demianw/nibabel-nitest-cifti2.git
19+
[submodule "nibabel-data/nitest-dicom"]
20+
path = nibabel-data/nitest-dicom
21+
url = https://github.com/effigies/nitest-dicom

.pep8speaks.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
scanner:
2+
diff_only: True # Only show errors caused by the patch
3+
linter: flake8
4+
5+
message: # Customize the comment made by the bot
6+
opened: # Messages when a new PR is submitted
7+
header: "Hello @{name}, thank you for submitting the Pull Request!"
8+
footer: "To test for issues locally, `pip install flake8` and then run `flake8 nibabel`."
9+
updated: # Messages when new commits are added to the PR
10+
header: "Hello @{name}, Thank you for updating!"
11+
footer: "To test for issues locally, `pip install flake8` and then run `flake8 nibabel`."
12+
no_errors: "Cheers! There are no style issues detected in this Pull Request. :beers: "

.travis.yml

Lines changed: 57 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -8,144 +8,118 @@ dist: xenial
88
sudo: true
99
language: python
1010

11-
cache:
12-
directories:
13-
- $HOME/.cache/pip
11+
cache: pip
1412
env:
1513
global:
16-
- DEPENDS="six numpy scipy matplotlib h5py pillow pydicom"
17-
- OPTIONAL_DEPENDS=""
14+
- SETUP_REQUIRES="pip setuptools>=30.3.0 wheel"
15+
- DEPENDS="numpy scipy matplotlib h5py pillow pydicom indexed_gzip"
1816
- INSTALL_TYPE="setup"
1917
- CHECK_TYPE="test"
2018
- EXTRA_WHEELS="https://5cf40426d9f06eb7461d-6fe47d9331aba7cd62fc36c7196769e4.ssl.cf2.rackcdn.com"
2119
- PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
2220
- EXTRA_PIP_FLAGS="--find-links=$EXTRA_WHEELS"
2321
- PRE_PIP_FLAGS="--pre $EXTRA_PIP_FLAGS --find-links $PRE_WHEELS"
22+
2423
python:
25-
- 3.5
2624
- 3.6
2725
- 3.7
26+
2827
matrix:
2928
include:
30-
- python: 3.4
31-
dist: trusty
32-
sudo: false
33-
# Absolute minimum dependencies
34-
- python: 2.7
29+
# Basic dependencies only
30+
- python: 3.5
3531
env:
36-
- DEPENDS="numpy==1.8 setuptools==30.3.0"
32+
- DEPENDS="-r requirements.txt"
33+
# Clean install
34+
- python: 3.5
35+
env:
36+
- DEPENDS=""
37+
- CHECK_TYPE=skiptests
3738
# Absolute minimum dependencies
38-
- python: 2.7
39+
- python: 3.5
3940
env:
40-
- DEPENDS="numpy==1.8"
41-
- CHECK_TYPE="import"
41+
- SETUP_REQUIRES="setuptools==30.3.0"
42+
- DEPENDS="-r min-requirements.txt"
4243
# Absolute minimum dependencies plus oldest MPL
43-
# Check these against:
44-
# nibabel/info.py
45-
# doc/source/installation.rst
46-
# requirements.txt
47-
- python: 2.7
44+
- python: 3.5
4845
env:
49-
- DEPENDS="numpy==1.8 matplotlib==1.3.1"
46+
- DEPENDS="-r min-requirements.txt matplotlib==1.3.1"
5047
# Minimum pydicom dependency
51-
- python: 2.7
48+
- python: 3.5
5249
env:
53-
- DEPENDS="numpy==1.8 pydicom==0.9.9 pillow==2.6"
50+
- DEPENDS="-r min-requirements.txt pydicom==0.9.9 pillow==2.6"
5451
# pydicom master branch
5552
- python: 3.5
5653
env:
5754
- DEPENDS="numpy git+https://github.com/pydicom/pydicom.git@master"
58-
# test 2.7 against pre-release builds of everything
59-
- python: 2.7
55+
# test 3.7 against pre-release builds of everything
56+
- python: 3.7
6057
env:
6158
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
62-
# test 3.5 against pre-release builds of everything
6359
- python: 3.5
64-
env:
65-
- EXTRA_PIP_FLAGS="$PRE_PIP_FLAGS"
66-
- python: 2.7
6760
env:
6861
- INSTALL_TYPE=sdist
69-
- python: 2.7
62+
- python: 3.5
7063
env:
7164
- INSTALL_TYPE=wheel
72-
- python: 2.7
73-
env:
74-
- INSTALL_TYPE=requirements
75-
- python: 2.7
65+
- python: 3.5
7666
env:
7767
- INSTALL_TYPE=archive
78-
- python: 2.7
79-
env:
80-
- CHECK_TYPE="style"
8168
- python: 3.5
8269
env:
8370
- CHECK_TYPE="style"
8471
# Documentation doctests
85-
- python: 2.7
86-
env:
87-
- CHECK_TYPE="doc_doctests"
8872
- python: 3.5
8973
env:
90-
- CHECK_TYPE="doc_doctests"
91-
# Run tests with indexed_gzip present
92-
- python: 2.7
93-
env:
94-
- OPTIONAL_DEPENDS="indexed_gzip"
95-
- python: 3.5
96-
env:
97-
- OPTIONAL_DEPENDS="indexed_gzip"
74+
- CHECK_TYPE="doc"
75+
76+
# Set up virtual environment, build package, build from depends
9877
before_install:
99-
- travis_retry python -m pip install --upgrade pip
100-
- travis_retry pip install --upgrade virtualenv
78+
- travis_retry python -m pip install --upgrade pip virtualenv
10179
- virtualenv --python=python venv
10280
- source venv/bin/activate
10381
- python --version # just to check
104-
- travis_retry pip install -U pip setuptools>=27.0 wheel
105-
- travis_retry pip install coverage
106-
- if [ "${CHECK_TYPE}" == "test" ]; then
107-
travis_retry pip install nose mock;
108-
fi
109-
- if [ "${CHECK_TYPE}" == "style" ]; then
110-
travis_retry pip install flake8;
82+
- travis_retry pip install -U $SETUP_REQUIRES
83+
- |
84+
if [ "$INSTALL_TYPE" == "sdist" ]; then
85+
python setup.py egg_info # check egg_info while we're here
86+
python setup.py sdist
87+
export ARCHIVE=$( ls dist/*.tar.gz )
88+
elif [ "$INSTALL_TYPE" == "wheel" ]; then
89+
python setup.py bdist_wheel
90+
export ARCHIVE=$( ls dist/*.whl )
91+
elif [ "$INSTALL_TYPE" == "archive" ]; then
92+
export ARCHIVE="package.tar.gz"
93+
git archive -o $ARCHIVE HEAD
11194
fi
112-
- travis_retry pip install $EXTRA_PIP_FLAGS $DEPENDS $OPTIONAL_DEPENDS
95+
- if [ -n "$DEPENDS" ]; then pip install $EXTRA_PIP_FLAGS $DEPENDS; fi
96+
11397
# command to install dependencies
11498
install:
11599
- |
116100
if [ "$INSTALL_TYPE" == "setup" ]; then
117101
python setup.py install
118-
elif [ "$INSTALL_TYPE" == "sdist" ]; then
119-
python setup_egg.py egg_info # check egg_info while we're here
120-
python setup_egg.py sdist
121-
pip install $EXTRA_PIP_FLAGS dist/*.tar.gz
122-
elif [ "$INSTALL_TYPE" == "wheel" ]; then
123-
python setup_egg.py bdist_wheel
124-
pip install $EXTRA_PIP_FLAGS dist/*.whl
125-
elif [ "$INSTALL_TYPE" == "requirements" ]; then
126-
pip install $EXTRA_PIP_FLAGS -r requirements.txt
127-
python setup.py install
128-
elif [ "$INSTALL_TYPE" == "archive" ]; then
129-
git archive -o package.tar.gz HEAD
130-
pip install $EXTRA_PIP_FLAGS package.tar.gz
102+
else
103+
pip install $EXTRA_PIP_FLAGS $ARCHIVE
131104
fi
105+
# Basic import check
106+
- python -c 'import nibabel; print(nibabel.__version__)'
107+
- if [ "$CHECK_TYPE" == "skiptests" ]; then exit 0; fi
108+
109+
before_script:
132110
# Point to nibabel data directory
133111
- export NIBABEL_DATA_DIR="$PWD/nibabel-data"
112+
# Because nibabel is already installed, will just look up the extra
113+
- pip install $EXTRA_PIP_FLAGS "nibabel[$CHECK_TYPE]"
114+
134115
# command to run tests, e.g. python setup.py test
135116
script:
136117
- |
137118
if [ "${CHECK_TYPE}" == "style" ]; then
138119
# Run styles only on core nibabel code.
139120
flake8 nibabel
140-
elif [ "${CHECK_TYPE}" == "import" ]; then
141-
# Import nibabel without attempting to test
142-
# Allows us to check missing dependencies masked by testing libraries
143-
printf 'import nibabel\nprint(nibabel.__version__)\n' > import_only.py
144-
cat import_only.py
145-
coverage run import_only.py
146-
elif [ "${CHECK_TYPE}" == "doc_doctests" ]; then
121+
elif [ "${CHECK_TYPE}" == "doc" ]; then
147122
cd doc
148-
pip install -r ../doc-requirements.txt
149123
make html;
150124
make doctest;
151125
elif [ "${CHECK_TYPE}" == "test" ]; then
@@ -157,12 +131,10 @@ script:
157131
else
158132
false
159133
fi
160-
after_success:
161-
- |
162-
if [ "${CHECK_TYPE}" == "test" ]; then
163-
travis_retry pip install codecov
164-
codecov
165-
fi
134+
135+
after_script:
136+
- travis_retry pip install codecov
137+
- codecov
166138

167139
notifications:
168140
webhooks: http://nipy.bic.berkeley.edu:54856/travis

0 commit comments

Comments
 (0)