File tree Expand file tree Collapse file tree 4 files changed +7
-10
lines changed Expand file tree Collapse file tree 4 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 8
8
9
9
10
10
def get_nibabel_data ():
11
- """ Return path to nibabel-data or None if missing
11
+ """ Return path to nibabel-data or empty string if missing
12
12
13
13
First use ``NIBABEL_DATA_DIR`` environment variable.
14
14
@@ -20,7 +20,7 @@ def get_nibabel_data():
20
20
mod = __import__ ('nibabel' )
21
21
containing_path = dirname (dirname (realpath (mod .__file__ )))
22
22
nibabel_data = pjoin (containing_path , 'nibabel-data' )
23
- return nibabel_data if isdir (nibabel_data ) else None
23
+ return nibabel_data if isdir (nibabel_data ) else ''
24
24
25
25
26
26
def needs_nibabel_data (subdir = None ):
@@ -38,7 +38,7 @@ def needs_nibabel_data(subdir = None):
38
38
Decorator skipping tests if required directory not present
39
39
"""
40
40
nibabel_data = get_nibabel_data ()
41
- if nibabel_data is None :
41
+ if nibabel_data == '' :
42
42
return skipif (True , "Need nibabel-data directory for this test" )
43
43
if subdir is None :
44
44
return skipif (False )
Original file line number Diff line number Diff line change 25
25
from nose .tools import assert_equal
26
26
from numpy .testing import (assert_array_equal , assert_almost_equal )
27
27
28
- NIBABEL_DATA = get_nibabel_data ()
29
- if NIBABEL_DATA is not None :
30
- MINC2_PATH = pjoin (NIBABEL_DATA , 'nitest-minc2' )
28
+ MINC2_PATH = pjoin (get_nibabel_data (), 'nitest-minc2' )
31
29
32
30
33
31
def _make_affine (coses , zooms , starts ):
Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ def test_get_nibabel_data():
25
25
if isdir (local_data ):
26
26
assert_equal (nibd .get_nibabel_data (), local_data )
27
27
else :
28
- assert_equal (nibd .get_nibabel_data (), None )
28
+ assert_equal (nibd .get_nibabel_data (), '' )
29
29
nibd .environ ['NIBABEL_DATA_DIR' ] = 'not_a_path'
30
- assert_equal (nibd .get_nibabel_data (), None )
30
+ assert_equal (nibd .get_nibabel_data (), '' )
31
31
nibd .environ ['NIBABEL_DATA_DIR' ] = MY_DIR
32
32
assert_equal (nibd .get_nibabel_data (), MY_DIR )
Original file line number Diff line number Diff line change 17
17
18
18
from numpy .testing import assert_almost_equal
19
19
20
- NIBABEL_DATA = get_nibabel_data ()
21
- BALLS = None if NIBABEL_DATA is None else pjoin (NIBABEL_DATA , 'nitest-balls1' )
20
+ BALLS = pjoin (get_nibabel_data (), 'nitest-balls1' )
22
21
23
22
# Amount by which affine translation differs from NIFTI conversion
24
23
AFF_OFF = [- 0.93644031 , - 0.95572686 , 0.03288748 ]
You can’t perform that action at this time.
0 commit comments