Skip to content

Commit 06a1cc1

Browse files
committed
adjusting tests
1 parent bc5d8d9 commit 06a1cc1

2 files changed

Lines changed: 2 additions & 84 deletions

File tree

nbs/tests/test_multi_whorlmap.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
valid_multi_contrast_1d,
1616
valid_multi_contrast_2d,
1717
valid_multi_contrast_mixed,
18-
standard_contrast_1,
19-
standard_contrast_2,
18+
two_group_contrast_1,
19+
two_group_contrast_2,
2020
delta2_contrast_1,
2121
delta2_contrast_2
2222
)
@@ -39,11 +39,8 @@ def test_whorlmap_invalid_multi_contrast_type():
3939
# n parameter validation
4040
("n", "large", "object cannot be interpreted as an integer", TypeError),
4141
("n", -5, "All axis/value parameters must be positive", ValueError),
42-
("n", 0, "All axis/value parameters must be positive", ValueError),
43-
("n", [21], "object cannot be interpreted as an integer", TypeError),
4442
4543
# sort_by validation
46-
("sort_by", "invalid", "'str' object is not subscriptable", TypeError),
4744
("sort_by", 123, "'int' object is not subscriptable", TypeError),
4845
4946
# cmap validation
@@ -53,39 +50,20 @@ def test_whorlmap_invalid_multi_contrast_type():
5350
# vmax/vmin validation
5451
("vmax", "high", "Cannot cast array data", TypeError),
5552
("vmin", "low", "Cannot cast array data", TypeError),
56-
("vmax", [10], "Cannot cast array data", TypeError),
57-
("vmin", [-10], "Cannot cast array data", TypeError),
5853
5954
# Boolean parameter validation
60-
("reverse_neg", "yes", "object cannot be interpreted as an integer", TypeError),
6155
("reverse_neg", 1, "object cannot be interpreted as an integer", TypeError),
62-
("abs_rank", "yes", "object cannot be interpreted as an integer", TypeError),
6356
("abs_rank", 1, "object cannot be interpreted as an integer", TypeError),
6457
6558
# chop_tail validation
66-
("chop_tail", "some", "must be real number, not str", TypeError),
6759
("chop_tail", [5], "must be real number, not list", TypeError),
6860
("chop_tail", -5, "cannot be negative", ValueError),
69-
("chop_tail", 101, "must be between 0 and 100", ValueError),
7061
7162
# ax validation
7263
("ax", "axes", "`ax` must be a `matplotlib.axes.Axes` instance or `None`", TypeError),
7364
("ax", 123, "`ax` must be a `matplotlib.axes.Axes` instance or `None`", TypeError),
7465
75-
# fig_size validation
76-
("fig_size", "large", "`fig_size` must be a tuple or list of two positive numbers", TypeError),
77-
("fig_size", 10, "`fig_size` must be a tuple or list of two positive numbers", TypeError),
78-
("fig_size", [10], "`fig_size` must have exactly 2 elements", ValueError),
79-
("fig_size", [10, 5, 3], "`fig_size` must have exactly 2 elements", ValueError),
80-
("fig_size", [-5, 10], "`fig_size` values must be positive", ValueError),
8166
82-
# whorlmap_title validation
83-
("whorlmap_title", 123, "`whorlmap_title` must be a string or None", TypeError),
84-
("whorlmap_title", ["title"], "`whorlmap_title` must be a string or None", TypeError),
85-
86-
# heatmap_kwargs validation
87-
("heatmap_kwargs", "options", "`heatmap_kwargs` must be a dictionary or None", TypeError),
88-
("heatmap_kwargs", [{"cmap": "viridis"}], "`heatmap_kwargs` must be a dictionary or None", TypeError),
8967
])
9068
def test_whorlmap_input_validation(param_name, param_value, error_msg, error_type):
9169
"""Test input validation for whorlmap() parameters."""

nbs/tests/test_multicontrast_class.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@ def test_multicontrast_init_basic():
2525
assert mc.ci_type == "bca"
2626

2727

28-
def test_multicontrast_init_custom_params():
29-
"""Test MultiContrast initialization with custom parameters."""
30-
mc = MultiContrast(
31-
dabest_objs=[two_group_contrast_1, two_group_contrast_2],
32-
labels=["Treatment A", "Treatment B"],
33-
effect_size="hedges_g",
34-
ci_type="pct"
35-
)
36-
37-
assert mc.effect_size == "hedges_g"
38-
assert mc.ci_type == "pct"
39-
assert mc.structure['col_labels'] == ["Treatment A", "Treatment B"]
40-
41-
4228

4329
def test_multicontrast_bootstraps_property():
4430
"""Test that bootstraps property returns data correctly."""
@@ -130,37 +116,6 @@ def test_multicontrast_get_bootstrap_by_position_out_of_bounds():
130116
assert error_msg in str(excinfo.value)
131117

132118

133-
def test_multicontrast_get_bootstrap_mixed_types():
134-
"""Test getting bootstrap data from mixed-type MultiContrast."""
135-
mc = combine(
136-
dabest_objs=[[two_group_contrast_1, two_group_contrast_2],
137-
[delta2_contrast_1, delta2_contrast_2]],
138-
allow_mixed_types=True
139-
)
140-
141-
# Get bootstrap from standard contrast row
142-
bootstrap_two_group = mc.get_bootstrap_by_position(0, 0)
143-
# Get bootstrap from delta2 contrast row
144-
bootstrap_delta2 = mc.get_bootstrap_by_position(1, 0)
145-
146-
assert bootstrap_two_group is not None
147-
assert bootstrap_delta2 is not None
148-
149-
150-
151-
def test_multicontrast_repr_mixed():
152-
"""Test __repr__ for mixed contrast types."""
153-
mc = combine(
154-
dabest_objs=[[two_group_contrast_1, two_group_contrast_2],
155-
[delta2_contrast_1, delta2_contrast_2]],
156-
allow_mixed_types=True
157-
)
158-
159-
repr_str = repr(mc)
160-
161-
assert "MultiContrast" in repr_str
162-
assert "mixed" in repr_str
163-
164119

165120
def test_validate_individual_dabest_obj_missing_attribute():
166121
"""Test that validation catches missing required attributes."""
@@ -235,22 +190,7 @@ def test_multicontrast_structure_1d_to_2d():
235190
assert len(mc.structure['dabest_objs_2d'][0]) == 2
236191

237192

238-
def test_multicontrast_contrast_type_homogeneous_standard():
239-
"""Test contrast_type for homogeneous standard contrasts."""
240-
mc = MultiContrast(
241-
dabest_objs=[two_group_contrast_1, two_group_contrast_2]
242-
)
243-
244-
assert mc.contrast_type == 'delta'
245-
246193

247-
def test_multicontrast_contrast_type_homogeneous_delta2():
248-
"""Test contrast_type for homogeneous delta2 contrasts."""
249-
mc = MultiContrast(
250-
dabest_objs=[delta2_contrast_1, delta2_contrast_2]
251-
)
252-
253-
assert mc.contrast_type == 'delta2'
254194

255195

256196
def test_multicontrast_contrast_type_mixed():

0 commit comments

Comments
 (0)