diff options
author | wreise <wojciech.reise@epfl.ch> | 2022-10-07 17:59:51 +0200 |
---|---|---|
committer | wreise <wojciech.reise@epfl.ch> | 2022-10-07 17:59:51 +0200 |
commit | 565cc1fb0c81b627fa6bec0e9ca76571663a7834 (patch) | |
tree | 9755a645e9d86d04fbb6d3300e6f561bf5dded02 /src/python/test/test_representations.py | |
parent | b9a31fed2b90ee69a5c23047fd2ff1c264ad9605 (diff) |
Test: resolution when nan in the range
Diffstat (limited to 'src/python/test/test_representations.py')
-rwxr-xr-x | src/python/test/test_representations.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/python/test/test_representations.py b/src/python/test/test_representations.py index 2ca72d07..823e8620 100755 --- a/src/python/test/test_representations.py +++ b/src/python/test/test_representations.py @@ -241,3 +241,11 @@ def test_landscape_numeric(): lds = Landscape(num_landscapes=2, resolution=9, sample_range=[2., 6.]) lds_dgm = lds(dgm) assert np.all(np.isclose(lds_dgm, lds_ref)) + + +def test_landscape_nan_range(): + dgm = np.array([[2., 6.], [3., 5.]]) + lds = Landscape(num_landscapes=2, resolution=9, sample_range=[np.nan, 6.]) + lds_dgm = lds(dgm) + assert (lds.sample_range[0] == 2) & (lds.sample_range[1] == 6) + assert lds.new_resolution == 10 |