diff --git a/tests/Snakefile b/tests/Snakefile index 22e29dba..917e91ef 100644 --- a/tests/Snakefile +++ b/tests/Snakefile @@ -32,6 +32,13 @@ if config["PHONE_VALID_SENSED_DAYS"]["COMPUTE"]: min_valid_hours_per_day=config["PHONE_VALID_SENSED_DAYS"]["MIN_VALID_HOURS_PER_DAY"], min_valid_bins_per_hour=config["PHONE_VALID_SENSED_DAYS"]["MIN_VALID_BINS_PER_HOUR"])) +for provider in config["MESSAGES"]["PROVIDERS"].keys(): + if config["MESSAGES"]["PROVIDERS"][provider]["COMPUTE"]: + files_to_compute.extend(expand("data/raw/{pid}/{sensor}_raw.csv", pid=config["PIDS"], sensor=config["MESSAGES"]["DB_TABLE"])) + files_to_compute.extend(expand("data/raw/{pid}/{sensor}_with_datetime.csv", pid=config["PIDS"], sensor=config["MESSAGES"]["DB_TABLE"])) + files_to_compute.extend(expand("data/interim/{pid}/{sensor_key}_features/{sensor_key}_{language}_{provider_key}.csv", pid=config["PIDS"], language=config["MESSAGES"]["PROVIDERS"][provider]["SRC_LANGUAGE"], provider_key=provider, sensor_key="MESSAGES".lower())) + files_to_compute.extend(expand("data/processed/features/{pid}/{sensor_key}.csv", pid=config["PIDS"], sensor_key="MESSAGES".lower())) + for provider in config["BLUETOOTH"]["PROVIDERS"].keys(): if config["BLUETOOTH"]["PROVIDERS"][provider]["COMPUTE"]: files_to_compute.extend(expand("data/raw/{pid}/{sensor}_raw.csv", pid=config["PIDS"], sensor=config["BLUETOOTH"]["DB_TABLE"])) diff --git a/tests/data/processed/features/test01/messages.csv b/tests/data/processed/features/test01/messages.csv new file mode 100644 index 00000000..7e1899f6 --- /dev/null +++ b/tests/data/processed/features/test01/messages.csv @@ -0,0 +1,9 @@ +"local_segment","local_segment_label","local_start_date","local_start_time","local_end_date","local_end_time","messages_rapids_received_countmostfrequentcontact","messages_rapids_received_count","messages_rapids_received_distinctcontacts","messages_rapids_received_timefirstmessage","messages_rapids_received_timelastmessage","messages_rapids_sent_countmostfrequentcontact","messages_rapids_sent_count","messages_rapids_sent_distinctcontacts","messages_rapids_sent_timefirstmessage","messages_rapids_sent_timelastmessage" +"afternoon#2020-05-28#12:00:00#2020-05-28#17:59:59","afternoon","2020-05-28","12:00:00","2020-05-28","17:59:59",1,2,2,830,949,1,3,3,722,979 +"daily#2020-05-28#00:00:00#2020-05-28#23:59:59","daily","2020-05-28","00:00:00","2020-05-28","23:59:59",7,12,6,6,1382,3,8,6,219,1401 +"daily#2020-05-29#00:00:00#2020-05-29#23:59:59","daily","2020-05-29","00:00:00","2020-05-29","23:59:59",3,6,4,401,1382,1,4,4,388,1401 +"evening#2020-05-28#18:00:00#2020-05-28#23:59:59","evening","2020-05-28","18:00:00","2020-05-28","23:59:59",2,3,2,1173,1382,1,2,2,1218,1401 +"evening#2020-05-29#18:00:00#2020-05-29#23:59:59","evening","2020-05-29","18:00:00","2020-05-29","23:59:59",2,3,2,1173,1382,1,2,2,1218,1401 +"morning#2020-05-28#06:00:00#2020-05-28#11:59:59","morning","2020-05-28","06:00:00","2020-05-28","11:59:59",1,3,3,401,660,1,2,2,388,654 +"morning#2020-05-29#06:00:00#2020-05-29#11:59:59","morning","2020-05-29","06:00:00","2020-05-29","11:59:59",1,3,3,401,660,1,2,2,388,654 +"night#2020-05-28#00:00:00#2020-05-28#05:59:59","night","2020-05-28","00:00:00","2020-05-28","05:59:59",4,4,1,6,312,1,1,1,219,219 diff --git a/tests/data/processed/features/test02/messages.csv b/tests/data/processed/features/test02/messages.csv new file mode 100644 index 00000000..937cd441 --- /dev/null +++ b/tests/data/processed/features/test02/messages.csv @@ -0,0 +1,9 @@ +"local_segment","local_segment_label","local_start_date","local_start_time","local_end_date","local_end_time","messages_rapids_received_countmostfrequentcontact","messages_rapids_received_count","messages_rapids_received_distinctcontacts","messages_rapids_received_timefirstmessage","messages_rapids_received_timelastmessage","messages_rapids_sent_countmostfrequentcontact","messages_rapids_sent_count","messages_rapids_sent_distinctcontacts","messages_rapids_sent_timefirstmessage","messages_rapids_sent_timelastmessage" +"afternoon#2020-05-28#12:00:00#2020-05-28#17:59:59","afternoon","2020-05-28","12:00:00","2020-05-28","17:59:59",1,2,2,830,949,1,3,3,722,979 +"daily#2020-05-28#00:00:00#2020-05-28#23:59:59","daily","2020-05-28","00:00:00","2020-05-28","23:59:59",1,12,12,6,1382,1,8,8,219,1401 +"daily#2020-05-29#00:00:00#2020-05-29#23:59:59","daily","2020-05-29","00:00:00","2020-05-29","23:59:59",0,6,6,401,1382,0,4,4,388,1401 +"evening#2020-05-28#18:00:00#2020-05-28#23:59:59","evening","2020-05-28","18:00:00","2020-05-28","23:59:59",1,3,3,1173,1382,1,2,2,1218,1401 +"evening#2020-05-29#18:00:00#2020-05-29#23:59:59","evening","2020-05-29","18:00:00","2020-05-29","23:59:59",0,3,3,1173,1382,0,2,2,1218,1401 +"morning#2020-05-28#06:00:00#2020-05-28#11:59:59","morning","2020-05-28","06:00:00","2020-05-28","11:59:59",1,3,3,401,660,1,2,2,388,654 +"morning#2020-05-29#06:00:00#2020-05-29#11:59:59","morning","2020-05-29","06:00:00","2020-05-29","11:59:59",0,3,3,401,660,0,2,2,388,654 +"night#2020-05-28#00:00:00#2020-05-28#05:59:59","night","2020-05-28","00:00:00","2020-05-28","05:59:59",1,4,4,6,312,1,1,1,219,219 diff --git a/tests/data/processed/features/test03/messages.csv b/tests/data/processed/features/test03/messages.csv new file mode 100644 index 00000000..5599636f --- /dev/null +++ b/tests/data/processed/features/test03/messages.csv @@ -0,0 +1 @@ +"local_segment","local_segment_label","local_start_date","local_start_time","local_end_date","local_end_time","messages_rapids_received_countmostfrequentcontact","messages_rapids_received_count","messages_rapids_received_distinctcontacts","messages_rapids_received_timefirstmessage","messages_rapids_received_timelastmessage","messages_rapids_sent_countmostfrequentcontact","messages_rapids_sent_count","messages_rapids_sent_distinctcontacts","messages_rapids_sent_timefirstmessage","messages_rapids_sent_timelastmessage" diff --git a/tests/data/processed/features/test04/messages.csv b/tests/data/processed/features/test04/messages.csv new file mode 100644 index 00000000..5599636f --- /dev/null +++ b/tests/data/processed/features/test04/messages.csv @@ -0,0 +1 @@ +"local_segment","local_segment_label","local_start_date","local_start_time","local_end_date","local_end_time","messages_rapids_received_countmostfrequentcontact","messages_rapids_received_count","messages_rapids_received_distinctcontacts","messages_rapids_received_timefirstmessage","messages_rapids_received_timelastmessage","messages_rapids_sent_countmostfrequentcontact","messages_rapids_sent_count","messages_rapids_sent_distinctcontacts","messages_rapids_sent_timefirstmessage","messages_rapids_sent_timelastmessage" diff --git a/tests/settings/config.yaml b/tests/settings/config.yaml index b19786a3..ba36a53c 100644 --- a/tests/settings/config.yaml +++ b/tests/settings/config.yaml @@ -2,5 +2,4 @@ directory: ./ configfile: ./tests/settings/testing_config.yaml snakefile: ./tests/Snakefile cores: 1 -# forcerun: [messages_features, call_features, bluetooth_features, activity_features, battery_features, screen_features, light_features, applications_foreground_features, wifi_features, conversation_features] forcerun: [join_features_from_providers] \ No newline at end of file diff --git a/tests/settings/testing_config.yaml b/tests/settings/testing_config.yaml index 477acd30..4033d642 100644 --- a/tests/settings/testing_config.yaml +++ b/tests/settings/testing_config.yaml @@ -1,6 +1,5 @@ # Participants to include in the analysis # You must create a file for each participant named pXXX containing their device_id. This can be done manually or automatically -# PIDS: [test01, test02, test03, test04] PIDS: [test01, test02, test03, test04] # Global var with common day segments @@ -11,6 +10,20 @@ DAY_SEGMENTS: &day_segments PHONE_VALID_SENSED_BINS: DB_TABLES: [bluetooth] +# Communication SMS features config, TYPES and FEATURES keys need to match +MESSAGES: + DB_TABLE: messages + PROVIDERS: + RAPIDS: + COMPUTE: True + MESSAGES_TYPES : [received, sent] + FEATURES: + received: [count, distinctcontacts, timefirstmessage, timelastmessage, countmostfrequentcontact] + sent: [count, distinctcontacts, timefirstmessage, timelastmessage, countmostfrequentcontact] + SRC_LANGUAGE: "r" + SRC_FOLDER: "rapids" # inside src/features/messages + + BLUETOOTH: DB_TABLE: bluetooth PROVIDERS: