Replace sensor name with table name in heatmap_days_by_sensors section

pull/95/head
Meng Li 2020-08-03 15:19:45 -04:00
parent e13b89b125
commit c2b25a146d
2 changed files with 14 additions and 11 deletions

View File

@ -226,7 +226,7 @@ HEATMAP_DAYS_BY_SENSORS:
MIN_VALID_HOURS_PER_DAY: *min_valid_hours_per_day
MIN_VALID_BINS_PER_HOUR: *min_valid_bins_per_hour
EXPECTED_NUM_OF_DAYS: -1
SENSORS: [accelerometer, activity_recognition, applications_foreground, conversation, battery, bluetooth, calls, light, locations, messages, screen]
DB_TABLES: [accelerometer, applications_foreground, battery, bluetooth, calls, light, locations, messages, screen, wifi, sensor_wifi, plugin_google_activity_recognition, plugin_ios_activity_recognition, plugin_studentlife_audio_android, plugin_studentlife_audio]
HEATMAP_SENSED_BINS:
PLOT: False

View File

@ -7,16 +7,19 @@ def optional_heatmap_days_by_sensors_input(wildcards):
else:
platform = platforms[0]
input_for_heatmap_days_by_sensors = []
for sensor in config["HEATMAP_DAYS_BY_SENSORS"]["SENSORS"]:
if sensor == "activity_recognition" or sensor == "conversation":
if sensor.upper() not in config:
raise ValueError("Please check SENEORS parameter in HEATMAP_DAYS_BY_SENSORS section of config.yaml")
if platform not in ["android", "ios"]:
raise ValueError("Platform (line 2) in a participant file should be 'android', 'ios', or 'multiple'. You typed '" + platforms + "'")
input_for_heatmap_days_by_sensors.append("data/raw/{pid}/" + config[sensor.upper()]["DB_TABLE"][platform.upper()] + "_with_datetime.csv")
else:
input_for_heatmap_days_by_sensors.append("data/raw/{pid}/" + sensor + "_with_datetime.csv")
input_for_heatmap_days_by_sensors, tables = [], config["HEATMAP_DAYS_BY_SENSORS"]["DB_TABLES"]
for sensor in ["ACTIVITY_RECOGNITION", "CONVERSATION"]:
table = config[sensor]["DB_TABLE"][platform.upper()]
if table in tables:
input_for_heatmap_days_by_sensors.append("data/raw/{pid}/" + table + "_with_datetime.csv")
tables = [x for x in tables if x not in config[sensor]["DB_TABLE"].values()]
for table in tables:
input_for_heatmap_days_by_sensors.append("data/raw/{pid}/" + table + "_with_datetime.csv")
return input_for_heatmap_days_by_sensors
rule heatmap_features_correlations: