summaryrefslogtreecommitdiff
path: root/ot
diff options
context:
space:
mode:
authorNathan Cassereau <84033440+ncassereau-idris@users.noreply.github.com>2022-09-27 15:17:53 +0200
committerGitHub <noreply@github.com>2022-09-27 15:17:53 +0200
commite433775c2015eb85c2683b6955618c2836f001bc (patch)
tree2f0f950efeeed87cad27301a3852a6272550ad7f /ot
parentb295ffccc95149c1d63e805e1ca6f027a4071e2a (diff)
[MRG] Crash when computing weightless Hamming distance & Doc build (#402)
* Bug solve * Releases.md updated * pep8 * attempt to solve docs building bug * releases.md
Diffstat (limited to 'ot')
-rw-r--r--ot/utils.py4
1 files changed, 3 insertions, 1 deletions
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'):