Repository: joblib/joblib

Issue:
Memory object does not have a cachedir attribute in master
Seems like an oversight from #397. The doc says that cachedir is deprecated but actually it is not set:
https://github.com/joblib/joblib/blob/a0e1f69d2be31e9e6be1f5e346988bc04df7ff75/joblib/memory.py#L778-L783

It'd be a good idea to double-check that other similar things have not been overseen.

Snippet:
```python
from joblib import Memory

mem = Memory('/tmp/test')
print(mem.cachedir)
```



Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/joblib/joblib/pull/639?src=pr&el=h1) Report
> Merging [#639](https://codecov.io/gh/joblib/joblib/pull/639?src=pr&el=desc) into [master](https://codecov.io/gh/joblib/joblib/commit/a0e1f69d2be31e9e6be1f5e346988bc04df7ff75?src=pr&el=desc) will **increase** coverage by `0.44%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/joblib/joblib/pull/639/graphs/tree.svg?height=150&width=650&token=gA6LF5DGTW&src=pr)](https://codecov.io/gh/joblib/joblib/pull/639?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #639      +/-   ##
==========================================
+ Coverage   94.52%   94.96%   +0.44%     
==========================================
  Files          39       39              
  Lines        5403     5407       +4     
==========================================
+ Hits         5107     5135      +28     
+ Misses        296      272      -24
```


| [Impacted Files](https://codecov.io/gh/joblib/joblib/pull/639?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [joblib/memory.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL21lbW9yeS5weQ==) | `94.98% <100%> (+0.02%)` | :arrow_up: |
| [joblib/test/test\_memory.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL3Rlc3QvdGVzdF9tZW1vcnkucHk=) | `98.14% <100%> (ø)` | :arrow_up: |
| [joblib/test/test\_parallel.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL3Rlc3QvdGVzdF9wYXJhbGxlbC5weQ==) | `96.27% <0%> (+0.35%)` | :arrow_up: |
| [joblib/\_parallel\_backends.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL19wYXJhbGxlbF9iYWNrZW5kcy5weQ==) | `94.39% <0%> (+0.43%)` | :arrow_up: |
| [joblib/numpy\_pickle\_utils.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL251bXB5X3BpY2tsZV91dGlscy5weQ==) | `93.29% <0%> (+0.63%)` | :arrow_up: |
| [joblib/hashing.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL2hhc2hpbmcucHk=) | `92.98% <0%> (+0.87%)` | :arrow_up: |
| [joblib/\_memmapping\_reducer.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL19tZW1tYXBwaW5nX3JlZHVjZXIucHk=) | `95% <0%> (+1.11%)` | :arrow_up: |
| [joblib/logger.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL2xvZ2dlci5weQ==) | `86.84% <0%> (+1.31%)` | :arrow_up: |
| [joblib/numpy\_pickle.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL251bXB5X3BpY2tsZS5weQ==) | `98.47% <0%> (+2.03%)` | :arrow_up: |
| [joblib/pool.py](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree#diff-am9ibGliL3Bvb2wucHk=) | `91.37% <0%> (+2.58%)` | :arrow_up: |
| ... and [2 more](https://codecov.io/gh/joblib/joblib/pull/639/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/joblib/joblib/pull/639?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/joblib/joblib/pull/639?src=pr&el=footer). Last update [a0e1f69...4f88f5a](https://codecov.io/gh/joblib/joblib/pull/639?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

lesteve: Merging, thanks a lot @aabadie!

Patch:
diff --git a/joblib/memory.py b/joblib/memory.py
index 0f005dd..18b20f5 100644
--- a/joblib/memory.py
+++ b/joblib/memory.py
@@ -767,7 +767,7 @@ class Memory(Logger):
                 The path of the base directory to use as a data store
                 or None. If None is given, no caching is done and
                 the Memory object is completely transparent. This option
-                replaces cachedir since version 0.11.
+                replaces cachedir since version 0.12.
 
             backend: str or 'local'
                 Type of store backend for reading/writing cache files.
@@ -776,8 +776,8 @@ class Memory(Logger):
                 backend.
 
             cachedir: str or None
-                cachedir is deprecated since version 0.11 and will be
-                removed in 0.13. Please consider using location option instead.
+                cachedir is deprecated since version 0.12 and will be
+                removed in 0.14. Please consider using location option instead.
                 The path of the base directory to use as a data store
                 or None. If None is given, no caching is done and
                 the Memory object is completely transparent.
@@ -818,17 +818,18 @@ class Memory(Logger):
         if cachedir is not None:
             if location is None:
                 warnings.warn("cachedir option is deprecated since version "
-                              "0.10 and will be removed after version 0.12.\n"
+                              "0.12 and will be removed in version 0.14.\n"
                               "Use option location=<store location> "
                               "instead.", DeprecationWarning, stacklevel=2)
                 location = cachedir
             else:
                 warnings.warn("You set both location and cachedir options."
                               "cachedir is deprecated since version "
-                              "0.10 and will be removed after version 0.12.\n"
+                              "0.12 and will be removed in version 0.14.\n"
                               "cachedir value will be ignored.",
                               DeprecationWarning, stacklevel=2)
 
+        self.location = location
         if isinstance(location, _basestring):
             location = os.path.join(location, 'joblib')
 
@@ -837,6 +838,14 @@ class Memory(Logger):
             backend_options=dict(compress=compress, mmap_mode=mmap_mode,
                                  **backend_options))
 
+    @property
+    def cachedir(self):
+        warnings.warn("cachedir option is deprecated since version "
+                      "0.12 and will be removed in version 0.14.\n"
+                      "Use option location=<store location> "
+                      "instead.", DeprecationWarning, stacklevel=2)
+        return self.location
+
     def cache(self, func=None, ignore=None, verbose=None, mmap_mode=False):
         """ Decorates the given function func to only compute its return
             value for input arguments not cached on disk.


Test patch:
diff --git a/joblib/test/test_memory.py b/joblib/test/test_memory.py
index 7d74506..00f384c 100644
--- a/joblib/test/test_memory.py
+++ b/joblib/test/test_memory.py
@@ -383,6 +383,11 @@ def test_func_dir(tmpdir):
     location = os.path.join(g.store_backend.location, func_id)
     assert location == path
     assert os.path.exists(path)
+    assert memory.location == os.path.dirname(g.store_backend.location)
+    with warns(DeprecationWarning) as w:
+        assert memory.cachedir == os.path.dirname(g.store_backend.location)
+    assert len(w) == 1
+    assert "cachedir option is deprecated since version" in str(w[-1].message)
 
     # Test that the code is stored.
     # For the following test to be robust to previous execution, we clear