8000 [MRG+1] FIX hotfix for joblib#741 by jnothman · Pull Request #11837 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG+1] FIX hotfix for joblib#741 #11837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions sklearn/externals/joblib/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,9 @@ def __reduce__(self):
depending from it.
In addition, when unpickling, we run the __init__
"""
return (self.__class__, (self.func, self.store_backend, self.ignore,
self.mmap_mode, self.compress, self._verbose))
return (self.__class__, (self.func, None),
{k: v for k, v in vars(self).items()
if k not in ('timestamp', 'func')})

# ------------------------------------------------------------------------
# Private interface
Expand Down Expand Up @@ -775,12 +776,6 @@ class Memory(Logger):
The 'local' backend is using regular filesystem operations to
manipulate data (open, mv, etc) in the backend.

cachedir: str or None, optional

.. deprecated: 0.12
'cachedir' has been deprecated in 0.12 and will be
removed in 0.14. Use the 'location' parameter instead.

mmap_mode: {None, 'r+', 'r', 'w+', 'c'}, optional
The memmapping mode used when loading from cache
numpy arrays. See numpy.load for the meaning of the
Expand All @@ -802,14 +797,20 @@ class Memory(Logger):
backend_options: dict, optional
Contains a dictionnary of named parameters used to configure
the store backend.

cachedir: str or None, optional

.. deprecated: 0.12
'cachedir' has been deprecated in 0.12 and will be
removed in 0.14. Use the 'location' parameter instead.
"""
# ------------------------------------------------------------------------
# Public interface
# ------------------------------------------------------------------------

def __init__(self, location=None, backend='local', cachedir=None,
mmap_mode=None, compress=False, verbose=1, bytes_limit=None,
backend_options={}):
def __init__(self, location=None, backend='local', mmap_mode=None,
compress=False, verbose=1, bytes_limit=None,
backend_options={}, cachedir=None):
# XXX: Bad explanation of the None value of cachedir
Logger.__init__(self)
self._verbose = verbose
Expand Down Expand Up @@ -940,10 +941,5 @@ def __reduce__(self):
depending from it.
In addition, when unpickling, we run the __init__
"""
# We need to remove 'joblib' from the end of cachedir
location = (repr(self.store_backend)[:-7]
if self.store_backend is not None else None)
compress = self.store_backend.compress \
if self.store_backend is not None else False
return (self.__class__, (location, self.backend, self.mmap_mode,
compress, self._verbose))
return (self.__class__, (), {k: v for k, v in vars(self).items()
if k != 'timestamp'})
0