From e433775c2015eb85c2683b6955618c2836f001bc Mon Sep 17 00:00:00 2001 From: Nathan Cassereau <84033440+ncassereau-idris@users.noreply.github.com> Date: Tue, 27 Sep 2022 15:17:53 +0200 Subject: [MRG] Crash when computing weightless Hamming distance & Doc build (#402) * Bug solve * Releases.md updated * pep8 * attempt to solve docs building bug * releases.md --- ot/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ot') diff --git a/ot/utils.py b/ot/utils.py index 57fb4a4..e3437da 100644 --- a/ot/utils.py +++ b/ot/utils.py @@ -234,7 +234,9 @@ def dist(x1, x2=None, metric='sqeuclidean', p=2, w=None): else: if isinstance(metric, str) and metric.endswith("minkowski"): return cdist(x1, x2, metric=metric, p=p, w=w) - return cdist(x1, x2, metric=metric, w=w) + if w is not None: + return cdist(x1, x2, metric=metric, w=w) + return cdist(x1, x2, metric=metric) def dist0(n, method='lin_square'): -- cgit v1.2.3