summaryrefslogtreecommitdiff
path: root/src/python/test/test_simplex_tree.py
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-03-16 13:38:18 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-03-16 13:38:18 +0100
commit6ed2a97421a223b4ebe31b91f48d779c2209f470 (patch)
treeba6fbeab3dcc9bd1aa343045e53da076ca26c46a /src/python/test/test_simplex_tree.py
parentef519f6169f03aa6186d092b959454df1e2a3e50 (diff)
Add get_simplices method - contrary to get_filtration method, sort is not performed
Diffstat (limited to 'src/python/test/test_simplex_tree.py')
-rwxr-xr-xsrc/python/test/test_simplex_tree.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py
index 04b26e92..f7848379 100755
--- a/src/python/test/test_simplex_tree.py
+++ b/src/python/test/test_simplex_tree.py
@@ -249,3 +249,15 @@ def test_make_filtration_non_decreasing():
assert st.filtration([3, 4, 5]) == 2.0
assert st.filtration([3, 4]) == 2.0
assert st.filtration([4, 5]) == 2.0
+
+def test_simplices_iterator():
+ st = SimplexTree()
+
+ assert st.insert([0, 1, 2], filtration=4.0) == True
+ assert st.insert([2, 3, 4], filtration=2.0) == True
+
+ for simplex in st.get_simplices():
+ print("simplex is: ", simplex[0])
+ assert st.find(simplex[0]) == True
+ print("filtration is: ", simplex[1])
+ assert st.filtration(simplex[0]) == simplex[1]