@@ -103,8 +103,8 @@ def test_tth_to_q_bad(inputs, expected):
103103 ([np .array ([])], np .array ([])),
104104 # UC2: User specified valid q values
105105 (
106- [np .array ([np . pi / 6 , 1 * np .pi , 2 * np .pi , 3 * np .pi , 4 * np .pi , 5 * np .pi ])],
107- np .array ([0.4 , 0.5 , 0.66667 , 1 , 2 , 12 ]),
106+ [np .array ([5 * np .pi , 4 * np .pi , 3 * np .pi , 2 * np .pi , np .pi , 0 ])],
107+ np .array ([0.4 , 0.5 , 0.66667 , 1 , 2 , np . inf ]),
108108 ),
109109]
110110
@@ -115,31 +115,13 @@ def test_q_to_d(inputs, expected):
115115 assert np .allclose (actual , expected )
116116
117117
118- params_q_to_d_bad = [
119- # UC1: user specified an invalid q value that results in an infinite d value
120- (
121- [np .array ([0 , 1 , 2 , 3 , 4 ])],
122- [
123- ValueError ,
124- "Input values have resulted in an infinite output. Please ensure there are no zeros in the input." ,
125- ],
126- ),
127- ]
128-
129-
130- @pytest .mark .parametrize ("inputs, expected" , params_q_to_d_bad )
131- def test_q_to_d_bad (inputs , expected ):
132- with pytest .raises (expected [0 ], match = expected [1 ]):
133- q_to_d (inputs [0 ])
134-
135-
136118params_d_to_q = [
137119 # UC1: User specified empty d values
138120 ([np .array ([])], np .array ([])),
139121 # UC2: User specified valid d values
140122 (
141- [np .array ([np . pi / 6 , 1 * np .pi , 2 * np .pi , 3 * np .pi , 4 * np .pi , 5 * np .pi ])],
142- np .array ([0.4 , 0.5 , 0.66667 , 1 , 2 , 12 ]),
123+ [np .array ([0 , 1 * np .pi , 2 * np .pi , 3 * np .pi , 4 * np .pi , 5 * np .pi ])],
124+ np .array ([np . inf , 2 , 1 , 0.66667 , 0.5 , 0.4 ]),
143125 ),
144126]
145127
@@ -148,21 +130,3 @@ def test_q_to_d_bad(inputs, expected):
148130def test_d_to_q (inputs , expected ):
149131 actual = d_to_q (inputs [0 ])
150132 assert np .allclose (actual , expected )
151-
152-
153- params_d_to_q_bad = [
154- # UC1: user specified an invalid d value that results in an infinite q value
155- (
156- [np .array ([0 , 1 , 2 , 3 , 4 ])],
157- [
158- ValueError ,
159- "Input values have resulted in an infinite output. Please ensure there are no zeros in the input." ,
160- ],
161- ),
162- ]
163-
164-
165- @pytest .mark .parametrize ("inputs, expected" , params_d_to_q_bad )
166- def test_d_to_q_bad (inputs , expected ):
167- with pytest .raises (expected [0 ], match = expected [1 ]):
168- d_to_q (inputs [0 ])
0 commit comments