From 2b4dee3e21436e266f77e0dee1d8257b6688e2e5 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Mon, 20 Nov 2023 23:53:53 +1100 Subject: [PATCH] improve test for int dtype skeletons --- src/skan/test/test_csr.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/skan/test/test_csr.py b/src/skan/test/test_csr.py index ff8674af..fd595972 100644 --- a/src/skan/test/test_csr.py +++ b/src/skan/test/test_csr.py @@ -1,4 +1,5 @@ from collections import defaultdict +from itertools import product import pytest import numpy as np @@ -316,8 +317,16 @@ def test_skeleton_path_image_no_keep_image(): assert np.max(pli) == s.n_paths -def test_skeletonlabel(): - stats = csr.summarize(csr.Skeleton(skeletonlabel), separator='_') +@pytest.mark.parametrize( + 'dtype', [ + ''.join([pre, 'int', suf]) + for pre, suf in product(['u', ''], ['8', '16', '32', '64']) + ] + ) +def test_skeleton_integer_dtype(dtype): + stats = csr.summarize( + csr.Skeleton(skeletonlabel.astype(dtype)), separator='_' + ) assert stats['mean_pixel_value'].max() == skeletonlabel.max() assert stats['mean_pixel_value'].max() > 1