10000 FIX hotfix for joblib#741 (#11837) · scikit-learn/scikit-learn@774f1aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 774f1aa

Browse files
jnothmanrth
authored andcommitted
FIX hotfix for joblib#741 (#11837)
1 parent 50d9b0a commit 774f1aa

File tree

1 file changed

+14
- file changed
+14
-18
lines changed

sklearn/externals/joblib/memory.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,9 @@ def __reduce__(self):
515515
depending from it.
516516
In addition, when unpickling, we run the __init__
517517
"""
518-
return (self.__class__, (self.func, self.store_backend, self.ignore,
519-
self.mmap_mode, self.compress, self._verbose))
518+
return (self.__class__, (self.func, None),
519+
{k: v for k, v in vars(self).items()
520+
if k not in ('timestamp', 'func')})
520521

521522
# ------------------------------------------------------------------------
522523
# Private interface
@@ -775,12 +776,6 @@ class Memory(Logger):
775776
The 'local' backend is using regular filesystem operations to
776777
manipulate data (open, mv, etc) in the backend.
777778
778-
cachedir: str or None, optional
779-
780-
.. deprecated: 0.12
781-
'cachedir' has been deprecated in 0.12 and will be
782-
removed in 0.14. Use the 'location' parameter instead.
783-
784779
mmap_mode: {None, 'r+', 'r', 'w+', 'c'}, optional
785780
The memmapping mode used when loading from cache
786781
numpy arrays. See numpy.load for the meaning of the
@@ -802,14 +797,20 @@ class Memory(Logger):
802797
backend_options: dict, optional
803798
Contains a dictionnary of named parameters used to configure
804799
the store backend.
800+
801+
cachedir: str or None, optional
802+
803+
.. deprecated: 0.12
804+
'cachedir' has been deprecated in 0.12 and will be
805+
removed in 0.14. Use the 'location' parameter instead.
805806
"""
806807
# ------------------------------------------------------------------------
807808
# Public interface
808809
# ------------------------------------------------------------------------
809810

810-
def __init__(self, location=None, backend='local', cachedir=None,
811-
mmap_mode=None, compress=False, verbose=1, bytes_limit=None,
812-
backend_options={}):
811+
def __init__(self, location=None, backend='local', mmap_mode=None,
812+
compress=False, verbose=1, bytes_limit=None,
813+
backend_options={}, cachedir=None):
813814
# XXX: Bad explanation of the None value of cachedir
814815
Logger.__init__(self)
815816
self._verbose = verbose
@@ -940,10 +941,5 @@ def __reduce__(self):
940941
depending from it.
941942
In addition, when unpickling, we run the __init__
942943
"""
943-
# We need to remove 'joblib' from the end of cachedir
944-
location = (repr(self.store_backend)[:-7]
945-
if self.store_backend is not None else None)
946-
compress = self.store_backend.compress \
947-
if self.store_backend is not None else False
948-
return (self.__class__, (location, self.backend, self.mmap_mode,
949-
compress, self._verbose))
944+
return (self.__class__, (), {k: v for k, v in vars(self).items()
945+
if k != 'timestamp'})

0 commit comments

Comments
 (0)
0