From 1374eda1719bc88748f46b0084ca1fb58dc23346 Mon Sep 17 00:00:00 2001 From: junos Date: Wed, 16 Mar 2022 17:38:09 +0100 Subject: [PATCH] Flatten questionnaire ID dict. --- config.yaml | 2 +- .../phone_esm/straw/esm_preprocess.py | 66 +++++++------------ 2 files changed, 26 insertions(+), 42 deletions(-) diff --git a/config.yaml b/config.yaml index 5c774a6e..e632516d 100644 --- a/config.yaml +++ b/config.yaml @@ -239,7 +239,7 @@ PHONE_ESM: PROVIDERS: STRAW: COMPUTE: True - FEATURES: + FEATURES: ["PANAS_positive_affect", "PANAS_negative_affect"] SRC_SCRIPT: src/features/phone_esm/rapids/main.py # See https://www.rapids.science/latest/features/phone-keyboard/ diff --git a/src/features/phone_esm/straw/esm_preprocess.py b/src/features/phone_esm/straw/esm_preprocess.py index 876be61e..4e99c48a 100644 --- a/src/features/phone_esm/straw/esm_preprocess.py +++ b/src/features/phone_esm/straw/esm_preprocess.py @@ -19,48 +19,32 @@ ESM_TYPE = { QUESTIONNAIRE_IDS = { "sleep_quality": 1, - "PANAS": { - "positive_affect": 8, - "negative_affect": 9 - }, - "job_content_questionnaire": { - "job_demand": 10, - "job_control": 11, - "supervisor_support": 12, - "coworker_support": 13, - }, - "PFITS": { - "supervisor": 14, - "coworkers": 15 - }, - "UWES": { - "vigor": 16, - "dedication": 17, - "absorption": 18 - }, - "COPE": { - "active": 19, - "support": 20, - "emotions": 21 - }, - "work_life_balance": { - "life_work": 22, - "work_life": 23 - }, - "recovery_experience": { - "detachment": 24, - "relaxation": 25 - }, + "PANAS_positive_affect": 8, + "PANAS_negative_affect": 9, + "JCQ_job_demand": 10, + "JCQ_job_control": 11, + "JCQ_supervisor_support": 12, + "JCQ_coworker_support": 13, + "PFITS_supervisor": 14, + "PFITS_coworkers": 15, + "UWES_vigor": 16, + "UWES_dedication": 17, + "UWES_absorption": 18, + "COPE_active": 19, + "COPE_support": 20, + "COPE_emotions": 21, + "balance_life_work": 22, + "balance_work_life": 23, + "recovery_experience_detachment": 24, + "recovery_experience_relaxation": 25, "symptoms": 26, - "stress_appraisal": { - "stressfulness_event": 87, - "threat": 88, - "challenge": 89, - "event_time": 90, - "event_duration": 91, - "event_work_related": 92, - "stressfulness_period": 93, - }, + "appraisal_stressfulness_event": 87, + "appraisal_threat": 88, + "appraisal_challenge": 89, + "appraisal_event_time": 90, + "appraisal_event_duration": 91, + "appraisal_event_work_related": 92, + "appraisal_stressfulness_period": 93, "late_work": 94, "work_hours": 95, "left_work": 96,