@@ -54,17 +54,17 @@ def test_euclidean_norm_minus_one(
5454
5555 enmo_results = metrics .euclidean_norm_minus_one (test_acceleration )
5656
57- assert np .all (
58- np . isclose ( enmo_results . measurements , expected_enmo )
59- ), f"Expected { expected_enmo } "
57+ assert np .all (np . isclose ( enmo_results . measurements , expected_enmo )), (
58+ f"Expected { expected_enmo } "
59+ )
6060
61- assert enmo_results .time .equals (
62- test_acceleration . time
63- ), "Input time attribute does not match output time attribute."
61+ assert enmo_results .time .equals (test_acceleration . time ), (
62+ "Input time attribute does not match output time attribute."
63+ )
6464
65- assert enmo_results .measurements .shape == (
66- TEST_LENGTH ,
67- ), f"Expected enmo shape: ( { TEST_LENGTH } ,), got ( { enmo_results . measurements . shape } )"
65+ assert enmo_results .measurements .shape == (TEST_LENGTH ,), (
66+ f"Expected enmo shape: ( { TEST_LENGTH } ,), got ( { enmo_results . measurements . shape } )"
67+ )
6868
6969
7070@pytest .mark .parametrize (
@@ -93,12 +93,12 @@ def test_angle_relative_to_horizontal(
9393 np .isclose (angle_z_results .measurements , expected_anglez , equal_nan = True )
9494 ), f"Expected { expected_anglez } , got: { angle_z_results .measurements } "
9595
96- assert angle_z_results .time .equals (
97- test_acceleration . time
98- ), "Input time attribute does not match output time attribute."
96+ assert angle_z_results .time .equals (test_acceleration . time ), (
97+ "Input time attribute does not match output time attribute."
98+ )
9999
100100 assert angle_z_results .measurements .shape == (1 ,), (
101- f"Expected anglez shape: { (1 ,)} ," f" got({ angle_z_results .measurements .shape } )"
101+ f"Expected anglez shape: { (1 ,)} ,got({ angle_z_results .measurements .shape } )"
102102 )
103103
104104
@@ -121,9 +121,9 @@ def test_cleanup_isolated_ones_nonwear_value(
121121 """Test the cleanup isolated ones nonwear value function."""
122122 test_result = metrics ._cleanup_isolated_ones_nonwear_value (nonwear_value_array )
123123
124- assert np .all (
125- test_result == expected_result
126- ), f"Expected { expected_result } , got: { test_result } "
124+ assert np .all (test_result == expected_result ), (
125+ f"Expected { expected_result } , got: { test_result } "
126+ )
127127
128128
129129def test_group_acceleration_data_by_time () -> None :
@@ -164,9 +164,9 @@ def test_compute_nonwear_value_per_axis(
164164 acceleration_grouped ["X" ], std_criteria = modifier
165165 )
166166
167- assert (
168- test_resultx == expected_result
169- ), f"Expected { expected_result } , got: { test_resultx } "
167+ assert test_resultx == expected_result , (
168+ f"Expected { expected_result } , got: { test_resultx } "
169+ )
170170
171171
172172def test_compute_nonwear_value_array (create_acceleration : pl .DataFrame ) -> None :
@@ -185,12 +185,12 @@ def test_compute_nonwear_value_array(create_acceleration: pl.DataFrame) -> None:
185185 std_criteria = 1 ,
186186 )
187187
188- assert np .all (
189- test_result == expected_result
190- ), f"Expected { expected_result } , got: { test_result } "
191- assert (
192- len (test_result ) == expected_time_length
193- ), f"Expected time to be { expected_time_length } , got: { len ( test_result ) } "
188+ assert np .all (test_result == expected_result ), (
189+ f"Expected { expected_result } , got: { test_result } "
190+ )
191+ assert len ( test_result ) == expected_time_length , (
192+ f"Expected time to be { expected_time_length } , got: { len (test_result )} "
193+ )
194194
195195
196196@pytest .mark .parametrize (
@@ -220,12 +220,12 @@ def test_detect_nonwear(
220220 std_criteria = modifier ,
221221 )
222222
223- assert np .all (
224- test_result . measurements == modifier
225- ), f"Expected non-wear flag value to be { expected_result } , got: { test_result } "
226- assert (
227- len (test_result .time ) == expected_time_length
228- ), f"Expected time to be { expected_time_length } , got: { len ( test_result . time ) } "
223+ assert np .all (test_result . measurements == modifier ), (
224+ f"Expected non-wear flag value to be { expected_result } , got: { test_result } "
225+ )
226+ assert len ( test_result . time ) == expected_time_length , (
227+ f"Expected time to be { expected_time_length } , got: { len (test_result .time )} "
228+ )
229229
230230
231231def test_mean_amplitude_deviation_function (create_acceleration : pl .DataFrame ) -> None :
@@ -236,12 +236,12 @@ def test_mean_amplitude_deviation_function(create_acceleration: pl.DataFrame) ->
236236
237237 test_result = metrics .mean_amplitude_deviation (acceleration )
238238
239- assert np .all (
240- test_result . measurements == expected_result
241- ), f"Expected MAD value to be { expected_result } , got: { test_result } "
242- assert (
243- len (test_result .time ) == expected_time
244- ), f"Expected time to be { expected_time } , got: { len ( test_result . time ) } "
239+ assert np .all (test_result . measurements == expected_result ), (
240+ f"Expected MAD value to be { expected_result } , got: { test_result } "
241+ )
242+ assert len ( test_result . time ) == expected_time , (
243+ f"Expected time to be { expected_time } , got: { len (test_result .time )} "
244+ )
245245
246246
247247def test_ag_counts_null (create_acceleration : pl .DataFrame ) -> None :
@@ -253,9 +253,9 @@ def test_ag_counts_null(create_acceleration: pl.DataFrame) -> None:
253253
254254 ag_counts = metrics .actigraph_activity_counts (acceleration )
255255
256- assert np .all (
257- ag_counts . measurements == expected_result
258- ), f"Expected activity counts to be { expected_result } , got: { ag_counts } "
256+ assert np .all (ag_counts . measurements == expected_result ), (
257+ f"Expected activity counts to be { expected_result } , got: { ag_counts } "
258+ )
259259 assert len (ag_counts .time ) == expected_time
260260
261261
@@ -286,6 +286,6 @@ def test_ag_counts_max() -> None:
286286
287287 ag_counts = metrics .actigraph_activity_counts (acceleration )
288288
289- assert np .all (
290- ag_counts . measurements [ 2 :] == expected_result
291- ), f"Expected activity counts to be { expected_result } , got: { ag_counts } "
289+ assert np .all (ag_counts . measurements [ 2 :] == expected_result ), (
290+ f"Expected activity counts to be { expected_result } , got: { ag_counts } "
291+ )
0 commit comments