summaryrefslogtreecommitdiff
path: root/src/python/gudhi/wasserstein.py
diff options
context:
space:
mode:
authorVincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com>2020-01-13 17:37:06 +0100
committerGitHub <noreply@github.com>2020-01-13 17:37:06 +0100
commitc5ab277ebe1a0ce032567d4ca47e487f356705f3 (patch)
treedbc2fe07ab896fa2759543aecf1903fefe6cba9b /src/python/gudhi/wasserstein.py
parentff0a45b711288e788088a1db810e50178086f2d8 (diff)
parent8f5cb043bf78b8f008b67e292668543a899e6795 (diff)
Merge pull request #197 from VincentRouvreau/python_import_reorder
Fix #144 : Reorder import and docstrings. Modify test_representations
Diffstat (limited to 'src/python/gudhi/wasserstein.py')
-rw-r--r--src/python/gudhi/wasserstein.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/python/gudhi/wasserstein.py b/src/python/gudhi/wasserstein.py
index d8a3104c..1906eeb1 100644
--- a/src/python/gudhi/wasserstein.py
+++ b/src/python/gudhi/wasserstein.py
@@ -1,10 +1,3 @@
-import numpy as np
-import scipy.spatial.distance as sc
-try:
- import ot
-except ImportError:
- print("POT (Python Optimal Transport) package is not installed. Try to run $ conda install -c conda-forge pot ; or $ pip install POT")
-
# This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
# See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
# Author(s): Theo Lacombe
@@ -14,6 +7,13 @@ except ImportError:
# Modification(s):
# - YYYY/MM Author: Description of the modification
+import numpy as np
+import scipy.spatial.distance as sc
+try:
+ import ot
+except ImportError:
+ print("POT (Python Optimal Transport) package is not installed. Try to run $ conda install -c conda-forge pot ; or $ pip install POT")
+
def _proj_on_diag(X):
'''
:param X: (n x 2) array encoding the points of a persistent diagram.