summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorVincent Rouvreau <vincent.rouvreau@inria.fr>2022-03-21 17:14:30 +0100
committerVincent Rouvreau <vincent.rouvreau@inria.fr>2022-03-21 17:14:30 +0100
commit8667b75601cc0420f3b196d5b44ec93fd6058057 (patch)
treeaf3d8872b98db0eaba90c8b5f30cc85d8b87357d /src/python
parentd114eaf05a4d622045acea1d7fdced20e7139e53 (diff)
Add some c++ tests and use unitary_tests_utils. Fix python test
Diffstat (limited to 'src/python')
-rwxr-xr-xsrc/python/test/test_simplex_tree.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py
index d8173b52..eb481a49 100755
--- a/src/python/test/test_simplex_tree.py
+++ b/src/python/test/test_simplex_tree.py
@@ -531,8 +531,6 @@ def test_expansion_with_blocker():
st.insert([5,6],10)
st.insert([6],10)
- # One cannot modify filtration inside blocker - segfault - Let's record accepted simplices
- accepted_simp = []
def blocker(simplex):
try:
# Block all simplices that countains vertex 6
@@ -541,12 +539,10 @@ def test_expansion_with_blocker():
return True
except ValueError:
print(simplex, ' is accepted')
- accepted_simp.append(simplex)
+ st.assign_filtration(simplex, st.filtration(simplex) + 1.)
return False
st.expansion_with_blocker(2, blocker)
- for simplex in accepted_simp:
- st.assign_filtration(simplex, st.filtration(simplex) + 1.)
assert st.num_simplices() == 22
assert st.dimension() == 2
assert st.find([4,5,6]) == False
@@ -555,10 +551,7 @@ def test_expansion_with_blocker():
assert st.filtration([0,2,3]) == 6.
assert st.filtration([1,2,3]) == 6.
- accepted_simp = []
st.expansion_with_blocker(3, blocker)
- for simplex in accepted_simp:
- st.assign_filtration(simplex, st.filtration(simplex) + 1.)
assert st.num_simplices() == 23
assert st.dimension() == 3
assert st.find([4,5,6]) == False
@@ -566,4 +559,4 @@ def test_expansion_with_blocker():
assert st.filtration([0,1,3]) == 5.
assert st.filtration([0,2,3]) == 6.
assert st.filtration([1,2,3]) == 6.
- assert st.filtration([0,1,2,3]) == 6.
+ assert st.filtration([0,1,2,3]) == 7.