Skip to content

Commit fceec47

Browse files
committed
Move tomopy backend tests
1 parent d8e0028 commit fceec47

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

httomo_backends/__init__.py

Whitespace-only changes.

tests/__init__.py

Whitespace-only changes.

tests/test_tomopy.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
from httomo_backends.methods_database.backends.tomopy.supporting_funcs.misc.corr import (
2+
_calc_padding_median_filter3d,
3+
_calc_padding_remove_outlier3d,
4+
)
5+
from httomo_backends.methods_database.backends.tomopy.supporting_funcs.prep.stripe import (
6+
_calc_padding_stripes_detect3d,
7+
_calc_padding_stripes_mask3d,
8+
)
9+
10+
11+
def test_calc_padding_median_filter3d() -> None:
12+
kwargs: dict = {"size": 5, "ncore": 10}
13+
assert _calc_padding_median_filter3d(**kwargs) == (2, 2)
14+
15+
16+
def test_calc_padding_median_filter3d_defaults() -> None:
17+
# it defaults to size=3
18+
kwargs: dict = {}
19+
assert _calc_padding_median_filter3d(**kwargs) == (1, 1)
20+
21+
22+
def test_calc_padding_remove_outlier3d() -> None:
23+
kwargs: dict = {"size": 5, "ncore": 10}
24+
assert _calc_padding_remove_outlier3d(**kwargs) == (2, 2)
25+
26+
27+
def test_calc_padding_remove_outlier3d_defaults() -> None:
28+
# it defaults to size=3
29+
kwargs: dict = {}
30+
assert _calc_padding_remove_outlier3d(**kwargs) == (1, 1)
31+
32+
33+
# TODO: unclear if the following function's padding behaviour is
34+
# doing the right thing...
35+
36+
37+
def test_calc_padding_stripes_detect3d() -> None:
38+
kwargs: dict = {"size": 15, "radius": 2, "ncore": 10}
39+
assert _calc_padding_stripes_detect3d(**kwargs) == (2, 2)
40+
41+
42+
def test_calc_padding_stripes_detect3d_defaults() -> None:
43+
# it defaults to radius=3
44+
kwargs: dict = {}
45+
assert _calc_padding_stripes_detect3d(**kwargs) == (3, 3)
46+
47+
48+
def test_calc_padding_stripes_mask3d() -> None:
49+
kwargs: dict = {"threshold": 0.7, "min_stripe_depth": 5}
50+
assert _calc_padding_stripes_mask3d(**kwargs) == (5, 5)
51+
52+
53+
def test_calc_padding_stripes_mask3d_defaults() -> None:
54+
# it defaults to min_stripe_depth=10
55+
kwargs: dict = {}
56+
assert _calc_padding_stripes_mask3d(**kwargs) == (10, 10)

0 commit comments

Comments
 (0)