9
9
10
10
import os
11
11
12
- from .pkg_info import __version__
13
12
from .info import long_description as __doc__
13
+ from .pkg_info import __version__
14
+
14
15
__doc__ += """
15
16
Quickstart
16
17
==========
38
39
39
40
# module imports
40
41
from . import analyze as ana
41
- from . import spm99analyze as spm99
42
- from . import spm2analyze as spm2
42
+ from . import ecat , mriutils
43
43
from . import nifti1 as ni1
44
- from . import ecat
44
+ from . import spm2analyze as spm2
45
+ from . import spm99analyze as spm99
46
+ from . import streamlines , viewers
47
+
48
+ # isort: split
49
+
45
50
# object imports
46
- from .fileholders import FileHolder , FileHolderError
47
- from .loadsave import load , save
48
- from .arrayproxy import is_proxy
49
51
from .analyze import AnalyzeHeader , AnalyzeImage
50
- from .spm99analyze import Spm99AnalyzeHeader , Spm99AnalyzeImage
51
- from .spm2analyze import Spm2AnalyzeHeader , Spm2AnalyzeImage
52
- from .nifti1 import Nifti1Header , Nifti1Image , Nifti1Pair
53
- from .nifti2 import Nifti2Header , Nifti2Image , Nifti2Pair
54
- from .minc1 import Minc1Image
55
- from .minc2 import Minc2Image
52
+ from .arrayproxy import is_proxy
56
53
from .cifti2 import Cifti2Header , Cifti2Image
57
- from .gifti import GiftiImage
54
+ from .fileholders import FileHolder , FileHolderError
58
55
from .freesurfer import MGHImage
59
- from .funcs import (squeeze_image , concat_images , four_to_three ,
60
- as_closest_canonical )
61
- from .orientations import (io_orientation , flip_axis , OrientationError ,
62
- apply_orientation , aff2axcodes )
56
+ from .funcs import as_closest_canonical , concat_images , four_to_three , squeeze_image
57
+ from .gifti import GiftiImage
63
58
from .imageclasses import all_image_classes
64
- from . import mriutils
65
- from . import streamlines
66
- from . import viewers
59
+ from .loadsave import load , save
60
+ from .minc1 import Minc1Image
61
+ from .minc2 import Minc2Image
62
+ from .nifti1 import Nifti1Header , Nifti1Image , Nifti1Pair
63
+ from .nifti2 import Nifti2Header , Nifti2Image , Nifti2Pair
64
+ from .orientations import (
65
+ OrientationError ,
66
+ aff2axcodes ,
67
+ apply_orientation ,
68
+ flip_axis ,
69
+ io_orientation ,
70
+ )
71
+ from .spm2analyze import Spm2AnalyzeHeader , Spm2AnalyzeImage
72
+ from .spm99analyze import Spm99AnalyzeHeader , Spm99AnalyzeImage
73
+
74
+ # isort: split
67
75
68
76
from .pkg_info import get_pkg_info as _get_pkg_info
69
77
@@ -72,9 +80,15 @@ def get_info():
72
80
return _get_pkg_info (os .path .dirname (__file__ ))
73
81
74
82
75
- def test (label = None , verbose = 1 , extra_argv = None ,
76
- doctests = False , coverage = False , raise_warnings = None ,
77
- timer = False ):
83
+ def test (
84
+ label = None ,
85
+ verbose = 1 ,
86
+ extra_argv = None ,
87
+ doctests = False ,
88
+ coverage = False ,
89
+ raise_warnings = None ,
90
+ timer = False ,
91
+ ):
78
92
"""
79
93
Run tests for nibabel using pytest
80
94
@@ -107,29 +121,30 @@ def test(label=None, verbose=1, extra_argv=None,
107
121
Returns the result of running the tests as a ``pytest.ExitCode`` enum
108
122
"""
109
123
import pytest
124
+
110
125
args = []
111
126
112
127
if label is not None :
113
- raise NotImplementedError (" Labels cannot be set at present" )
128
+ raise NotImplementedError (' Labels cannot be set at present' )
114
129
115
130
verbose = int (verbose )
116
131
if verbose > 0 :
117
- args .append ("-" + "v" * verbose )
132
+ args .append ('-' + 'v' * verbose )
118
133
elif verbose < 0 :
119
- args .append ("-" + "q" * - verbose )
134
+ args .append ('-' + 'q' * - verbose )
120
135
121
136
if extra_argv :
122
137
args .extend (extra_argv )
123
138
if doctests :
124
- args .append (" --doctest-modules" )
139
+ args .append (' --doctest-modules' )
125
140
if coverage :
126
- args .extend ([" --cov" , " nibabel" ])
141
+ args .extend ([' --cov' , ' nibabel' ])
127
142
if raise_warnings is not None :
128
- raise NotImplementedError (" Warning filters are not implemented" )
143
+ raise NotImplementedError (' Warning filters are not implemented' )
129
144
if timer :
130
- raise NotImplementedError (" Timing is not implemented" )
145
+ raise NotImplementedError (' Timing is not implemented' )
131
146
132
- args .extend ([" --pyargs" , " nibabel" ])
147
+ args .extend ([' --pyargs' , ' nibabel' ])
133
148
134
149
return pytest .main (args = args )
135
150
@@ -157,9 +172,10 @@ def bench(label=None, verbose=1, extra_argv=None):
157
172
Returns the result of running the tests as a ``pytest.ExitCode`` enum
158
173
"""
159
174
from pkg_resources import resource_filename
160
- config = resource_filename ("nibabel" , "benchmarks/pytest.benchmark.ini" )
175
+
176
+ config = resource_filename ('nibabel' , 'benchmarks/pytest.benchmark.ini' )
161
177
args = []
162
178
if extra_argv is not None :
163
179
args .extend (extra_argv )
164
- args .extend (["-c" , config ])
180
+ args .extend (['-c' , config ])
165
181
return test (label , verbose , extra_argv = args )
0 commit comments