@@ -55,13 +55,13 @@ def test_euclidean_norm_minus_one(
5555 expected_length = math .ceil (len (test_time ) / 5 )
5656 enmo_results = metrics .euclidean_norm_minus_one (test_acceleration )
5757
58- assert np .all (
59- np . isclose ( enmo_results . measurements , expected_enmo )
60- ), f"Expected { expected_enmo } "
58+ assert np .all (np . isclose ( enmo_results . measurements , expected_enmo )), (
59+ f"Expected { expected_enmo } "
60+ )
6161
62- assert (
63- len ( enmo_results . time ) == expected_length
64- ), "Input time attribute does not match output time attribute."
62+ assert len ( enmo_results . time ) == expected_length , (
63+ "Input time attribute does not match output time attribute."
64+ )
6565
6666
6767@pytest .mark .parametrize (
@@ -91,9 +91,9 @@ def test_angle_relative_to_horizontal(
9191 np .isclose (angle_z_results .measurements , expected_anglez , equal_nan = True )
9292 ), f"Expected { expected_anglez } , got: { angle_z_results .measurements } "
9393
94- assert (
95- len ( angle_z_results . time ) == expected_length
96- ), "Input time attribute does not match output time attribute."
94+ assert len ( angle_z_results . time ) == expected_length , (
95+ "Input time attribute does not match output time attribute."
96+ )
9797
9898
9999@pytest .mark .parametrize (
@@ -115,9 +115,9 @@ def test_cleanup_isolated_ones_nonwear_value(
115115 """Test the cleanup isolated ones nonwear value function."""
116116 test_result = metrics ._cleanup_isolated_ones_nonwear_value (nonwear_value_array )
117117
118- assert np .all (
119- test_result == expected_result
120- ), f"Expected { expected_result } , got: { test_result } "
118+ assert np .all (test_result == expected_result ), (
119+ f"Expected { expected_result } , got: { test_result } "
120+ )
121121
122122
123123def test_group_acceleration_data_by_time () -> None :
@@ -158,9 +158,9 @@ def test_compute_nonwear_value_per_axis(
158158 acceleration_grouped ["X" ], std_criteria = modifier
159159 )
160160
161- assert (
162- test_resultx == expected_result
163- ), f"Expected { expected_result } , got: { test_resultx } "
161+ assert test_resultx == expected_result , (
162+ f"Expected { expected_result } , got: { test_resultx } "
163+ )
164164
165165
166166def test_compute_nonwear_value_array (create_acceleration : pl .DataFrame ) -> None :
@@ -179,12 +179,12 @@ def test_compute_nonwear_value_array(create_acceleration: pl.DataFrame) -> None:
179179 std_criteria = 1 ,
180180 )
181181
182- assert np .all (
183- test_result == expected_result
184- ), f"Expected { expected_result } , got: { test_result } "
185- assert (
186- len (test_result ) == expected_time_length
187- ), f"Expected time to be { expected_time_length } , got: { len ( test_result ) } "
182+ assert np .all (test_result == expected_result ), (
183+ f"Expected { expected_result } , got: { test_result } "
184+ )
185+ assert len ( test_result ) == expected_time_length , (
186+ f"Expected time to be { expected_time_length } , got: { len (test_result )} "
187+ )
188188
189189
190190@pytest .mark .parametrize (
@@ -214,12 +214,12 @@ def test_detect_nonwear(
214214 std_criteria = modifier ,
215215 )
216216
217- assert np .all (
218- test_result . measurements == modifier
219- ), f"Expected non-wear flag value to be { expected_result } , got: { test_result } "
220- assert (
221- len (test_result .time ) == expected_time_length
222- ), f"Expected time to be { expected_time_length } , got: { len ( test_result . time ) } "
217+ assert np .all (test_result . measurements == modifier ), (
218+ f"Expected non-wear flag value to be { expected_result } , got: { test_result } "
219+ )
220+ assert len ( test_result . time ) == expected_time_length , (
221+ f"Expected time to be { expected_time_length } , got: { len (test_result .time )} "
222+ )
223223
224224
225225def test_mean_amplitude_deviation_function (create_acceleration : pl .DataFrame ) -> None :
@@ -230,12 +230,12 @@ def test_mean_amplitude_deviation_function(create_acceleration: pl.DataFrame) ->
230230
231231 test_result = metrics .mean_amplitude_deviation (acceleration )
232232
233- assert np .all (
234- test_result . measurements == expected_result
235- ), f"Expected MAD value to be { expected_result } , got: { test_result } "
236- assert (
237- len (test_result .time ) == expected_time
238- ), f"Expected time to be { expected_time } , got: { len ( test_result . time ) } "
233+ assert np .all (test_result . measurements == expected_result ), (
234+ f"Expected MAD value to be { expected_result } , got: { test_result } "
235+ )
236+ assert len ( test_result . time ) == expected_time , (
237+ f"Expected time to be { expected_time } , got: { len (test_result .time )} "
238+ )
239239
240240
241241def test_ag_counts_null (create_acceleration : pl .DataFrame ) -> None :
@@ -247,9 +247,9 @@ def test_ag_counts_null(create_acceleration: pl.DataFrame) -> None:
247247
248248 ag_counts = metrics .actigraph_activity_counts (acceleration )
249249
250- assert np .all (
251- ag_counts . measurements == expected_result
252- ), f"Expected activity counts to be { expected_result } , got: { ag_counts } "
250+ assert np .all (ag_counts . measurements == expected_result ), (
251+ f"Expected activity counts to be { expected_result } , got: { ag_counts } "
252+ )
253253 assert len (ag_counts .time ) == expected_time
254254
255255
@@ -280,9 +280,9 @@ def test_ag_counts_max() -> None:
280280
281281 ag_counts = metrics .actigraph_activity_counts (acceleration )
282282
283- assert np .all (
284- ag_counts . measurements [ 2 :] == expected_result
285- ), f"Expected activity counts to be { expected_result } , got: { ag_counts } "
283+ assert np .all (ag_counts . measurements [ 2 :] == expected_result ), (
284+ f"Expected activity counts to be { expected_result } , got: { ag_counts } "
285+ )
286286
287287
288288@pytest .mark .parametrize ("temp_length" , [498 , 500 ])
0 commit comments