diff --git a/tests/Snakefile b/tests/Snakefile index fceece6c..ea15d87a 100644 --- a/tests/Snakefile +++ b/tests/Snakefile @@ -61,6 +61,21 @@ for provider in config["LIGHT"]["PROVIDERS"].keys(): files_to_compute.extend(expand("data/interim/{pid}/{sensor_key}_features/{sensor_key}_{language}_{provider_key}.csv", pid=config["PIDS"], language=config["LIGHT"]["PROVIDERS"][provider]["SRC_LANGUAGE"], provider_key=provider, sensor_key="LIGHT".lower())) files_to_compute.extend(expand("data/processed/features/{pid}/{sensor_key}.csv", pid=config["PIDS"], sensor_key="LIGHT".lower())) +for provider in config["WIFI"]["PROVIDERS"].keys(): + if config["WIFI"]["PROVIDERS"][provider]["COMPUTE"]: + if len(config["WIFI"]["DB_TABLE"]["VISIBLE_ACCESS_POINTS"]) > 0: + files_to_compute.extend(expand("data/raw/{pid}/{sensor}_raw.csv", pid=config["PIDS"], sensor=config["WIFI"]["DB_TABLE"]["VISIBLE_ACCESS_POINTS"])) + files_to_compute.extend(expand("data/raw/{pid}/{sensor}_with_datetime.csv", pid=config["PIDS"], sensor=config["WIFI"]["DB_TABLE"]["VISIBLE_ACCESS_POINTS"])) + files_to_compute.extend(expand("data/raw/{pid}/{sensor_key}_with_datetime_visibleandconnected.csv", pid=config["PIDS"], sensor_key="WIFI".lower())) + files_to_compute.extend(expand("data/interim/{pid}/{sensor_key}_features/{sensor_key}_{language}_{provider_key}.csv", pid=config["PIDS"], language=config["WIFI"]["PROVIDERS"][provider]["SRC_LANGUAGE"], provider_key=provider, sensor_key="WIFI".lower())) + files_to_compute.extend(expand("data/processed/features/{pid}/{sensor_key}.csv", pid=config["PIDS"], sensor_key="WIFI".lower())) + if len(config["WIFI"]["DB_TABLE"]["CONNECTED_ACCESS_POINTS"]) > 0: + files_to_compute.extend(expand("data/raw/{pid}/{sensor}_raw.csv", pid=config["PIDS"], sensor=config["WIFI"]["DB_TABLE"]["CONNECTED_ACCESS_POINTS"])) + files_to_compute.extend(expand("data/raw/{pid}/{sensor}_with_datetime.csv", pid=config["PIDS"], sensor=config["WIFI"]["DB_TABLE"]["CONNECTED_ACCESS_POINTS"])) + files_to_compute.extend(expand("data/raw/{pid}/{sensor_key}_with_datetime_visibleandconnected.csv", pid=config["PIDS"], sensor_key="WIFI".lower())) + files_to_compute.extend(expand("data/interim/{pid}/{sensor_key}_features/{sensor_key}_{language}_{provider_key}.csv", pid=config["PIDS"], language=config["WIFI"]["PROVIDERS"][provider]["SRC_LANGUAGE"], provider_key=provider, sensor_key="WIFI".lower())) + files_to_compute.extend(expand("data/processed/features/{pid}/{sensor_key}.csv", pid=config["PIDS"], sensor_key="WIFI".lower())) + rule all: input: files_to_compute diff --git a/tests/data/processed/features/test01/wifi.csv b/tests/data/processed/features/test01/wifi.csv new file mode 100644 index 00000000..8af58160 --- /dev/null +++ b/tests/data/processed/features/test01/wifi.csv @@ -0,0 +1,6 @@ +"local_segment","local_segment_label","local_start_date","local_start_time","local_end_date","local_end_time","wifi_rapids_countscans","wifi_rapids_uniquedevices","wifi_rapids_countscansmostuniquedevice" +"afternoon#2020-07-03#12:00:00#2020-07-03#17:59:59","afternoon","2020-07-03","12:00:00","2020-07-03","17:59:59",4,4,1 +"daily#2020-07-03#00:00:00#2020-07-03#23:59:59","daily","2020-07-03","00:00:00","2020-07-03","23:59:59",26,10,6 +"evening#2020-07-03#18:00:00#2020-07-03#23:59:59","evening","2020-07-03","18:00:00","2020-07-03","23:59:59",7,6,2 +"morning#2020-07-03#06:00:00#2020-07-03#11:59:59","morning","2020-07-03","06:00:00","2020-07-03","11:59:59",7,5,2 +"night#2020-07-03#00:00:00#2020-07-03#05:59:59","night","2020-07-03","00:00:00","2020-07-03","05:59:59",8,6,2 diff --git a/tests/data/processed/features/test02/wifi.csv b/tests/data/processed/features/test02/wifi.csv new file mode 100644 index 00000000..4ed563b8 --- /dev/null +++ b/tests/data/processed/features/test02/wifi.csv @@ -0,0 +1,6 @@ +"local_segment","local_segment_label","local_start_date","local_start_time","local_end_date","local_end_time","wifi_rapids_countscans","wifi_rapids_uniquedevices","wifi_rapids_countscansmostuniquedevice" +"afternoon#2020-07-03#12:00:00#2020-07-03#17:59:59","afternoon","2020-07-03","12:00:00","2020-07-03","17:59:59",2,2,1 +"daily#2020-07-03#00:00:00#2020-07-03#23:59:59","daily","2020-07-03","00:00:00","2020-07-03","23:59:59",14,5,4 +"evening#2020-07-03#18:00:00#2020-07-03#23:59:59","evening","2020-07-03","18:00:00","2020-07-03","23:59:59",5,4,2 +"morning#2020-07-03#06:00:00#2020-07-03#11:59:59","morning","2020-07-03","06:00:00","2020-07-03","11:59:59",3,2,2 +"night#2020-07-03#00:00:00#2020-07-03#05:59:59","night","2020-07-03","00:00:00","2020-07-03","05:59:59",4,4,1 diff --git a/tests/data/processed/features/test03/wifi.csv b/tests/data/processed/features/test03/wifi.csv new file mode 100644 index 00000000..89fa0200 --- /dev/null +++ b/tests/data/processed/features/test03/wifi.csv @@ -0,0 +1 @@ +"local_segment","local_segment_label","local_start_date","local_start_time","local_end_date","local_end_time","wifi_rapids_countscans","wifi_rapids_uniquedevices","wifi_rapids_countscansmostuniquedevice" diff --git a/tests/data/processed/features/test04/wifi.csv b/tests/data/processed/features/test04/wifi.csv new file mode 100644 index 00000000..89fa0200 --- /dev/null +++ b/tests/data/processed/features/test04/wifi.csv @@ -0,0 +1 @@ +"local_segment","local_segment_label","local_start_date","local_start_time","local_end_date","local_end_time","wifi_rapids_countscans","wifi_rapids_uniquedevices","wifi_rapids_countscansmostuniquedevice" diff --git a/tests/settings/testing_config.yaml b/tests/settings/testing_config.yaml index c8a43077..d106c5eb 100644 --- a/tests/settings/testing_config.yaml +++ b/tests/settings/testing_config.yaml @@ -8,7 +8,7 @@ DAY_SEGMENTS: &day_segments FILE: "data/external/daysegments_interval.csv" PHONE_VALID_SENSED_BINS: - DB_TABLES: [messages, calls, bluetooth, light] + DB_TABLES: [messages, calls, bluetooth, light, wifi] # Communication SMS features config, TYPES and FEATURES keys need to match MESSAGES: @@ -55,3 +55,13 @@ LIGHT: SRC_FOLDER: "rapids" # inside src/features/light SRC_LANGUAGE: "python" +WIFI: + DB_TABLE: + VISIBLE_ACCESS_POINTS: "wifi" # if you only have a CONNECTED_ACCESS_POINTS table, set this value to "" + CONNECTED_ACCESS_POINTS: "sensor_wifi" # if you only have a VISIBLE_ACCESS_POINTS table, set this value to "" + PROVIDERS: + RAPIDS: + COMPUTE: True + FEATURES: ["countscans", "uniquedevices", "countscansmostuniquedevice"] + SRC_FOLDER: "rapids" # inside src/features/bluetooth + SRC_LANGUAGE: "r"