summaryrefslogtreecommitdiff
path: root/src/python/example
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-28 11:05:39 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-01-28 11:05:39 +0100
commitef2c5b53e88321f07ad93496f00dde16dc20f018 (patch)
tree0a7c4d1d7f69a691259e98ceed1439421fb14f3e /src/python/example
parent0b77fdd5d9bd057103cb23020089a6628c1f14e6 (diff)
Code review: rename get_simplex_filtration with get_simplex_and_filtration. Remove exception raise. Fix failed tests. Reword documentation
Diffstat (limited to 'src/python/example')
-rwxr-xr-xsrc/python/example/alpha_complex_from_points_example.py5
-rwxr-xr-xsrc/python/example/rips_complex_from_points_example.py5
-rwxr-xr-xsrc/python/example/simplex_tree_example.py5
3 files changed, 12 insertions, 3 deletions
diff --git a/src/python/example/alpha_complex_from_points_example.py b/src/python/example/alpha_complex_from_points_example.py
index 844d7a82..465632eb 100755
--- a/src/python/example/alpha_complex_from_points_example.py
+++ b/src/python/example/alpha_complex_from_points_example.py
@@ -47,7 +47,10 @@ else:
print("[4] Not found...")
print("dimension=", simplex_tree.dimension())
-print("filtrations=", simplex_tree.get_filtration())
+print("filtrations=")
+for simplex_with_filtration in simplex_tree.get_filtration():
+ print("(%s, %.2f)" % tuple(simplex_with_filtration))
+
print("star([0])=", simplex_tree.get_star([0]))
print("coface([0], 1)=", simplex_tree.get_cofaces([0], 1))
diff --git a/src/python/example/rips_complex_from_points_example.py b/src/python/example/rips_complex_from_points_example.py
index 59d8a261..c05703c6 100755
--- a/src/python/example/rips_complex_from_points_example.py
+++ b/src/python/example/rips_complex_from_points_example.py
@@ -22,6 +22,9 @@ rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]], max_edge_lengt
simplex_tree = rips.create_simplex_tree(max_dimension=1)
-print("filtrations=", simplex_tree.get_filtration())
+print("filtrations=")
+for simplex_with_filtration in simplex_tree.get_filtration():
+ print("(%s, %.2f)" % tuple(simplex_with_filtration))
+
print("star([0])=", simplex_tree.get_star([0]))
print("coface([0], 1)=", simplex_tree.get_cofaces([0], 1))
diff --git a/src/python/example/simplex_tree_example.py b/src/python/example/simplex_tree_example.py
index 30de00da..7f20c389 100755
--- a/src/python/example/simplex_tree_example.py
+++ b/src/python/example/simplex_tree_example.py
@@ -39,7 +39,10 @@ else:
print("dimension=", st.dimension())
st.initialize_filtration()
-print("filtration=", st.get_filtration())
+print("filtration=")
+for simplex_with_filtration in st.get_filtration():
+ print("(%s, %.2f)" % tuple(simplex_with_filtration))
+
print("filtration[1, 2]=", st.filtration([1, 2]))
print("filtration[4, 2]=", st.filtration([4, 2]))