From d829c639923f6866e1917e46ddbde45b513913f3 Mon Sep 17 00:00:00 2001 From: lmcinnes Date: Fri, 16 Sep 2022 14:20:26 +0000 Subject: [PATCH] Use a positional argument for the cachedir/location to support old and new joblib --- docs/basic_hdbscan.rst | 2 +- docs/how_hdbscan_works.rst | 2 +- hdbscan/hdbscan_.py | 6 +++--- hdbscan/robust_single_linkage_.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/basic_hdbscan.rst b/docs/basic_hdbscan.rst index d8326ffb..544e7e40 100644 --- a/docs/basic_hdbscan.rst +++ b/docs/basic_hdbscan.rst @@ -146,7 +146,7 @@ want do some method chaining. .. parsed-literal:: HDBSCAN(algorithm='best', alpha=1.0, approx_min_span_tree=True, - gen_min_span_tree=False, leaf_size=40, memory=Memory(cachedir=None), + gen_min_span_tree=False, leaf_size=40, memory=Memory(None), metric='euclidean', min_cluster_size=5, min_samples=None, p=None) diff --git a/docs/how_hdbscan_works.rst b/docs/how_hdbscan_works.rst index 57d7a4e8..a6049a7f 100644 --- a/docs/how_hdbscan_works.rst +++ b/docs/how_hdbscan_works.rst @@ -71,7 +71,7 @@ library `__ and get to work. .. parsed-literal:: HDBSCAN(algorithm='best', alpha=1.0, approx_min_span_tree=True, - gen_min_span_tree=True, leaf_size=40, memory=Memory(cachedir=None), + gen_min_span_tree=True, leaf_size=40, memory=Memory(None), metric='euclidean', min_cluster_size=5, min_samples=None, p=None) diff --git a/hdbscan/hdbscan_.py b/hdbscan/hdbscan_.py index ca1c6fcb..ce0092d0 100644 --- a/hdbscan/hdbscan_.py +++ b/hdbscan/hdbscan_.py @@ -506,7 +506,7 @@ def hdbscan( p=2, leaf_size=40, algorithm="best", - memory=Memory(cachedir=None, verbose=0), + memory=Memory(None, verbose=0), approx_min_span_tree=True, gen_min_span_tree=False, core_dist_n_jobs=4, @@ -726,7 +726,7 @@ def hdbscan( # Python 2 and 3 compliant string_type checking if isinstance(memory, str): - memory = Memory(cachedir=memory, verbose=0) + memory = Memory(memory, verbose=0) size = X.shape[0] min_samples = min(size - 1, min_samples) @@ -1093,7 +1093,7 @@ def __init__( p=None, algorithm="best", leaf_size=40, - memory=Memory(cachedir=None, verbose=0), + memory=Memory(None, verbose=0), approx_min_span_tree=True, gen_min_span_tree=False, core_dist_n_jobs=4, diff --git a/hdbscan/robust_single_linkage_.py b/hdbscan/robust_single_linkage_.py index c0fb9dd2..5662190e 100644 --- a/hdbscan/robust_single_linkage_.py +++ b/hdbscan/robust_single_linkage_.py @@ -135,7 +135,7 @@ def _rsl_boruvka_balltree(X, k=5, alpha=1.0, def robust_single_linkage(X, cut, k=5, alpha=1.4142135623730951, gamma=5, metric='euclidean', algorithm='best', - memory=Memory(cachedir=None, verbose=0), leaf_size=40, + memory=Memory(None, verbose=0), leaf_size=40, core_dist_n_jobs=4, **kwargs): """Perform robust single linkage clustering from a vector array or distance matrix. @@ -239,7 +239,7 @@ def robust_single_linkage(X, cut, k=5, alpha=1.4142135623730951, X = check_array(X, accept_sparse='csr') if isinstance(memory, str): - memory = Memory(cachedir=memory, verbose=0) + memory = Memory(memory, verbose=0) if algorithm != 'best': if algorithm == 'generic':