summaryrefslogtreecommitdiff
path: root/src/python/test
diff options
context:
space:
mode:
authorMathieuCarriere <mathieu.carriere3@gmail.com>2022-05-18 09:09:12 +0200
committerMathieuCarriere <mathieu.carriere3@gmail.com>2022-05-18 09:09:12 +0200
commit4dd9bc67a87415cef901926172f5374522daf61d (patch)
tree8210a7eb4a6ea0561896f67680b4fa5c949df3ce /src/python/test
parent9422b2bf82624d1b5e982fe12e202e14d24256f7 (diff)
parentc7afe82e863eb91d122d34f1d34255c04e27b51f (diff)
Merge branch 'master' of https://github.com/GUDHI/gudhi-devel into diff
Diffstat (limited to 'src/python/test')
-rw-r--r--src/python/test/test_persistence_graphical_tools.py12
-rwxr-xr-xsrc/python/test/test_simplex_tree.py17
2 files changed, 14 insertions, 15 deletions
diff --git a/src/python/test/test_persistence_graphical_tools.py b/src/python/test/test_persistence_graphical_tools.py
index 7d9bae90..c19836b7 100644
--- a/src/python/test/test_persistence_graphical_tools.py
+++ b/src/python/test/test_persistence_graphical_tools.py
@@ -15,7 +15,7 @@ import pytest
def test_array_handler():
- diags = np.array([[1, 2], [3, 4], [5, 6]], np.float)
+ diags = np.array([[1, 2], [3, 4], [5, 6]], float)
arr_diags = gd.persistence_graphical_tools._array_handler(diags)
for idx in range(len(diags)):
assert arr_diags[idx][0] == 0
@@ -96,10 +96,14 @@ def test_limit_to_max_intervals():
def _limit_plot_persistence(function):
- pplot = function(persistence=[()])
- assert issubclass(type(pplot), plt.axes.SubplotBase)
+ pplot = function(persistence=[])
+ assert isinstance(pplot, plt.axes.SubplotBase)
+ pplot = function(persistence=[], legend=True)
+ assert isinstance(pplot, plt.axes.SubplotBase)
pplot = function(persistence=[(0, float("inf"))])
- assert issubclass(type(pplot), plt.axes.SubplotBase)
+ assert isinstance(pplot, plt.axes.SubplotBase)
+ pplot = function(persistence=[(0, float("inf"))], legend=True)
+ assert isinstance(pplot, plt.axes.SubplotBase)
def test_limit_plot_persistence():
diff --git a/src/python/test/test_simplex_tree.py b/src/python/test/test_simplex_tree.py
index eb481a49..688f4fd6 100755
--- a/src/python/test/test_simplex_tree.py
+++ b/src/python/test/test_simplex_tree.py
@@ -8,7 +8,7 @@
- YYYY/MM Author: Description of the modification
"""
-from gudhi import SimplexTree, __GUDHI_USE_EIGEN3
+from gudhi import SimplexTree
import numpy as np
import pytest
@@ -354,16 +354,11 @@ def test_collapse_edges():
assert st.num_simplices() == 10
- if __GUDHI_USE_EIGEN3:
- 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.
- else:
- # If no Eigen3, collapse_edges throws an exception
- with pytest.raises(RuntimeError):
- st.collapse_edges()
+ st.collapse_edges()
+ assert st.num_simplices() == 9
+ assert st.find([0, 2]) == False # [1, 3] would be fine as well
+ for simplex in st.get_skeleton(0):
+ assert simplex[1] == 1.
def test_reset_filtration():
st = SimplexTree()