From 9478dc94f2efc03ff2baa2c686ed02ad0c9d8328 Mon Sep 17 00:00:00 2001 From: junos Date: Wed, 16 Mar 2022 18:59:29 +0100 Subject: [PATCH] Add an else. This is to make sure that in case the reversing fails, we do not get any output items. Snakemake will inform us of an error in this event. --- src/features/phone_esm/straw/preprocess.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/features/phone_esm/straw/preprocess.py b/src/features/phone_esm/straw/preprocess.py index ce2a9bf3..5f141759 100644 --- a/src/features/phone_esm/straw/preprocess.py +++ b/src/features/phone_esm/straw/preprocess.py @@ -15,5 +15,7 @@ else: df_esm_selected = df_esm_preprocessed[df_esm_preprocessed["questionnaire_id"] == questionnaire_id] df_esm_clean = clean_up_esm(df_esm_selected) if questionnaire_name.startswith("JCQ"): - df_esm_clean = reverse_jcq_demand_control_scoring(df_esm_clean) - df_esm_clean.to_csv(snakemake.output[0]) + df_esm_reversed = reverse_jcq_demand_control_scoring(df_esm_clean) + df_esm_reversed.to_csv(snakemake.output[0]) + else: + df_esm_clean.to_csv(snakemake.output[0])