Skip to content

Commit 6a9db13

Browse files
GaelVaroquauxlarsmans
authored andcommitted
MAINT: update joblib to latest release 0.8.3
1 parent ae7e147 commit 6a9db13

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

sklearn/externals/joblib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
101101
"""
102102

103-
__version__ = '0.8.2'
103+
__version__ = '0.8.3'
104104

105105

106106
from .memory import Memory, MemorizedResult

sklearn/externals/joblib/parallel.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,21 @@ def __call__(self, *args, **kwargs):
103103

104104

105105
###############################################################################
106-
def delayed(function):
107-
""" Decorator used to capture the arguments of a function.
106+
def delayed(function, check_pickle=True):
107+
"""Decorator used to capture the arguments of a function.
108+
109+
Pass `check_pickle=False` when:
110+
111+
- performing a possibly repeated check is too costly and has been done
112+
already once outside of the call to delayed.
113+
114+
- when used in conjunction `Parallel(backend='threading')`.
115+
108116
"""
109117
# Try to pickle the input function, to catch the problems early when
110-
# using with multiprocessing
111-
pickle.dumps(function)
118+
# using with multiprocessing:
119+
if check_pickle:
120+
pickle.dumps(function)
112121

113122
def delayed_function(*args, **kwargs):
114123
return function, args, kwargs
@@ -519,7 +528,7 @@ def retrieve(self):
519528
# Capture exception to add information on the local
520529
# stack in addition to the distant stack
521530
this_report = format_outer_frames(context=10,
522-
stack_start=1)
531+
stack_start=1)
523532
report = """Multiprocessing exception:
524533
%s
525534
---------------------------------------------------------------------------

sklearn/externals/joblib/pool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ def __call__(self, a):
200200
# a is already backed by a memmap file, let's reuse it directly
201201
return _reduce_memmap_backed(a, m)
202202

203-
if self._max_nbytes is not None and a.nbytes > self._max_nbytes:
203+
if (not a.dtype.hasobject
204+
and self._max_nbytes is not None
205+
and a.nbytes > self._max_nbytes):
204206
# check that the folder exists (lazily create the pool temp folder
205207
# if required)
206208
try:

0 commit comments

Comments
 (0)