summaryrefslogtreecommitdiff
path: root/src/python/test/test_simplex_tree.py
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-11-03 14:11:41 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2020-11-03 14:11:41 +0100
commita07430764c57c195c9260fc1b301ba0aeb77dcc7 (patch)
tree5a946e39e7158d4e6e8e3aff04bed9efbde6444e /src/python/test/test_simplex_tree.py
parent05e28e39717c4ca5871b13a350c4b142ec9a173b (diff)
parent5900b2d802a7387f7fd4a87b5251dcbe6931371c (diff)
Merge branch 'master' into weighted_alpha_complex_dD
Diffstat (limited to 'src/python/test/test_simplex_tree.py')
-rwxr-xr-xsrc/python/test/test_simplex_tree.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py
index ac2b59c7..3b23fa0b 100755
--- a/src/python/test/test_simplex_tree.py
+++ b/src/python/test/test_simplex_tree.py
@@ -380,3 +380,22 @@ def test_reset_filtration():
assert st.filtration(simplex[0]) >= 2.
else:
assert st.filtration(simplex[0]) == 0.
+
+def test_boundaries_iterator():
+ st = SimplexTree()
+
+ assert st.insert([0, 1, 2, 3], filtration=1.0) == True
+ assert st.insert([1, 2, 3, 4], filtration=2.0) == True
+
+ assert list(st.get_boundaries([1, 2, 3])) == [([1, 2], 1.0), ([1, 3], 1.0), ([2, 3], 1.0)]
+ assert list(st.get_boundaries([2, 3, 4])) == [([2, 3], 1.0), ([2, 4], 2.0), ([3, 4], 2.0)]
+ assert list(st.get_boundaries([2])) == []
+
+ with pytest.raises(RuntimeError):
+ list(st.get_boundaries([]))
+
+ with pytest.raises(RuntimeError):
+ list(st.get_boundaries([0, 4])) # (0, 4) does not exist
+
+ with pytest.raises(RuntimeError):
+ list(st.get_boundaries([6])) # (6) does not exist