@@ -70,13 +70,13 @@ def test_euclidean_norm_minus_one(
7070 expected_length = math .ceil (len (test_time ) / 5 )
7171 enmo_results = metrics .euclidean_norm_minus_one (test_acceleration )
7272
73- assert np .all (
74- np . isclose ( enmo_results . measurements , expected_enmo )
75- ), f"Expected { expected_enmo } "
73+ assert np .all (np . isclose ( enmo_results . measurements , expected_enmo )), (
74+ f"Expected { expected_enmo } "
75+ )
7676
77- assert (
78- len ( enmo_results . time ) == expected_length
79- ), "Input time attribute does not match output time attribute."
77+ assert len ( enmo_results . time ) == expected_length , (
78+ "Input time attribute does not match output time attribute."
79+ )
8080
8181
8282@pytest .mark .parametrize (
@@ -106,9 +106,9 @@ def test_angle_relative_to_horizontal(
106106 np .isclose (angle_z_results .measurements , expected_anglez , equal_nan = True )
107107 ), f"Expected { expected_anglez } , got: { angle_z_results .measurements } "
108108
109- assert (
110- len ( angle_z_results . time ) == expected_length
111- ), "Input time attribute does not match output time attribute."
109+ assert len ( angle_z_results . time ) == expected_length , (
110+ "Input time attribute does not match output time attribute."
111+ )
112112
113113
114114@pytest .mark .parametrize (
@@ -130,9 +130,9 @@ def test_cleanup_isolated_ones_nonwear_value(
130130 """Test the cleanup isolated ones nonwear value function."""
131131 test_result = metrics ._cleanup_isolated_ones_nonwear_value (nonwear_value_array )
132132
133- assert np .all (
134- test_result == expected_result
135- ), f"Expected { expected_result } , got: { test_result } "
133+ assert np .all (test_result == expected_result ), (
134+ f"Expected { expected_result } , got: { test_result } "
135+ )
136136
137137
138138def test_group_acceleration_data_by_time () -> None :
@@ -173,9 +173,9 @@ def test_compute_nonwear_value_per_axis(
173173 acceleration_grouped ["X" ], std_criteria = modifier
174174 )
175175
176- assert (
177- test_resultx == expected_result
178- ), f"Expected { expected_result } , got: { test_resultx } "
176+ assert test_resultx == expected_result , (
177+ f"Expected { expected_result } , got: { test_resultx } "
178+ )
179179
180180
181181def test_compute_nonwear_value_array (create_acceleration : pl .DataFrame ) -> None :
@@ -194,12 +194,12 @@ def test_compute_nonwear_value_array(create_acceleration: pl.DataFrame) -> None:
194194 std_criteria = 1 ,
195195 )
196196
197- assert np .all (
198- test_result == expected_result
199- ), f"Expected { expected_result } , got: { test_result } "
200- assert (
201- len (test_result ) == expected_time_length
202- ), f"Expected time to be { expected_time_length } , got: { len ( test_result ) } "
197+ assert np .all (test_result == expected_result ), (
198+ f"Expected { expected_result } , got: { test_result } "
199+ )
200+ assert len ( test_result ) == expected_time_length , (
201+ f"Expected time to be { expected_time_length } , got: { len (test_result )} "
202+ )
203203
204204
205205@pytest .mark .parametrize (
@@ -229,12 +229,12 @@ def test_detect_nonwear(
229229 std_criteria = modifier ,
230230 )
231231
232- assert np .all (
233- test_result . measurements == modifier
234- ), f"Expected non-wear flag value to be { expected_result } , got: { test_result } "
235- assert (
236- len (test_result .time ) == expected_time_length
237- ), f"Expected time to be { expected_time_length } , got: { len ( test_result . time ) } "
232+ assert np .all (test_result . measurements == modifier ), (
233+ f"Expected non-wear flag value to be { expected_result } , got: { test_result } "
234+ )
235+ assert len ( test_result . time ) == expected_time_length , (
236+ f"Expected time to be { expected_time_length } , got: { len (test_result .time )} "
237+ )
238238
239239
240240def test_mean_amplitude_deviation_function (create_acceleration : pl .DataFrame ) -> None :
@@ -245,12 +245,12 @@ def test_mean_amplitude_deviation_function(create_acceleration: pl.DataFrame) ->
245245
246246 test_result = metrics .mean_amplitude_deviation (acceleration )
247247
248- assert np .all (
249- test_result . measurements == expected_result
250- ), f"Expected MAD value to be { expected_result } , got: { test_result } "
251- assert (
252- len (test_result .time ) == expected_time
253- ), f"Expected time to be { expected_time } , got: { len ( test_result . time ) } "
248+ assert np .all (test_result . measurements == expected_result ), (
249+ f"Expected MAD value to be { expected_result } , got: { test_result } "
250+ )
251+ assert len ( test_result . time ) == expected_time , (
252+ f"Expected time to be { expected_time } , got: { len (test_result .time )} "
253+ )
254254
255255
256256def test_ag_counts_null (create_acceleration : pl .DataFrame ) -> None :
@@ -262,9 +262,9 @@ def test_ag_counts_null(create_acceleration: pl.DataFrame) -> None:
262262
263263 ag_counts = metrics .actigraph_activity_counts (acceleration )
264264
265- assert np .all (
266- ag_counts . measurements == expected_result
267- ), f"Expected activity counts to be { expected_result } , got: { ag_counts } "
265+ assert np .all (ag_counts . measurements == expected_result ), (
266+ f"Expected activity counts to be { expected_result } , got: { ag_counts } "
267+ )
268268 assert len (ag_counts .time ) == expected_time
269269
270270
@@ -295,9 +295,9 @@ def test_ag_counts_max() -> None:
295295
296296 ag_counts = metrics .actigraph_activity_counts (acceleration )
297297
298- assert np .all (
299- ag_counts . measurements [ 2 :] == expected_result
300- ), f"Expected activity counts to be { expected_result } , got: { ag_counts } "
298+ assert np .all (ag_counts . measurements [ 2 :] == expected_result ), (
299+ f"Expected activity counts to be { expected_result } , got: { ag_counts } "
300+ )
301301
302302
303303@pytest .mark .parametrize ("temp_length" , [498 , 500 ])
0 commit comments