Skip to content

Commit 5e338e3

Browse files
author
github-actions
committed
Apply Black Formatting
1 parent 26a5b05 commit 5e338e3

File tree

2 files changed

+38
-21
lines changed

2 files changed

+38
-21
lines changed

kielmat/modules/pam/_pam.py

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -201,38 +201,56 @@ def detect(
201201
.agg(
202202
sedentary_mean_enmo=(
203203
"enmo",
204-
lambda x: np.nanmean(
205-
x[classified_processed_data.loc[x.index, "sedentary"] == 1]
206-
)
207-
if len(x[classified_processed_data.loc[x.index, "sedentary"] == 1]) > 0
208-
else 0,
204+
lambda x: (
205+
np.nanmean(
206+
x[classified_processed_data.loc[x.index, "sedentary"] == 1]
207+
)
208+
if len(
209+
x[classified_processed_data.loc[x.index, "sedentary"] == 1]
210+
)
211+
> 0
212+
else 0
213+
),
209214
),
210215
sedentary_time_min=("sedentary_time_min", "sum"),
211216
light_mean_enmo=(
212217
"enmo",
213-
lambda x: np.nanmean(
214-
x[classified_processed_data.loc[x.index, "light"] == 1]
215-
)
216-
if len(x[classified_processed_data.loc[x.index, "light"] == 1]) > 0
217-
else 0,
218+
lambda x: (
219+
np.nanmean(
220+
x[classified_processed_data.loc[x.index, "light"] == 1]
221+
)
222+
if len(x[classified_processed_data.loc[x.index, "light"] == 1])
223+
> 0
224+
else 0
225+
),
218226
),
219227
light_time_min=("light_time_min", "sum"),
220228
moderate_mean_enmo=(
221229
"enmo",
222-
lambda x: np.nanmean(
223-
x[classified_processed_data.loc[x.index, "moderate"] == 1]
224-
)
225-
if len(x[classified_processed_data.loc[x.index, "moderate"] == 1]) > 0
226-
else 0,
230+
lambda x: (
231+
np.nanmean(
232+
x[classified_processed_data.loc[x.index, "moderate"] == 1]
233+
)
234+
if len(
235+
x[classified_processed_data.loc[x.index, "moderate"] == 1]
236+
)
237+
> 0
238+
else 0
239+
),
227240
),
228241
moderate_time_min=("moderate_time_min", "sum"),
229242
vigorous_mean_enmo=(
230243
"enmo",
231-
lambda x: np.nanmean(
232-
x[classified_processed_data.loc[x.index, "vigorous"] == 1]
233-
)
234-
if len(x[classified_processed_data.loc[x.index, "vigorous"] == 1]) > 0
235-
else 0,
244+
lambda x: (
245+
np.nanmean(
246+
x[classified_processed_data.loc[x.index, "vigorous"] == 1]
247+
)
248+
if len(
249+
x[classified_processed_data.loc[x.index, "vigorous"] == 1]
250+
)
251+
> 0
252+
else 0
253+
),
236254
),
237255
vigorous_time_min=("vigorous_time_min", "sum"),
238256
)

kielmat/utils/viz_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def plot_pam(hourly_average_data):
9191
plt.show()
9292

9393

94-
9594
# Function to plot results of the postural transition detection algorithm
9695
def plot_postural_transitions(accel, gyro, postural_transitions_, sampling_freq_Hz):
9796
"""

0 commit comments

Comments
 (0)