File: deb_use_system_joblib

package info (click to toggle)
scikit-learn 0.18-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 71,040 kB
  • ctags: 91,142
  • sloc: python: 97,257; ansic: 8,360; cpp: 5,649; makefile: 242; sh: 238
file content (32 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Yaroslav Halchenko <debian@onerussian.com>
Subject: use system-wide joblib and do not attempt to install joblib/test

 Relies on DFSG-ed sources with no joblib present

--- /dev/null
+++ b/sklearn/externals/joblib/__init__.py
@@ -0,0 +1,4 @@
+# yoh: use system-wide joblib
+# replace local name space with the one from system-wide joblib
+import joblib
+locals().update(joblib.__dict__)
--- a/sklearn/metrics/pairwise.py
+++ b/sklearn/metrics/pairwise.py
@@ -24,7 +24,7 @@ from ..utils.extmath import row_norms, s
 from ..preprocessing import normalize
 from ..externals.joblib import Parallel
 from ..externals.joblib import delayed
-from ..externals.joblib.parallel import cpu_count
+from ..externals.joblib import parallel
 
 from .pairwise_fast import _chi2_kernel_fast, _sparse_manhattan
 
@@ -1068,7 +1068,7 @@ def _parallel_pairwise(X, Y, func, n_job
     """Break the pairwise matrix in n_jobs even slices
     and compute them in parallel"""
     if n_jobs < 0:
-        n_jobs = max(cpu_count() + 1 + n_jobs, 1)
+        n_jobs = max(parallel.cpu_count() + 1 + n_jobs, 1)
 
     if Y is None:
         Y = X