diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-08-18 10:55:42 +0200 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2020-08-18 10:55:42 +0200 |
commit | a1cd7e9ead030654a1fdb6cfd50408103c458529 (patch) | |
tree | 9786156bfb00d5b4f85dda2458b087d60d1bc1a8 /src/python/test/test_simplex_tree.py | |
parent | 85eec1ba750d56b66e3739dc486c6205f49fb31e (diff) | |
parent | 4737aaeb36a4ff3b27d7bcbb374911197ed09e5a (diff) |
Merge master and resolve conflicts
Diffstat (limited to 'src/python/test/test_simplex_tree.py')
-rwxr-xr-x | src/python/test/test_simplex_tree.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py index 1ca84c10..6f1d01cc 100755 --- a/src/python/test/test_simplex_tree.py +++ b/src/python/test/test_simplex_tree.py @@ -341,6 +341,24 @@ def test_simplices_iterator(): print("filtration is: ", simplex[1]) assert st.filtration(simplex[0]) == simplex[1] +def test_collapse_edges(): + st = SimplexTree() + + assert st.insert([0, 1], filtration=1.0) == True + assert st.insert([1, 2], filtration=1.0) == True + assert st.insert([2, 3], filtration=1.0) == True + assert st.insert([0, 3], filtration=1.0) == True + assert st.insert([0, 2], filtration=2.0) == True + assert st.insert([1, 3], filtration=2.0) == True + + assert st.num_simplices() == 10 + + st.collapse_edges() + assert st.num_simplices() == 9 + assert st.find([1, 3]) == False + for simplex in st.get_skeleton(0): + assert simplex[1] == 1. + def test_reset_filtration(): st = SimplexTree() @@ -361,4 +379,3 @@ def test_reset_filtration(): assert st.filtration(simplex[0]) >= 1. else: assert st.filtration(simplex[0]) == 0. - |