summaryrefslogtreecommitdiff
path: root/src/python/test/test_simplex_tree.py
diff options
context:
space:
mode:
authorwreise <wojciech.reise@epfl.ch>2022-08-10 10:28:26 +0200
committerwreise <wojciech.reise@epfl.ch>2022-08-10 10:28:26 +0200
commitb9a31fed2b90ee69a5c23047fd2ff1c264ad9605 (patch)
treec7a6e319c5cc6ba9c7963b08f7a4cdf3c776c922 /src/python/test/test_simplex_tree.py
parent60e57f9c86a7aae67c2931200066aba059ec2721 (diff)
parent4f83706aa1263c04cb5e8763e1e8eb6c580bed3c (diff)
Merge branch 'master' into optimize_silhouettes
Diffstat (limited to 'src/python/test/test_simplex_tree.py')
-rwxr-xr-xsrc/python/test/test_simplex_tree.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py
index 688f4fd6..54bafed5 100755
--- a/src/python/test/test_simplex_tree.py
+++ b/src/python/test/test_simplex_tree.py
@@ -320,6 +320,10 @@ def test_extend_filtration():
]
dgms = st.extended_persistence(min_persistence=-1.)
+ assert len(dgms) == 4
+ # Sort by (death-birth) descending - we are only interested in those with the longest life span
+ for idx in range(4):
+ dgms[idx] = sorted(dgms[idx], key=lambda x:(-abs(x[1][0]-x[1][1])))
assert dgms[0][0][1][0] == pytest.approx(2.)
assert dgms[0][0][1][1] == pytest.approx(3.)
@@ -528,7 +532,7 @@ def test_expansion_with_blocker():
def blocker(simplex):
try:
- # Block all simplices that countains vertex 6
+ # Block all simplices that contain vertex 6
simplex.index(6)
print(simplex, ' is blocked')
return True