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 33 34 35 36 37 38 39 40
|
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
--- a/sklearn/externals/setup.py
+++ b/sklearn/externals/setup.py
@@ -5,6 +5,5 @@ def configuration(parent_package='', top
from numpy.distutils.misc_util import Configuration
config = Configuration('externals', parent_package, top_path)
config.add_subpackage('joblib')
- config.add_subpackage('joblib/test')
return config
--- /dev/null
+++ b/sklearn/externals/joblib/__init__.py
@@ -0,0 +1,3 @@
+# yoh: use system-wide joblib
+
+from joblib import *
--- a/sklearn/metrics/pairwise.py
+++ b/sklearn/metrics/pairwise.py
@@ -46,7 +46,7 @@ from ..utils import gen_even_slices
from ..utils.extmath import safe_sparse_dot
from ..externals.joblib import Parallel
from ..externals.joblib import delayed
-from ..externals.joblib.parallel import cpu_count
+from ..externals.joblib import parallel
# Utility Functions
@@ -392,7 +392,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
|