use system-wide joblib and do not attempt to install joblib/test
authorYaroslav Halchenko <debian@onerussian.com>
Tue, 22 Nov 2016 15:34:29 +0000 (15:34 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Tue, 22 Nov 2016 15:34:29 +0000 (15:34 +0000)
 Relies on DFSG-ed sources with no joblib present

Gbp-Pq: Name deb_use_system_joblib

sklearn/externals/joblib/__init__.py [new file with mode: 0644]
sklearn/metrics/pairwise.py

diff --git a/sklearn/externals/joblib/__init__.py b/sklearn/externals/joblib/__init__.py
new file mode 100644 (file)
index 0000000..305b2d4
--- /dev/null
@@ -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__)
index c058e20967291171d6b6940d287e62b26e52b83d..6c9fb1a3aa6d8e6a7f7f750fb76b68885afec487 100644 (file)
@@ -24,7 +24,7 @@ from ..utils.extmath import row_norms, safe_sparse_dot
 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_jobs, **kwds):
     """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