summaryrefslogtreecommitdiff
path: root/src/python/example/alpha_complex_from_points_example.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/example/alpha_complex_from_points_example.py')
-rwxr-xr-xsrc/python/example/alpha_complex_from_points_example.py14
1 files changed, 11 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 a746998c..5d5ca66a 100755
--- a/src/python/example/alpha_complex_from_points_example.py
+++ b/src/python/example/alpha_complex_from_points_example.py
@@ -19,7 +19,7 @@ __license__ = "MIT"
print("#####################################################################")
print("AlphaComplex creation from points")
alpha_complex = AlphaComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]])
-simplex_tree = alpha_complex.create_simplex_tree(max_alpha_square=60.0)
+simplex_tree = alpha_complex.create_simplex_tree()
if simplex_tree.find([0, 1]):
print("[0, 1] Found !!")
@@ -47,9 +47,17 @@ 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))
print("point[0]=", alpha_complex.get_point(0))
-print("point[5]=", alpha_complex.get_point(5))
+try:
+ print("point[5]=", alpha_complex.get_point(5))
+except IndexError:
+ pass
+else:
+ assert False