File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 13
13
import os
14
14
import sys
15
15
import warnings
16
+ from pkg_resources import resource_filename
16
17
from os .path import dirname , abspath , join as pjoin
17
18
18
19
import numpy as np
32
33
33
34
from six .moves import zip_longest
34
35
36
+
37
+ def test_data (subdir = None , fname = None ):
38
+ if subdir is None :
39
+ resource = 'tests/data'
40
+ elif subdir in ('gifti' , 'nicom' , 'externals' ):
41
+ resource = '%s/tests/data' % subdir
42
+ else :
43
+ raise ValueError ("Unknown test data directory: %s" % subdir )
44
+
45
+ if fname is not None :
46
+ resource = os .path .join (resource , fname )
47
+
48
+ return resource_filename ('nibabel' , resource )
49
+
50
+
35
51
# set path to example data
36
- data_path = abspath ( pjoin ( dirname ( __file__ ), '..' , 'tests' , 'data' ) )
52
+ data_path = test_data ( )
37
53
38
54
39
55
from .np_features import memmap_after_ufunc
You can’t perform that action at this time.
0 commit comments