aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-biology/nilearn/files/0.4.1-bundled_joblib_test.patch')
-rwxr-xr-xsci-biology/nilearn/files/0.4.1-bundled_joblib_test.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/sci-biology/nilearn/files/0.4.1-bundled_joblib_test.patch b/sci-biology/nilearn/files/0.4.1-bundled_joblib_test.patch
new file mode 100755
index 000000000..e229d25fb
--- /dev/null
+++ b/sci-biology/nilearn/files/0.4.1-bundled_joblib_test.patch
@@ -0,0 +1,39 @@
+--- a/nilearn/input_data/tests/test_nifti_masker.py 2018-08-02 18:57:07.700111595 +0200
++++ b/nilearn/input_data/tests/test_nifti_masker.py 2018-08-02 18:57:29.453556439 +0200
+@@ -219,36 +219,6 @@
+ assert_raises(ValueError, masker.fit_transform, data_img)
+
+
+-def test_joblib_cache():
+- from sklearn.externals.joblib import hash, Memory
+- mask = np.zeros((40, 40, 40))
+- mask[20, 20, 20] = 1
+- mask_img = Nifti1Image(mask, np.eye(4))
+-
+- with testing.write_tmp_imgs(mask_img, create_files=True) as filename:
+- masker = NiftiMasker(mask_img=filename)
+- masker.fit()
+- mask_hash = hash(masker.mask_img_)
+- masker.mask_img_.get_data()
+- assert_true(mask_hash == hash(masker.mask_img_))
+-
+- # Test a tricky issue with memmapped joblib.memory that makes
+- # imgs return by inverse_transform impossible to save
+- cachedir = mkdtemp()
+- try:
+- masker.memory = Memory(cachedir=cachedir, mmap_mode='r',
+- verbose=0)
+- X = masker.transform(mask_img)
+- # inverse_transform a first time, so that the result is cached
+- out_img = masker.inverse_transform(X)
+- out_img = masker.inverse_transform(X)
+- out_img.to_filename(os.path.join(cachedir, 'test.nii'))
+- finally:
+- # enables to delete "filename" on windows
+- del masker
+- shutil.rmtree(cachedir, ignore_errors=True)
+-
+-
+ def test_mask_init_errors():
+ # Errors that are caught in init
+ mask = NiftiMasker(mask_strategy='oops')