summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-05-31 09:53:04 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-05-31 09:53:04 +0000
commit1e283611d2999003353e57f429bc9a0513fb0508 (patch)
treef8f66bb2a9ff04a67efc0329b0d1b64878031933 /src
parent610b63a7ddd1d112f2b3e793498e7a31eeb76cd6 (diff)
Rename files using PEP8 recommendations
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@1226 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 4fb27e76a494266c9f79f411c03633f68e2da525
Diffstat (limited to 'src')
-rw-r--r--src/cython/Makefile16
-rwxr-xr-xsrc/cython/example/Rips_complex_example.py15
-rwxr-xr-xsrc/cython/example/alpha_complex_example.py (renamed from src/cython/example/Alpha_complex_example.py)26
-rwxr-xr-xsrc/cython/example/mini_simplex_tree_example.py (renamed from src/cython/example/Mini_simplex_tree_example.py)26
-rwxr-xr-xsrc/cython/example/rips_complex_example.py41
-rwxr-xr-xsrc/cython/example/simplex_tree_example.py (renamed from src/cython/example/Simplex_tree_example.py)26
-rw-r--r--src/cython/gudhi.pyx34
-rw-r--r--src/cython/setup.py26
-rw-r--r--src/cython/src/cython/alpha_complex.pyx (renamed from src/cython/src/cython/Alpha_complex.pyx)0
-rw-r--r--src/cython/src/cython/mini_simplex_tree.pyx (renamed from src/cython/src/cython/Mini_simplex_tree.pyx)0
-rw-r--r--src/cython/src/cython/rips_complex.pyx (renamed from src/cython/src/cython/Rips_complex.pyx)0
-rw-r--r--src/cython/src/cython/simplex_tree.pyx (renamed from src/cython/src/cython/Simplex_tree.pyx)0
-rwxr-xr-xsrc/cython/test/Mini_simplex_tree_UT.py29
-rwxr-xr-xsrc/cython/test/test_alpha_complex.py (renamed from src/cython/test/Alpha_complex_UT.py)26
-rwxr-xr-xsrc/cython/test/test_mini_simplex_tree.py55
-rwxr-xr-xsrc/cython/test/test_rips_complex.py (renamed from src/cython/test/Rips_complex_UT.py)26
-rwxr-xr-xsrc/cython/test/test_simplex_tree.py (renamed from src/cython/test/Simplex_tree_UT.py)26
17 files changed, 316 insertions, 56 deletions
diff --git a/src/cython/Makefile b/src/cython/Makefile
index c90135b8..fd7e16e6 100644
--- a/src/cython/Makefile
+++ b/src/cython/Makefile
@@ -2,16 +2,16 @@ ext:
python setup.py build_ext --inplace
test:
- python test/Simplex_tree_UT.py
- python test/Mini_simplex_tree_UT.py
- python test/Rips_complex_UT.py
- python test/Alpha_complex_UT.py
+ python test/test_simplex_tree.py
+ python test/test_mini_simplex_tree.py
+ python test/test_rips_complex.py
+ python test/test_alpha_complex.py
example:
- python example/Simplex_tree_example.py
- python example/Mini_simplex_tree_example.py
- python example/Rips_complex_example.py
- python example/Alpha_complex_example.py
+ python example/simplex_tree_example.py
+ python example/mini_simplex_tree_example.py
+ python example/rips_complex_example.py
+ python example/alpha_complex_example.py
clean:
rm -rf build/ *.o *.so *.cpp
diff --git a/src/cython/example/Rips_complex_example.py b/src/cython/example/Rips_complex_example.py
deleted file mode 100755
index 6a39fc77..00000000
--- a/src/cython/example/Rips_complex_example.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env python
-
-import gudhi
-
-print("#####################################################################")
-print("RipsComplex creation from points")
-rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]],
- max_dimension=1, max_edge_length=42)
-
-print("filtered_tree=", rips.get_filtered_tree())
-print("star([0])=", rips.get_star_tree([0]))
-print("coface([0], 1)=", rips.get_coface_tree([0], 1))
-
-print("persistence(2)=", rips.persistence(homology_coeff_field=2,
- min_persistence=0))
diff --git a/src/cython/example/Alpha_complex_example.py b/src/cython/example/alpha_complex_example.py
index a724b0c4..6996b692 100755
--- a/src/cython/example/Alpha_complex_example.py
+++ b/src/cython/example/alpha_complex_example.py
@@ -2,6 +2,32 @@
import gudhi
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
print("#####################################################################")
print("AlphaComplex creation from points")
alpha_complex = gudhi.AlphaComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]],
diff --git a/src/cython/example/Mini_simplex_tree_example.py b/src/cython/example/mini_simplex_tree_example.py
index 6cd5bf29..0461a1df 100755
--- a/src/cython/example/Mini_simplex_tree_example.py
+++ b/src/cython/example/mini_simplex_tree_example.py
@@ -2,6 +2,32 @@
import gudhi
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
print("#####################################################################")
print("MiniSimplexTree creation from insertion")
diff --git a/src/cython/example/rips_complex_example.py b/src/cython/example/rips_complex_example.py
new file mode 100755
index 00000000..eba3f298
--- /dev/null
+++ b/src/cython/example/rips_complex_example.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+
+import gudhi
+
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
+print("#####################################################################")
+print("RipsComplex creation from points")
+rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]],
+ max_dimension=1, max_edge_length=42)
+
+print("filtered_tree=", rips.get_filtered_tree())
+print("star([0])=", rips.get_star_tree([0]))
+print("coface([0], 1)=", rips.get_coface_tree([0], 1))
+
+print("persistence(2)=", rips.persistence(homology_coeff_field=2,
+ min_persistence=0))
diff --git a/src/cython/example/Simplex_tree_example.py b/src/cython/example/simplex_tree_example.py
index e8585d83..bdaabca2 100755
--- a/src/cython/example/Simplex_tree_example.py
+++ b/src/cython/example/simplex_tree_example.py
@@ -4,6 +4,32 @@ import gudhi
st = gudhi.SimplexTree()
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
print("#####################################################################")
print("SimplexTree creation from insertion")
if st.insert([0, 1]):
diff --git a/src/cython/gudhi.pyx b/src/cython/gudhi.pyx
index 8fcc081a..77b1b4bc 100644
--- a/src/cython/gudhi.pyx
+++ b/src/cython/gudhi.pyx
@@ -1,4 +1,30 @@
-include "src/cython/Simplex_tree.pyx"
-include "src/cython/Mini_simplex_tree.pyx"
-include "src/cython/Rips_complex.pyx"
-include "src/cython/Alpha_complex.pyx"
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
+include "src/cython/simplex_tree.pyx"
+include "src/cython/mini_simplex_tree.pyx"
+include "src/cython/rips_complex.pyx"
+include "src/cython/alpha_complex.pyx"
diff --git a/src/cython/setup.py b/src/cython/setup.py
index 92ed6bbd..5b99ba5f 100644
--- a/src/cython/setup.py
+++ b/src/cython/setup.py
@@ -1,6 +1,32 @@
from distutils.core import setup, Extension
from Cython.Build import cythonize
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
gudhi = Extension(
"gudhi",
sources = ['gudhi.pyx',],
diff --git a/src/cython/src/cython/Alpha_complex.pyx b/src/cython/src/cython/alpha_complex.pyx
index a06134c8..a06134c8 100644
--- a/src/cython/src/cython/Alpha_complex.pyx
+++ b/src/cython/src/cython/alpha_complex.pyx
diff --git a/src/cython/src/cython/Mini_simplex_tree.pyx b/src/cython/src/cython/mini_simplex_tree.pyx
index b836fb88..b836fb88 100644
--- a/src/cython/src/cython/Mini_simplex_tree.pyx
+++ b/src/cython/src/cython/mini_simplex_tree.pyx
diff --git a/src/cython/src/cython/Rips_complex.pyx b/src/cython/src/cython/rips_complex.pyx
index 3ca890d9..3ca890d9 100644
--- a/src/cython/src/cython/Rips_complex.pyx
+++ b/src/cython/src/cython/rips_complex.pyx
diff --git a/src/cython/src/cython/Simplex_tree.pyx b/src/cython/src/cython/simplex_tree.pyx
index e3cdc27b..e3cdc27b 100644
--- a/src/cython/src/cython/Simplex_tree.pyx
+++ b/src/cython/src/cython/simplex_tree.pyx
diff --git a/src/cython/test/Mini_simplex_tree_UT.py b/src/cython/test/Mini_simplex_tree_UT.py
deleted file mode 100755
index 8f2f56df..00000000
--- a/src/cython/test/Mini_simplex_tree_UT.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import unittest
-
-import gudhi
-
-
-class TestMiniSimplexTree(unittest.TestCase):
-
- def test_mini(self):
- triangle012 = [0, 1, 2]
- edge03 = [0, 3]
- mini_st = gudhi.MiniSimplexTree()
- self.assertTrue(mini_st.insert(triangle012))
- self.assertTrue(mini_st.insert(edge03))
- # FIXME: Remove this line
- mini_st.set_dimension(2)
-
- edge02 = [0, 2]
- self.assertTrue(mini_st.find(edge02))
- self.assertEqual(mini_st.get_coface_tree(edge02, 1),
- [([0, 1, 2], 0.0)])
-
- # remove_maximal_simplex test
- self.assertEqual(mini_st.get_coface_tree(triangle012, 1), [])
- mini_st.remove_maximal_simplex(triangle012)
- self.assertTrue(mini_st.find(edge02))
- self.assertFalse(mini_st.find(triangle012))
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/src/cython/test/Alpha_complex_UT.py b/src/cython/test/test_alpha_complex.py
index c14c43e2..8a346bb9 100755
--- a/src/cython/test/Alpha_complex_UT.py
+++ b/src/cython/test/test_alpha_complex.py
@@ -2,6 +2,32 @@ import unittest
import gudhi
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
class TestAlphaComplex(unittest.TestCase):
diff --git a/src/cython/test/test_mini_simplex_tree.py b/src/cython/test/test_mini_simplex_tree.py
new file mode 100755
index 00000000..6622fa57
--- /dev/null
+++ b/src/cython/test/test_mini_simplex_tree.py
@@ -0,0 +1,55 @@
+import unittest
+
+import gudhi
+
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
+
+class TestMiniSimplexTree(unittest.TestCase):
+
+ def test_mini(self):
+ triangle012 = [0, 1, 2]
+ edge03 = [0, 3]
+ mini_st = gudhi.MiniSimplexTree()
+ self.assertTrue(mini_st.insert(triangle012))
+ self.assertTrue(mini_st.insert(edge03))
+ # FIXME: Remove this line
+ mini_st.set_dimension(2)
+
+ edge02 = [0, 2]
+ self.assertTrue(mini_st.find(edge02))
+ self.assertEqual(mini_st.get_coface_tree(edge02, 1),
+ [([0, 1, 2], 0.0)])
+
+ # remove_maximal_simplex test
+ self.assertEqual(mini_st.get_coface_tree(triangle012, 1), [])
+ mini_st.remove_maximal_simplex(triangle012)
+ self.assertTrue(mini_st.find(edge02))
+ self.assertFalse(mini_st.find(triangle012))
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/src/cython/test/Rips_complex_UT.py b/src/cython/test/test_rips_complex.py
index ccff5c2d..3ad26b53 100755
--- a/src/cython/test/Rips_complex_UT.py
+++ b/src/cython/test/test_rips_complex.py
@@ -2,6 +2,32 @@ import unittest
import gudhi
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
class TestRipsComplex(unittest.TestCase):
diff --git a/src/cython/test/Simplex_tree_UT.py b/src/cython/test/test_simplex_tree.py
index 392c6d71..3451ca4b 100755
--- a/src/cython/test/Simplex_tree_UT.py
+++ b/src/cython/test/test_simplex_tree.py
@@ -2,6 +2,32 @@ import unittest
import gudhi
+"""This file is part of the Gudhi Library. The Gudhi library
+ (Geometric Understanding in Higher Dimensions) is a generic C++
+ library for computational topology.
+
+ Author(s): Vincent Rouvreau
+
+ Copyright (C) 2016 INRIA Saclay (France)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2016 INRIA Saclay (France)"
+__license__ = "GPL v3"
+
class TestSimplexTree(unittest.TestCase):