Gentoo Archives: gentoo-commits

From: Horea Christian <horea.christ@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-biology/nilearn/files/, sci-biology/nilearn/
Date: Thu, 02 Aug 2018 21:50:21
Message-Id: 1533246608.1a9e315ab7a9046ddcb0569a57bb888e2fec3093.chymera@gentoo
1 commit: 1a9e315ab7a9046ddcb0569a57bb888e2fec3093
2 Author: Horea Christian <horea.christ <AT> yandex <DOT> com>
3 AuthorDate: Thu Aug 2 21:50:08 2018 +0000
4 Commit: Horea Christian <horea.christ <AT> gmail <DOT> com>
5 CommitDate: Thu Aug 2 21:50:08 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=1a9e315a
7
8 sci-biology/nilearn: fixed tests
9
10 Package-Manager: Portage-2.3.44, Repoman-2.3.10
11
12 .../nilearn/files/0.4.1-bundled_joblib_test.patch | 39 ++++++++++++++++++++++
13 sci-biology/nilearn/nilearn-0.4.1.ebuild | 6 ++--
14 sci-biology/nilearn/nilearn-0.4.2.ebuild | 6 ++--
15 sci-biology/nilearn/nilearn-9999.ebuild | 6 ++--
16 4 files changed, 51 insertions(+), 6 deletions(-)
17
18 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
19 new file mode 100755
20 index 000000000..e229d25fb
21 --- /dev/null
22 +++ b/sci-biology/nilearn/files/0.4.1-bundled_joblib_test.patch
23 @@ -0,0 +1,39 @@
24 +--- a/nilearn/input_data/tests/test_nifti_masker.py 2018-08-02 18:57:07.700111595 +0200
25 ++++ b/nilearn/input_data/tests/test_nifti_masker.py 2018-08-02 18:57:29.453556439 +0200
26 +@@ -219,36 +219,6 @@
27 + assert_raises(ValueError, masker.fit_transform, data_img)
28 +
29 +
30 +-def test_joblib_cache():
31 +- from sklearn.externals.joblib import hash, Memory
32 +- mask = np.zeros((40, 40, 40))
33 +- mask[20, 20, 20] = 1
34 +- mask_img = Nifti1Image(mask, np.eye(4))
35 +-
36 +- with testing.write_tmp_imgs(mask_img, create_files=True) as filename:
37 +- masker = NiftiMasker(mask_img=filename)
38 +- masker.fit()
39 +- mask_hash = hash(masker.mask_img_)
40 +- masker.mask_img_.get_data()
41 +- assert_true(mask_hash == hash(masker.mask_img_))
42 +-
43 +- # Test a tricky issue with memmapped joblib.memory that makes
44 +- # imgs return by inverse_transform impossible to save
45 +- cachedir = mkdtemp()
46 +- try:
47 +- masker.memory = Memory(cachedir=cachedir, mmap_mode='r',
48 +- verbose=0)
49 +- X = masker.transform(mask_img)
50 +- # inverse_transform a first time, so that the result is cached
51 +- out_img = masker.inverse_transform(X)
52 +- out_img = masker.inverse_transform(X)
53 +- out_img.to_filename(os.path.join(cachedir, 'test.nii'))
54 +- finally:
55 +- # enables to delete "filename" on windows
56 +- del masker
57 +- shutil.rmtree(cachedir, ignore_errors=True)
58 +-
59 +-
60 + def test_mask_init_errors():
61 + # Errors that are caught in init
62 + mask = NiftiMasker(mask_strategy='oops')
63
64 diff --git a/sci-biology/nilearn/nilearn-0.4.1.ebuild b/sci-biology/nilearn/nilearn-0.4.1.ebuild
65 index 87226eec3..80d3e2910 100644
66 --- a/sci-biology/nilearn/nilearn-0.4.1.ebuild
67 +++ b/sci-biology/nilearn/nilearn-0.4.1.ebuild
68 @@ -31,9 +31,11 @@ RDEPEND="
69 sci-libs/nibabel[${PYTHON_USEDEP}]
70 plot? ( dev-python/matplotlib[${PYTHON_USEDEP}] )"
71
72 -# upstream is reluctant to *not* depend on bundled scikits_learn:
73 -# https://github.com/nilearn/nilearn/pull/1398
74 +PATCHES=( "${FILESDIR}/${PV}-bundled_joblib_test.patch" )
75 +
76 python_prepare_all() {
77 + # upstream is reluctant to *not* depend on bundled scikits_learn:
78 + # https://github.com/nilearn/nilearn/pull/1398
79 local f
80 for f in nilearn/{*/*/,*/,}*.py; do
81 sed -r \
82
83 diff --git a/sci-biology/nilearn/nilearn-0.4.2.ebuild b/sci-biology/nilearn/nilearn-0.4.2.ebuild
84 index 87226eec3..4b4d429bb 100644
85 --- a/sci-biology/nilearn/nilearn-0.4.2.ebuild
86 +++ b/sci-biology/nilearn/nilearn-0.4.2.ebuild
87 @@ -31,9 +31,11 @@ RDEPEND="
88 sci-libs/nibabel[${PYTHON_USEDEP}]
89 plot? ( dev-python/matplotlib[${PYTHON_USEDEP}] )"
90
91 -# upstream is reluctant to *not* depend on bundled scikits_learn:
92 -# https://github.com/nilearn/nilearn/pull/1398
93 +PATCHES=( "${FILESDIR}/0.4.1-bundled_joblib_test.patch" )
94 +
95 python_prepare_all() {
96 + # upstream is reluctant to *not* depend on bundled scikits_learn:
97 + # https://github.com/nilearn/nilearn/pull/1398
98 local f
99 for f in nilearn/{*/*/,*/,}*.py; do
100 sed -r \
101
102 diff --git a/sci-biology/nilearn/nilearn-9999.ebuild b/sci-biology/nilearn/nilearn-9999.ebuild
103 index 460dfc74f..345f604b4 100644
104 --- a/sci-biology/nilearn/nilearn-9999.ebuild
105 +++ b/sci-biology/nilearn/nilearn-9999.ebuild
106 @@ -32,9 +32,11 @@ RDEPEND="
107 sci-libs/nibabel[${PYTHON_USEDEP}]
108 plot? ( dev-python/matplotlib[${PYTHON_USEDEP}] )"
109
110 -# upstream is reluctant to *not* depend on bundled scikits_learn:
111 -# https://github.com/nilearn/nilearn/pull/1398
112 +PATCHES=( "${FILESDIR}/0.4.1-bundled_joblib_test.patch" )
113 +
114 python_prepare_all() {
115 + # upstream is reluctant to *not* depend on bundled scikits_learn:
116 + # https://github.com/nilearn/nilearn/pull/1398
117 local f
118 for f in nilearn/{*/*/,*/,}*.py; do
119 sed -r \