From d8e9a309f7b24d6d8f955469d5756e8442c199b5 Mon Sep 17 00:00:00 2001 From: junos Date: Tue, 8 Mar 2022 15:10:36 +0100 Subject: [PATCH 1/2] Rename features and write baseline_interim. --- src/data/baseline_features.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/data/baseline_features.py b/src/data/baseline_features.py index 918cba91..5c7c9137 100644 --- a/src/data/baseline_features.py +++ b/src/data/baseline_features.py @@ -94,9 +94,9 @@ if not participant_info.empty: + LIMESURVEY_JCQ_MIN - limesurvey_demand.loc[rows_demand_reverse, "score_original"] ) - pd.concat([baseline_interim, limesurvey_demand], axis=0, ignore_index=True) + baseline_interim = pd.concat([baseline_interim, limesurvey_demand], axis=0, ignore_index=True) if "demand" in requested_features: - baseline_features.loc[0, "limesurvey_demand"] = limesurvey_demand[ + baseline_features.loc[0, "demand"] = limesurvey_demand[ "score" ].sum() @@ -127,9 +127,11 @@ if not participant_info.empty: + LIMESURVEY_JCQ_MIN - limesurvey_control.loc[rows_control_reverse, "score_original"] ) - pd.concat([baseline_interim, limesurvey_control], axis=0, ignore_index=True) + + baseline_interim = pd.concat([baseline_interim, limesurvey_control], axis=0, ignore_index=True) + if "control" in requested_features: - baseline_features.loc[0, "limesurvey_control"] = limesurvey_control[ + baseline_features.loc[0, "control"] = limesurvey_control[ "score" ].sum() @@ -165,10 +167,10 @@ if not participant_info.empty: limesurvey_quartile = np.nan baseline_features.loc[ - 0, "limesurvey_demand_control_ratio" + 0, "demand_control_ratio" ] = limesurvey_demand_control_ratio baseline_features.loc[ - 0, "limesurvey_demand_control_ratio_quartile" + 0, "demand_control_ratio_quartile" ] = limesurvey_quartile if not baseline_interim.empty: From 2bef86b1da25f5f9843efd3aa820ae82bb519208 Mon Sep 17 00:00:00 2001 From: junos Date: Tue, 8 Mar 2022 15:43:25 +0100 Subject: [PATCH 2/2] Add a format for ESM and add to config. --- config.yaml | 8 ++++++++ src/data/streams/aware_postgresql/format.yaml | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/config.yaml b/config.yaml index 4d7a699c..18fb0bad 100644 --- a/config.yaml +++ b/config.yaml @@ -234,6 +234,14 @@ PHONE_DATA_YIELD: MINUTE_RATIO_THRESHOLD_FOR_VALID_YIELDED_HOURS: 0.5 # 0 to 1, minimum percentage of valid minutes in an hour to be considered valid. SRC_SCRIPT: src/features/phone_data_yield/rapids/main.R +PHONE_ESM: + CONTAINER: esm + PROVIDERS: + RAPIDS: + COMPUTE: False + FEATURES: + SRC_SCRIPT: src/features/phone_keyboard/rapids/main.py + # See https://www.rapids.science/latest/features/phone-keyboard/ PHONE_KEYBOARD: CONTAINER: keyboard diff --git a/src/data/streams/aware_postgresql/format.yaml b/src/data/streams/aware_postgresql/format.yaml index 24bdff5f..ecdf16fa 100644 --- a/src/data/streams/aware_postgresql/format.yaml +++ b/src/data/streams/aware_postgresql/format.yaml @@ -183,6 +183,24 @@ PHONE_CONVERSATION: SCRIPTS: # List any python or r scripts that mutate your raw data - "src/data/streams/mutations/phone/aware/conversation_ios_timestamp.R" +PHONE_ESM: + ANDROID: + RAPIDS_COLUMN_MAPPINGS: + TIMESTAMP: timestamp + DEVICE_ID: device_id + ESM_STATUS: esm_status + ESM_USER_ANSWER: esm_user_answer + ESM_NOTIFICATION_TIMEOUT: esm_notification_timeout + ESM_JSON: esm_json + DOUBLE_ESM_USER_ANSWER_TIMESTAMP: double_esm_user_answer_timestamp + ESM_TRIGGER: esm_trigger + ESM_SESSION: esm_session + ESM_NOTIFICATION_ID: esm_notification_id + ESM_EXPIRATION_THRESHOLD: esm_expiration_threshold + MUTATION: + COLUMN_MAPPINGS: + SCRIPTS: + PHONE_KEYBOARD: ANDROID: RAPIDS_COLUMN_MAPPINGS: