From b5510c0c362cd2bef79d82fd9809e654aea73957 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Mon, 16 Dec 2019 23:10:24 +0100 Subject: Add numpy ndarray to init a cubical and a periodic one --- src/python/test/test_cubical_complex.py | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'src/python/test/test_cubical_complex.py') diff --git a/src/python/test/test_cubical_complex.py b/src/python/test/test_cubical_complex.py index 68f54fbe..a37d7821 100755 --- a/src/python/test/test_cubical_complex.py +++ b/src/python/test/test_cubical_complex.py @@ -1,4 +1,5 @@ from gudhi import CubicalComplex +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. @@ -56,7 +57,7 @@ def test_dimension_or_perseus_file_constructor(): assert cub.__is_persistence_defined() == False -def test_dimension_simple_constructor(): +def simple_constructor(cub): cub = CubicalComplex( dimensions=[3, 3], top_dimensional_cells=[1, 2, 3, 4, 5, 6, 7, 8, 9] ) @@ -67,12 +68,22 @@ def test_dimension_simple_constructor(): assert cub.betti_numbers() == [1, 0, 0] assert cub.persistent_betti_numbers(0, 1000) == [0, 0, 0] - -def test_user_case_simple_constructor(): +def test_simple_constructor_from_top_cells(): cub = CubicalComplex( dimensions=[3, 3], - top_dimensional_cells=[float("inf"), 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0], + top_dimensional_cells=[1, 2, 3, 4, 5, 6, 7, 8, 9], ) + simple_constructor(cub) + +def test_simple_constructor_from_numpy_array(): + cub = CubicalComplex( + numpy_array=np.array([[1, 2, 3], + [4, 5, 6], + [7, 8, 9]]) + ) + simple_constructor(cub) + +def user_case_simple_constructor(cub): assert cub.__is_defined() == True assert cub.__is_persistence_defined() == False assert cub.persistence() == [(1, (0.0, 1.0)), (0, (0.0, float("inf")))] @@ -83,6 +94,20 @@ def test_user_case_simple_constructor(): ) assert other_cub.persistence() == [(1, (0.0, 1.0)), (0, (0.0, float("inf")))] +def test_user_case_simple_constructor_from_top_cells(): + cub = CubicalComplex( + dimensions=[3, 3], + top_dimensional_cells=[float("inf"), 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0], + ) + user_case_simple_constructor(cub) + +def test_user_case_simple_constructor_from_numpy_array(): + cub = CubicalComplex( + numpy_array=np.array([[float("inf"), 0.0, 0.0], + [0.0, 1.0, 0.0], + [0.0, 0.0, 0.0]]) + ) + user_case_simple_constructor(cub) def test_dimension_file_constructor(): # Create test file -- cgit v1.2.3 From b63be266effe24646823acc59fe397021bb13a3e Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 18 Dec 2019 10:44:17 +0100 Subject: Reuse top_dimensional_cells instead of numpy_array argument to create a cubical --- src/python/doc/cubical_complex_user.rst | 2 +- src/python/gudhi/cubical_complex.pyx | 25 ++++++++++--------- src/python/gudhi/periodic_cubical_complex.pyx | 35 +++++++++++++-------------- src/python/test/test_cubical_complex.py | 12 ++++----- 4 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src/python/test/test_cubical_complex.py') diff --git a/src/python/doc/cubical_complex_user.rst b/src/python/doc/cubical_complex_user.rst index 21806038..d56c8789 100644 --- a/src/python/doc/cubical_complex_user.rst +++ b/src/python/doc/cubical_complex_user.rst @@ -143,7 +143,7 @@ Or it can be defined as follows: from gudhi import PeriodicCubicalComplex as pcc from numpy import array as np_array - periodic_cc = pcc(numpy_array = np_array([[0, 0, 0], [0, 1, 0], [0, 0, 0]]), + periodic_cc = pcc(top_dimensional_cells = np_array([[0, 0, 0], [0, 1, 0], [0, 0, 0]]), periodic_dimensions=[True, False]) result_str = 'Periodic cubical complex is of dimension ' + repr(periodic_cc.dimension()) + ' - ' + \ repr(periodic_cc.num_simplices()) + ' simplices.' diff --git a/src/python/gudhi/cubical_complex.pyx b/src/python/gudhi/cubical_complex.pyx index 2ec0146a..1aa1164c 100644 --- a/src/python/gudhi/cubical_complex.pyx +++ b/src/python/gudhi/cubical_complex.pyx @@ -47,7 +47,7 @@ cdef class CubicalComplex: # Fake constructor that does nothing but documenting the constructor def __init__(self, dimensions=None, top_dimensional_cells=None, - numpy_array=None, perseus_file=''): + perseus_file=''): """CubicalComplex constructor from dimensions and top_dimensional_cells or from a Perseus-style file name. @@ -58,8 +58,9 @@ cdef class CubicalComplex: Or - :param numpy_array: Filtration values in a d-array. - :type numpy_array: numpy ndarray + :param top_dimensional_cells: A multidimensional array of cells + filtration values. + :type top_dimensional_cells: numpy ndarray Or @@ -69,20 +70,20 @@ cdef class CubicalComplex: # The real cython constructor def __cinit__(self, dimensions=None, top_dimensional_cells=None, - numpy_array=None, perseus_file=''): + perseus_file=''): if ((dimensions is not None) and (top_dimensional_cells is not None) - and (numpy_array is None) and (perseus_file == '')): + and (perseus_file == '')): self.thisptr = new Bitmap_cubical_complex_base_interface(dimensions, top_dimensional_cells) - elif ((dimensions is None) and (top_dimensional_cells is None) - and (numpy_array is not None) and (perseus_file == '')): - if isinstance(numpy_array, np.ndarray): - dimensions = list(numpy_array.shape) - top_dimensional_cells = numpy_array.flatten().tolist() + elif ((dimensions is None) and (top_dimensional_cells is not None) + and (perseus_file == '')): + if isinstance(top_dimensional_cells, np.ndarray): + dimensions = list(top_dimensional_cells.shape) + top_dimensional_cells = top_dimensional_cells.flatten().tolist() self.thisptr = new Bitmap_cubical_complex_base_interface(dimensions, top_dimensional_cells) else: - print("numpy_array is not an instance of ndarray. It is a " + type(numpy_array)) + print("top_dimensional_cells is not an instance of ndarray. It is a " + type(top_dimensional_cells)) elif ((dimensions is None) and (top_dimensional_cells is None) - and (numpy_array is None) and (perseus_file != '')): + and (perseus_file != '')): if os.path.isfile(perseus_file): self.thisptr = new Bitmap_cubical_complex_base_interface(str.encode(perseus_file)) else: diff --git a/src/python/gudhi/periodic_cubical_complex.pyx b/src/python/gudhi/periodic_cubical_complex.pyx index 8318b7d3..e623058a 100644 --- a/src/python/gudhi/periodic_cubical_complex.pyx +++ b/src/python/gudhi/periodic_cubical_complex.pyx @@ -47,7 +47,7 @@ cdef class PeriodicCubicalComplex: # Fake constructor that does nothing but documenting the constructor def __init__(self, dimensions=None, top_dimensional_cells=None, - numpy_array=None, periodic_dimensions=None, perseus_file=''): + periodic_dimensions=None, perseus_file=''): """PeriodicCubicalComplex constructor from dimensions and top_dimensional_cells or from a Perseus-style file name. @@ -60,8 +60,9 @@ cdef class PeriodicCubicalComplex: Or - :param numpy_array: Filtration values in a d-array. - :type numpy_array: numpy ndarray + :param top_dimensional_cells: A multidimensional array of cells + filtration values. + :type top_dimensional_cells: numpy ndarray :param periodic_dimensions: A list of top dimensional cells periodicity value. :type periodic_dimensions: list of boolean @@ -73,35 +74,33 @@ cdef class PeriodicCubicalComplex: # The real cython constructor def __cinit__(self, dimensions=None, top_dimensional_cells=None, - numpy_array=None, periodic_dimensions=None, - perseus_file=''): + periodic_dimensions=None, perseus_file=''): if ((dimensions is not None) and (top_dimensional_cells is not None) - and (numpy_array is None) and (periodic_dimensions is not None) - and (perseus_file == '')): + and (periodic_dimensions is not None) and (perseus_file == '')): self.thisptr = new Periodic_cubical_complex_base_interface(dimensions, top_dimensional_cells, periodic_dimensions) - elif ((dimensions is None) and (top_dimensional_cells is None) - and (numpy_array is not None) and (periodic_dimensions is not None) - and (perseus_file == '')): - if isinstance(numpy_array, np.ndarray): - dimensions = list(numpy_array.shape) - top_dimensional_cells = numpy_array.flatten().tolist() + elif ((dimensions is None) and (top_dimensional_cells is not None) + and (periodic_dimensions is not None) and (perseus_file == '')): + if isinstance(top_dimensional_cells, np.ndarray): + dimensions = list(top_dimensional_cells.shape) + top_dimensional_cells = top_dimensional_cells.flatten().tolist() self.thisptr = new Periodic_cubical_complex_base_interface(dimensions, top_dimensional_cells, periodic_dimensions) else: - print("numpy_array is not an instance of ndarray. It is a " + type(numpy_array)) + print("top_dimensional_cells is not an instance of ndarray. It is a " + type(top_dimensional_cells)) elif ((dimensions is None) and (top_dimensional_cells is None) - and (numpy_array is None) and (periodic_dimensions is None) - and (perseus_file != '')): + and (periodic_dimensions is None) and (perseus_file != '')): if os.path.isfile(perseus_file): self.thisptr = new Periodic_cubical_complex_base_interface(str.encode(perseus_file)) else: print("file " + perseus_file + " not found.") else: - print("CubicalComplex can be constructed from dimensions and " - "top_dimensional_cells or from a Perseus-style file name.") + print("CubicalComplex can be constructed from dimensions, " + "top_dimensional_cells and periodic_dimensions, or from " + "top_dimensional_cells and periodic_dimensions or from " + "a Perseus-style file name.") def __dealloc__(self): if self.thisptr != NULL: diff --git a/src/python/test/test_cubical_complex.py b/src/python/test/test_cubical_complex.py index a37d7821..6d4e0309 100755 --- a/src/python/test/test_cubical_complex.py +++ b/src/python/test/test_cubical_complex.py @@ -77,9 +77,9 @@ def test_simple_constructor_from_top_cells(): def test_simple_constructor_from_numpy_array(): cub = CubicalComplex( - numpy_array=np.array([[1, 2, 3], - [4, 5, 6], - [7, 8, 9]]) + top_dimensional_cells=np.array([[1, 2, 3], + [4, 5, 6], + [7, 8, 9]]) ) simple_constructor(cub) @@ -103,9 +103,9 @@ def test_user_case_simple_constructor_from_top_cells(): def test_user_case_simple_constructor_from_numpy_array(): cub = CubicalComplex( - numpy_array=np.array([[float("inf"), 0.0, 0.0], - [0.0, 1.0, 0.0], - [0.0, 0.0, 0.0]]) + top_dimensional_cells=np.array([[float("inf"), 0.0, 0.0], + [0.0, 1.0, 0.0], + [0.0, 0.0, 0.0]]) ) user_case_simple_constructor(cub) -- cgit v1.2.3 From ba406558f707f55b638be92d197ae3039595b29a Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Fri, 20 Dec 2019 16:57:36 +0100 Subject: Fix dimension cell linearization and test connected sublevel sets --- src/python/gudhi/cubical_complex.pyx | 2 +- src/python/gudhi/periodic_cubical_complex.pyx | 2 +- src/python/test/test_cubical_complex.py | 28 ++++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) (limited to 'src/python/test/test_cubical_complex.py') diff --git a/src/python/gudhi/cubical_complex.pyx b/src/python/gudhi/cubical_complex.pyx index 756a9dab..04b22921 100644 --- a/src/python/gudhi/cubical_complex.pyx +++ b/src/python/gudhi/cubical_complex.pyx @@ -78,7 +78,7 @@ cdef class CubicalComplex: and (perseus_file == '')): if isinstance(top_dimensional_cells, np.ndarray): dimensions = top_dimensional_cells.shape - top_dimensional_cells = top_dimensional_cells.ravel(order='C') + top_dimensional_cells = top_dimensional_cells.ravel(order='F') self.thisptr = new Bitmap_cubical_complex_base_interface(dimensions, top_dimensional_cells) else: print("top_dimensional_cells is not an instance of ndarray. It is a " + type(top_dimensional_cells)) diff --git a/src/python/gudhi/periodic_cubical_complex.pyx b/src/python/gudhi/periodic_cubical_complex.pyx index c3d64123..1d6f1e59 100644 --- a/src/python/gudhi/periodic_cubical_complex.pyx +++ b/src/python/gudhi/periodic_cubical_complex.pyx @@ -84,7 +84,7 @@ cdef class PeriodicCubicalComplex: and (periodic_dimensions is not None) and (perseus_file == '')): if isinstance(top_dimensional_cells, np.ndarray): dimensions = top_dimensional_cells.shape - top_dimensional_cells = top_dimensional_cells.ravel(order='C') + top_dimensional_cells = top_dimensional_cells.ravel(order='F') self.thisptr = new Periodic_cubical_complex_base_interface(dimensions, top_dimensional_cells, periodic_dimensions) diff --git a/src/python/test/test_cubical_complex.py b/src/python/test/test_cubical_complex.py index 6d4e0309..121da12a 100755 --- a/src/python/test/test_cubical_complex.py +++ b/src/python/test/test_cubical_complex.py @@ -1,4 +1,4 @@ -from gudhi import CubicalComplex +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. @@ -121,3 +121,29 @@ def test_dimension_file_constructor(): assert cub.__is_persistence_defined() == True assert cub.betti_numbers() == [1, 0, 0] assert cub.persistent_betti_numbers(0, 1000) == [1, 0, 0] + +def test_connected_sublevel_sets(): + array_cells = np.array([[3, 3], [2, 2], [4, 4]]) + linear_cells = [3, 3, 2, 2, 4, 4] + dimensions = [2, 3] + periodic_dimensions = [False, False] + # with a numpy array version + cub = CubicalComplex(top_dimensional_cells = array_cells) + assert cub.persistence() == [(0, (2.0, float("inf")))] + assert cub.betti_numbers() == [1, 0, 0] + # with vector of dimensions + cub = CubicalComplex(dimensions = dimensions, + top_dimensional_cells = linear_cells) + assert cub.persistence() == [(0, (2.0, float("inf")))] + assert cub.betti_numbers() == [1, 0, 0] + # periodic with a numpy array version + cub = PeriodicCubicalComplex(top_dimensional_cells = array_cells, + periodic_dimensions = periodic_dimensions) + assert cub.persistence() == [(0, (2.0, float("inf")))] + assert cub.betti_numbers() == [1, 0, 0] + # periodic with vector of dimensions + cub = PeriodicCubicalComplex(dimensions = dimensions, + top_dimensional_cells = linear_cells, + periodic_dimensions = periodic_dimensions) + assert cub.persistence() == [(0, (2.0, float("inf")))] + assert cub.betti_numbers() == [1, 0, 0] -- cgit v1.2.3 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/gudhi/__init__.py.in | 8 +++----- src/python/gudhi/alpha_complex.pyx | 18 +++++++++--------- src/python/gudhi/bottleneck.pyx | 10 +++++----- src/python/gudhi/cubical_complex.pyx | 18 +++++++++--------- src/python/gudhi/euclidean_strong_witness_complex.pyx | 16 ++++++++-------- src/python/gudhi/euclidean_witness_complex.pyx | 16 ++++++++-------- src/python/gudhi/nerve_gic.pyx | 18 +++++++++--------- src/python/gudhi/off_reader.pyx | 10 +++++----- src/python/gudhi/periodic_cubical_complex.pyx | 18 +++++++++--------- src/python/gudhi/persistence_graphical_tools.py | 14 +++++++------- src/python/gudhi/reader_utils.pyx | 18 +++++++++--------- src/python/gudhi/rips_complex.pyx | 18 +++++++++--------- src/python/gudhi/simplex_tree.pxd | 19 +++++++++---------- src/python/gudhi/simplex_tree.pyx | 8 ++++---- src/python/gudhi/strong_witness_complex.pyx | 16 ++++++++-------- src/python/gudhi/subsampling.pyx | 12 ++++++------ src/python/gudhi/tangential_complex.pyx | 18 +++++++++--------- src/python/gudhi/wasserstein.py | 14 +++++++------- src/python/gudhi/witness_complex.pyx | 16 ++++++++-------- src/python/setup.py.in | 8 ++++---- 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 ++-- 33 files changed, 185 insertions(+), 187 deletions(-) (limited to 'src/python/test/test_cubical_complex.py') diff --git a/src/python/gudhi/__init__.py.in b/src/python/gudhi/__init__.py.in index 0c462b02..79e12fbc 100644 --- a/src/python/gudhi/__init__.py.in +++ b/src/python/gudhi/__init__.py.in @@ -1,5 +1,3 @@ -from importlib import import_module - # 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 @@ -9,6 +7,9 @@ from importlib import import_module # Modification(s): # - YYYY/MM Author: Description of the modification +from importlib import import_module +from sys import exc_info + __author__ = "GUDHI Editorial Board" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "https://gudhi.inria.fr/licensing/" @@ -17,9 +18,6 @@ __version__ = "@GUDHI_VERSION@" __root_source_dir__ = "@CMAKE_SOURCE_DIR@" __debug_info__ = @GUDHI_PYTHON_DEBUG_INFO@ -from sys import exc_info -from importlib import import_module - __all__ = [@GUDHI_PYTHON_MODULES@ @GUDHI_PYTHON_MODULES_EXTRA@] __available_modules = '' diff --git a/src/python/gudhi/alpha_complex.pyx b/src/python/gudhi/alpha_complex.pyx index 24e36bea..db11416c 100644 --- a/src/python/gudhi/alpha_complex.pyx +++ b/src/python/gudhi/alpha_complex.pyx @@ -1,3 +1,12 @@ +# 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 +# +# Copyright (C) 2016 Inria +# +# Modification(s): +# - YYYY/MM Author: Description of the modification + from cython cimport numeric from libcpp.vector cimport vector from libcpp.utility cimport pair @@ -9,15 +18,6 @@ import os from gudhi.simplex_tree cimport * from gudhi.simplex_tree 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 -# -# Copyright (C) 2016 Inria -# -# Modification(s): -# - YYYY/MM Author: Description of the modification - __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "GPL v3" diff --git a/src/python/gudhi/bottleneck.pyx b/src/python/gudhi/bottleneck.pyx index c2361024..af011e88 100644 --- a/src/python/gudhi/bottleneck.pyx +++ b/src/python/gudhi/bottleneck.pyx @@ -1,8 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.utility cimport pair -import os - # 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 @@ -12,6 +7,11 @@ import os # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.utility cimport pair +import os + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "GPL v3" diff --git a/src/python/gudhi/cubical_complex.pyx b/src/python/gudhi/cubical_complex.pyx index b7047d4f..92ff6411 100644 --- a/src/python/gudhi/cubical_complex.pyx +++ b/src/python/gudhi/cubical_complex.pyx @@ -1,12 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.utility cimport pair -from libcpp.string cimport string -from libcpp cimport bool -import os - -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 @@ -16,6 +7,15 @@ import numpy as np # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.utility cimport pair +from libcpp.string cimport string +from libcpp cimport bool +import os + +import numpy as np + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/euclidean_strong_witness_complex.pyx b/src/python/gudhi/euclidean_strong_witness_complex.pyx index e3f451f0..9889f92c 100644 --- a/src/python/gudhi/euclidean_strong_witness_complex.pyx +++ b/src/python/gudhi/euclidean_strong_witness_complex.pyx @@ -1,11 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.utility cimport pair -from libc.stdint cimport intptr_t - -from gudhi.simplex_tree cimport * -from gudhi.simplex_tree 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 @@ -15,6 +7,14 @@ from gudhi.simplex_tree import SimplexTree # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.utility cimport pair +from libc.stdint cimport intptr_t + +from gudhi.simplex_tree cimport * +from gudhi.simplex_tree import SimplexTree + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "GPL v3" diff --git a/src/python/gudhi/euclidean_witness_complex.pyx b/src/python/gudhi/euclidean_witness_complex.pyx index 84a8ea1a..e3ce0e82 100644 --- a/src/python/gudhi/euclidean_witness_complex.pyx +++ b/src/python/gudhi/euclidean_witness_complex.pyx @@ -1,11 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.utility cimport pair -from libc.stdint cimport intptr_t - -from gudhi.simplex_tree cimport * -from gudhi.simplex_tree 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 @@ -15,6 +7,14 @@ from gudhi.simplex_tree import SimplexTree # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.utility cimport pair +from libc.stdint cimport intptr_t + +from gudhi.simplex_tree cimport * +from gudhi.simplex_tree import SimplexTree + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "GPL v3" diff --git a/src/python/gudhi/nerve_gic.pyx b/src/python/gudhi/nerve_gic.pyx index acb78564..68c06432 100644 --- a/src/python/gudhi/nerve_gic.pyx +++ b/src/python/gudhi/nerve_gic.pyx @@ -1,3 +1,12 @@ +# 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 +# +# Copyright (C) 2018 Inria +# +# Modification(s): +# - YYYY/MM Author: Description of the modification + from cython cimport numeric from libcpp.vector cimport vector from libcpp.utility cimport pair @@ -9,15 +18,6 @@ from libc.stdint cimport intptr_t from gudhi.simplex_tree cimport * from gudhi.simplex_tree 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 -# -# Copyright (C) 2018 Inria -# -# Modification(s): -# - YYYY/MM Author: Description of the modification - __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2018 Inria" __license__ = "GPL v3" diff --git a/src/python/gudhi/off_reader.pyx b/src/python/gudhi/off_reader.pyx index 225e981c..54a275e2 100644 --- a/src/python/gudhi/off_reader.pyx +++ b/src/python/gudhi/off_reader.pyx @@ -1,8 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.string cimport string -import os - # 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 @@ -12,6 +7,11 @@ import os # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.string cimport string +import os + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/periodic_cubical_complex.pyx b/src/python/gudhi/periodic_cubical_complex.pyx index eb96ab5f..b5dece10 100644 --- a/src/python/gudhi/periodic_cubical_complex.pyx +++ b/src/python/gudhi/periodic_cubical_complex.pyx @@ -1,12 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.utility cimport pair -from libcpp.string cimport string -from libcpp cimport bool -import os - -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 @@ -16,6 +7,15 @@ import numpy as np # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.utility cimport pair +from libcpp.string cimport string +from libcpp cimport bool +import os + +import numpy as np + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/persistence_graphical_tools.py b/src/python/gudhi/persistence_graphical_tools.py index 7d232c85..246280de 100644 --- a/src/python/gudhi/persistence_graphical_tools.py +++ b/src/python/gudhi/persistence_graphical_tools.py @@ -1,10 +1,3 @@ -from os import path -from math import isfinite -import numpy as np - -from gudhi.reader_utils import read_persistence_intervals_in_dimension -from gudhi.reader_utils import read_persistence_intervals_grouped_by_dimension - # 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, Bertrand Michel @@ -14,6 +7,13 @@ from gudhi.reader_utils import read_persistence_intervals_grouped_by_dimension # Modification(s): # - YYYY/MM Author: Description of the modification +from os import path +from math import isfinite +import numpy as np + +from gudhi.reader_utils import read_persistence_intervals_in_dimension +from gudhi.reader_utils import read_persistence_intervals_grouped_by_dimension + __author__ = "Vincent Rouvreau, Bertrand Michel" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/reader_utils.pyx b/src/python/gudhi/reader_utils.pyx index 6994c4f9..345c92f8 100644 --- a/src/python/gudhi/reader_utils.pyx +++ b/src/python/gudhi/reader_utils.pyx @@ -1,12 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.string cimport string -from libcpp.map cimport map -from libcpp.pair cimport pair - -from os import path -from numpy import array as np_array - # 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 @@ -16,6 +7,15 @@ from numpy import array as np_array # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.string cimport string +from libcpp.map cimport map +from libcpp.pair cimport pair + +from os import path +from numpy import array as np_array + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2017 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/rips_complex.pyx b/src/python/gudhi/rips_complex.pyx index cbbbab0d..722cdcdc 100644 --- a/src/python/gudhi/rips_complex.pyx +++ b/src/python/gudhi/rips_complex.pyx @@ -1,3 +1,12 @@ +# 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 +# +# Copyright (C) 2016 Inria +# +# Modification(s): +# - YYYY/MM Author: Description of the modification + from cython cimport numeric from libcpp.vector cimport vector from libcpp.utility cimport pair @@ -8,15 +17,6 @@ from libc.stdint cimport intptr_t from gudhi.simplex_tree cimport * from gudhi.simplex_tree 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 -# -# Copyright (C) 2016 Inria -# -# Modification(s): -# - YYYY/MM Author: Description of the modification - __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/simplex_tree.pxd b/src/python/gudhi/simplex_tree.pxd index 5f86cfe2..1066d44b 100644 --- a/src/python/gudhi/simplex_tree.pxd +++ b/src/python/gudhi/simplex_tree.pxd @@ -1,19 +1,18 @@ +# 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 +# +# Copyright (C) 2016 Inria +# +# Modification(s): +# - YYYY/MM Author: Description of the modification + from cython cimport numeric from libcpp.vector cimport vector from libcpp.utility cimport pair from libcpp cimport bool from libcpp.string cimport string -""" 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 - - Copyright (C) 2016 Inria - - Modification(s): - - YYYY/MM Author: Description of the modification -""" - __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/simplex_tree.pyx b/src/python/gudhi/simplex_tree.pyx index 4a3cd9bc..85d25492 100644 --- a/src/python/gudhi/simplex_tree.pyx +++ b/src/python/gudhi/simplex_tree.pyx @@ -1,7 +1,3 @@ -from libc.stdint cimport intptr_t -from numpy import array as np_array -cimport simplex_tree - # 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 +7,10 @@ cimport simplex_tree # Modification(s): # - YYYY/MM Author: Description of the modification +from libc.stdint cimport intptr_t +from numpy import array as np_array +cimport simplex_tree + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/strong_witness_complex.pyx b/src/python/gudhi/strong_witness_complex.pyx index 66d49b49..2c33c3f2 100644 --- a/src/python/gudhi/strong_witness_complex.pyx +++ b/src/python/gudhi/strong_witness_complex.pyx @@ -1,11 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.utility cimport pair -from libc.stdint cimport intptr_t - -from gudhi.simplex_tree cimport * -from gudhi.simplex_tree 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 @@ -15,6 +7,14 @@ from gudhi.simplex_tree import SimplexTree # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.utility cimport pair +from libc.stdint cimport intptr_t + +from gudhi.simplex_tree cimport * +from gudhi.simplex_tree import SimplexTree + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/gudhi/subsampling.pyx b/src/python/gudhi/subsampling.pyx index e0cd1348..b1812087 100644 --- a/src/python/gudhi/subsampling.pyx +++ b/src/python/gudhi/subsampling.pyx @@ -1,9 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.string cimport string -from libcpp cimport bool -import os - # 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 @@ -13,6 +7,12 @@ import os # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.string cimport string +from libcpp cimport bool +import os + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "GPL v3" diff --git a/src/python/gudhi/tangential_complex.pyx b/src/python/gudhi/tangential_complex.pyx index f4c8b079..0083033c 100644 --- a/src/python/gudhi/tangential_complex.pyx +++ b/src/python/gudhi/tangential_complex.pyx @@ -1,3 +1,12 @@ +# 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 +# +# Copyright (C) 2016 Inria +# +# Modification(s): +# - YYYY/MM Author: Description of the modification + from cython cimport numeric from libcpp.vector cimport vector from libcpp.utility cimport pair @@ -9,15 +18,6 @@ import os from gudhi.simplex_tree cimport * from gudhi.simplex_tree 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 -# -# Copyright (C) 2016 Inria -# -# Modification(s): -# - YYYY/MM Author: Description of the modification - __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "GPL v3" 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. diff --git a/src/python/gudhi/witness_complex.pyx b/src/python/gudhi/witness_complex.pyx index 153fc615..b032a5a1 100644 --- a/src/python/gudhi/witness_complex.pyx +++ b/src/python/gudhi/witness_complex.pyx @@ -1,11 +1,3 @@ -from cython cimport numeric -from libcpp.vector cimport vector -from libcpp.utility cimport pair -from libc.stdint cimport intptr_t - -from gudhi.simplex_tree cimport * -from gudhi.simplex_tree 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 @@ -15,6 +7,14 @@ from gudhi.simplex_tree import SimplexTree # Modification(s): # - YYYY/MM Author: Description of the modification +from cython cimport numeric +from libcpp.vector cimport vector +from libcpp.utility cimport pair +from libc.stdint cimport intptr_t + +from gudhi.simplex_tree cimport * +from gudhi.simplex_tree import SimplexTree + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" diff --git a/src/python/setup.py.in b/src/python/setup.py.in index 3f1d4424..24d05025 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -1,7 +1,3 @@ -from setuptools import setup, Extension -from Cython.Build import cythonize -from numpy import get_include as numpy_get_include - """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 @@ -12,6 +8,10 @@ from numpy import get_include as numpy_get_include - YYYY/MM Author: Description of the modification """ +from setuptools import setup, Extension +from Cython.Build import cythonize +from numpy import get_include as numpy_get_include + __author__ = "Vincent Rouvreau" __copyright__ = "Copyright (C) 2016 Inria" __license__ = "MIT" 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