From 2745d59751e862701d675470994978ca460ac870 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 25 May 2018 13:21:43 +0000 Subject: Fix bug on Cubical reported by user. Add test on Python level. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3461 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fffa8df624f81427d0feef6ddc3f8a567aa2d366 --- src/cython/test/test_cubical_complex.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/cython/test') diff --git a/src/cython/test/test_cubical_complex.py b/src/cython/test/test_cubical_complex.py index 79d39aa8..92e591e9 100755 --- a/src/cython/test/test_cubical_complex.py +++ b/src/cython/test/test_cubical_complex.py @@ -72,6 +72,17 @@ def test_dimension_simple_constructor(): assert cub.betti_numbers() == [1, 0, 0] assert cub.persistent_betti_numbers(0, 1000) == [0, 0, 0] +def test_user_case_simple_constructor(): + cub = CubicalComplex(dimensions=[3, 3], + top_dimensional_cells = [float('inf'), 0.,0.,0.,1.,0.,0.,0.,0.]) + assert cub.__is_defined() == True + assert cub.__is_persistence_defined() == False + assert cub.persistence() == [(1, (0.0, 1.0)), (0, (0.0, float('inf')))] + assert cub.__is_persistence_defined() == True + other_cub = CubicalComplex(dimensions=[3, 3], + top_dimensional_cells = [1000., 0.,0.,0.,1.,0.,0.,0.,0.]) + assert other_cub.persistence() == [(1, (0.0, 1.0)), (0, (0.0, float('inf')))] + def test_dimension_file_constructor(): # Create test file test_file = open('CubicalOneSphere.txt', 'w') -- cgit v1.2.3