From 8f5cb043bf78b8f008b67e292668543a899e6795 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Fri, 10 Jan 2020 19:43:04 +0100 Subject: Reorder import and docstrings. Modify test_representations --- src/python/test/test_alpha_complex.py | 12 ++++++------ src/python/test/test_bottleneck_distance.py | 4 ++-- src/python/test/test_cover_complex.py | 4 ++-- src/python/test/test_cubical_complex.py | 6 +++--- src/python/test/test_euclidean_witness_complex.py | 4 ++-- src/python/test/test_reader_utils.py | 6 +++--- src/python/test/test_representations.py | 15 ++++++++------- src/python/test/test_rips_complex.py | 6 +++--- src/python/test/test_simplex_tree.py | 4 ++-- src/python/test/test_subsampling.py | 4 ++-- src/python/test/test_tangential_complex.py | 4 ++-- src/python/test/test_wasserstein_distance.py | 6 +++--- src/python/test/test_witness_complex.py | 4 ++-- 13 files changed, 40 insertions(+), 39 deletions(-) (limited to 'src/python/test') diff --git a/src/python/test/test_alpha_complex.py b/src/python/test/test_alpha_complex.py index 9b27fff2..712a50b6 100755 --- a/src/python/test/test_alpha_complex.py +++ b/src/python/test/test_alpha_complex.py @@ -1,9 +1,3 @@ -from gudhi import AlphaComplex, SimplexTree -import math -import numpy as np -import itertools -import pytest - """ 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): Vincent Rouvreau @@ -14,6 +8,12 @@ import pytest - YYYY/MM Author: Description of the modification """ +from gudhi import AlphaComplex, SimplexTree +import math +import numpy as np +import itertools +import pytest + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/test/test_bottleneck_distance.py b/src/python/test/test_bottleneck_distance.py index f5f019b9..70b2abad 100755 --- a/src/python/test/test_bottleneck_distance.py +++ b/src/python/test/test_bottleneck_distance.py @@ -1,5 +1,3 @@ -import gudhi - """ 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): Vincent Rouvreau @@ -10,6 +8,8 @@ import gudhi - YYYY/MM Author: Description of the modification """ +import gudhi + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/test/test_cover_complex.py b/src/python/test/test_cover_complex.py index 8cd12272..32bc5a26 100755 --- a/src/python/test/test_cover_complex.py +++ b/src/python/test/test_cover_complex.py @@ -1,5 +1,3 @@ -from gudhi import CoverComplex - """ 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): Vincent Rouvreau @@ -10,6 +8,8 @@ from gudhi import CoverComplex - YYYY/MM Author: Description of the modification """ +from gudhi import CoverComplex + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2018 Inria" __license__ = "MIT" diff --git a/src/python/test/test_cubical_complex.py b/src/python/test/test_cubical_complex.py index 121da12a..8c1b2600 100755 --- a/src/python/test/test_cubical_complex.py +++ b/src/python/test/test_cubical_complex.py @@ -1,6 +1,3 @@ -from gudhi import CubicalComplex, PeriodicCubicalComplex -import numpy as np - """ 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): Vincent Rouvreau @@ -11,6 +8,9 @@ import numpy as np - YYYY/MM Author: Description of the modification """ +from gudhi import CubicalComplex, PeriodicCubicalComplex +import numpy as np + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/test/test_euclidean_witness_complex.py b/src/python/test/test_euclidean_witness_complex.py index f5eae5fa..c18d2484 100755 --- a/src/python/test/test_euclidean_witness_complex.py +++ b/src/python/test/test_euclidean_witness_complex.py @@ -1,5 +1,3 @@ -import gudhi - """ 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): Vincent Rouvreau @@ -10,6 +8,8 @@ import gudhi - YYYY/MM Author: Description of the modification """ +import gudhi + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/test/test_reader_utils.py b/src/python/test/test_reader_utils.py index 4c7b32c2..90da6651 100755 --- a/src/python/test/test_reader_utils.py +++ b/src/python/test/test_reader_utils.py @@ -1,6 +1,3 @@ -import gudhi -import numpy as np - """ 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): Vincent Rouvreau @@ -11,6 +8,9 @@ import numpy as np - YYYY/MM Author: Description of the modification """ +import gudhi +import numpy as np + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2017 Inria" __license__ = "MIT" diff --git a/src/python/test/test_representations.py b/src/python/test/test_representations.py index 4ff65f98..dba7f952 100755 --- a/src/python/test/test_representations.py +++ b/src/python/test/test_representations.py @@ -1,11 +1,12 @@ import os import sys import matplotlib.pyplot as plt -# Disable graphics for testing purposes -plt.show = lambda:None -here = os.path.dirname(os.path.realpath(__file__)) -sys.path.append(here + "/../example") -import diagram_vectorizations_distances_kernels -# pytest is unhappy if there are 0 tests -def test_nothing(): + +def test_representations_examples(): + # Disable graphics for testing purposes + plt.show = lambda:None + here = os.path.dirname(os.path.realpath(__file__)) + sys.path.append(here + "/../example") + import diagram_vectorizations_distances_kernels + return None diff --git a/src/python/test/test_rips_complex.py b/src/python/test/test_rips_complex.py index d55ae22f..b02a68e1 100755 --- a/src/python/test/test_rips_complex.py +++ b/src/python/test/test_rips_complex.py @@ -1,6 +1,3 @@ -from gudhi import RipsComplex -from math import sqrt - """ 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): Vincent Rouvreau @@ -11,6 +8,9 @@ from math import sqrt - YYYY/MM Author: Description of the modification """ +from gudhi import RipsComplex +from math import sqrt + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py index 8d8971c1..1822c43b 100755 --- a/src/python/test/test_simplex_tree.py +++ b/src/python/test/test_simplex_tree.py @@ -1,5 +1,3 @@ -from gudhi import SimplexTree - """ 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): Vincent Rouvreau @@ -10,6 +8,8 @@ from gudhi import SimplexTree - YYYY/MM Author: Description of the modification """ +from gudhi import SimplexTree + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/test/test_subsampling.py b/src/python/test/test_subsampling.py index c816e203..fe0985fa 100755 --- a/src/python/test/test_subsampling.py +++ b/src/python/test/test_subsampling.py @@ -1,5 +1,3 @@ -import gudhi - """ 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): Vincent Rouvreau @@ -10,6 +8,8 @@ import gudhi - YYYY/MM Author: Description of the modification """ +import gudhi + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/test/test_tangential_complex.py b/src/python/test/test_tangential_complex.py index 0f828d8e..e650e99c 100755 --- a/src/python/test/test_tangential_complex.py +++ b/src/python/test/test_tangential_complex.py @@ -1,5 +1,3 @@ -from gudhi import TangentialComplex, SimplexTree - """ 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): Vincent Rouvreau @@ -10,6 +8,8 @@ from gudhi import TangentialComplex, SimplexTree - YYYY/MM Author: Description of the modification """ +from gudhi import TangentialComplex, SimplexTree + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/test/test_wasserstein_distance.py b/src/python/test/test_wasserstein_distance.py index a6bf9901..bb59b3c2 100755 --- a/src/python/test/test_wasserstein_distance.py +++ b/src/python/test/test_wasserstein_distance.py @@ -1,6 +1,3 @@ -from gudhi.wasserstein import wasserstein_distance -import numpy as np - """ 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 @@ -11,6 +8,9 @@ import numpy as np - YYYY/MM Author: Description of the modification """ +from gudhi.wasserstein import wasserstein_distance +import numpy as np + __author__ = "Theo Lacombe" __copyright__ = "Copyright (C) 2019 Inria" __license__ = "MIT" diff --git a/src/python/test/test_witness_complex.py b/src/python/test/test_witness_complex.py index 36ced635..7baf18c9 100755 --- a/src/python/test/test_witness_complex.py +++ b/src/python/test/test_witness_complex.py @@ -1,5 +1,3 @@ -from gudhi import WitnessComplex, StrongWitnessComplex, SimplexTree - """ 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): Vincent Rouvreau @@ -10,6 +8,8 @@ from gudhi import WitnessComplex, StrongWitnessComplex, SimplexTree - YYYY/MM Author: Description of the modification """ +from gudhi import WitnessComplex, StrongWitnessComplex, SimplexTree + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" -- cgit v1.2.3