Skip to content

Commit 823acb2

Browse files
Jingjing TangJingjing Tang
Jingjing Tang
authored and
Jingjing Tang
committed
add parentheses for operations in tests
1 parent 75ac45f commit 823acb2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

quidel_covidtest/tests/test_data_tools.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ def test__geographical_pooling(self, min_obs, expected):
9292
@pytest.mark.parametrize("min_obs, expected_pos_prop, expected_se, expected_sample_sz", [
9393
(3, # one case of tests < min_obs
9494
np.array([np.nan, 2.5/5, 3.5/7, 4.5/11]),
95-
np.array([np.nan, np.sqrt(2.5**2/5**2/4), np.sqrt(3.5**2/7**2/6), np.sqrt(4.5*6.5/11**2/10)]),
95+
np.array([np.nan, np.sqrt(2.5*(5-2.5)/5/5/4), np.sqrt(3.5*(7-3.5)/7/7/6),
96+
np.sqrt(4.5*(11-4.5)/11/11/10)]),
9697
np.array([np.nan, 4, 6, 10])),
9798
(1, # no cases of tests < min_obs
9899
np.array([1.5/3, 2.5/5, 3.5/7, 4.5/11]),
99-
np.array([np.sqrt(1.5**2/3**2/2), np.sqrt(2.5**2/5**2/4), np.sqrt(3.5**2/7**2/6), np.sqrt(4.5*6.5/11**2/10)]),
100+
np.array([np.sqrt(1.5*(3-1.5)/3/3/2), np.sqrt(2.5*(5-2.5)/5/5/4),
101+
np.sqrt(3.5*(7-3.5)/7/7/6), np.sqrt(4.5*(11-4.5)/11/11/10)]),
100102
np.array([2, 4, 6, 10])),
101103
])
102104
def test_raw_positive_prop(self, min_obs, expected_pos_prop, expected_se, expected_sample_sz):
@@ -124,15 +126,17 @@ def test_raw_positive_prop(self, min_obs, expected_pos_prop, expected_se, expect
124126
None,
125127
None,
126128
np.array([np.nan, 3.5/7, 5.5/11, 7.5/17]),
127-
np.array([np.nan, np.sqrt(3.5**2/7**2/6), np.sqrt(5.5**2/11**2/10), np.sqrt(7.5*9.5/17**2/16)]),
129+
np.array([np.nan, np.sqrt(3.5*(7-3.5)/7/7/6), np.sqrt(5.5*(11-5.5)/11/11/10),
130+
np.sqrt(7.5*(17-7.5)/17/17/16)]),
128131
np.array([np.nan, 6, 10, 16]),
129132
),
130133
(3, # parents case
131134
2,
132135
np.array([3, 7, 9, 11]),
133136
np.array([5, 10, 15, 20]),
134137
np.array([(1 + 0.6 + 0.5)/(2 + 1 + 1), 3.5/7, 5.5/11, 7.5/17]),
135-
np.array([np.sqrt(2.1 * 1.9/4**2/3), np.sqrt(3.5**2/7**2/6), np.sqrt(5.5**2/11**2/10), np.sqrt(7.5*9.5/17**2/16)]),
138+
np.array([np.sqrt(2.1*(4-2.1)/4/4/3), np.sqrt(3.5*(7-3.5)/7/7/6),
139+
np.sqrt(5.5*(11-5.5)/11/11/10), np.sqrt(7.5*(17-7.5)/17/17/16)]),
136140
np.array([3, 6, 10, 16]),
137141
),
138142
])

0 commit comments

Comments
 (0)