Fix a bug when fitbit data is empty
parent
2ee45995f2
commit
13174b0c2a
|
@ -13,11 +13,11 @@ PIDS: [test01]
|
|||
CREATE_PARTICIPANT_FILES:
|
||||
CSV_FILE_PATH: "data/external/example_participants.csv" # see docs for required format
|
||||
PHONE_SECTION:
|
||||
ADD: TRUE
|
||||
ADD: True
|
||||
DEVICE_ID_COLUMN: device_id # column name
|
||||
IGNORED_DEVICE_IDS: []
|
||||
FITBIT_SECTION:
|
||||
ADD: FALSE
|
||||
ADD: True
|
||||
DEVICE_ID_COLUMN: fitbit_id # column name
|
||||
IGNORED_DEVICE_IDS: []
|
||||
EMPATICA_SECTION:
|
||||
|
|
|
@ -3,7 +3,7 @@ This [data stream](../../datastreams/data-streams-introduction) handles Empatica
|
|||
|
||||
## Container
|
||||
|
||||
You need to create a subfolder for every participant named after their `pid` in the path specified by `[EMPATICA_DATA_STREAMS][empatica_zipfiles][FOLDER]`. You can add one or more Empatica zip files to any subfolder.
|
||||
You need to create a subfolder for every participant named after their `device id` inside the folder specified by `[EMPATICA_DATA_STREAMS][empatica_zipfiles][FOLDER]`. You can add one or more Empatica zip files to any subfolder.
|
||||
|
||||
The script to connect and download data from this container is at:
|
||||
```bash
|
||||
|
|
|
@ -79,5 +79,6 @@ def parseHeartrateData(heartrate_data):
|
|||
def main(json_raw, stream_parameters):
|
||||
parsed_data = parseHeartrateData(json_raw)
|
||||
parsed_data["timestamp"] = 0 # this column is added at readable_datetime.R because we neeed to take into account multiple timezones
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if pd.api.types.is_datetime64_any_dtype( parsed_data['local_date_time']):
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
return(parsed_data)
|
||||
|
|
|
@ -68,5 +68,6 @@ def parseHeartrateData(heartrate_data):
|
|||
def main(json_raw, stream_parameters):
|
||||
parsed_data = parseHeartrateData(json_raw)
|
||||
parsed_data["timestamp"] = 0 # this column is added at readable_datetime.R because we neeed to take into account multiple timezones
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if pd.api.types.is_datetime64_any_dtype( parsed_data['local_date_time']):
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
return(parsed_data)
|
||||
|
|
|
@ -137,6 +137,7 @@ def parseSleepData(sleep_data):
|
|||
def main(json_raw, stream_parameters):
|
||||
parsed_data = parseSleepData(json_raw)
|
||||
parsed_data["timestamp"] = 0 # this column is added at readable_datetime.R because we neeed to take into account multiple timezones
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if pd.api.types.is_datetime64_any_dtype( parsed_data['local_date_time']):
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
||||
return(parsed_data)
|
||||
|
|
|
@ -59,8 +59,10 @@ def parseSleepData(sleep_data):
|
|||
def main(json_raw, stream_parameters):
|
||||
parsed_data = parseSleepData(json_raw)
|
||||
parsed_data["timestamp"] = 0 # this column is added at readable_datetime.R because we neeed to take into account multiple timezones
|
||||
parsed_data['local_start_date_time'] = parsed_data['local_start_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
parsed_data['local_end_date_time'] = parsed_data['local_end_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if pd.api.types.is_datetime64_any_dtype( parsed_data['local_start_date_time']):
|
||||
parsed_data['local_start_date_time'] = parsed_data['local_start_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if pd.api.types.is_datetime64_any_dtype( parsed_data['local_end_date_time']):
|
||||
parsed_data['local_end_date_time'] = parsed_data['local_end_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
|
||||
if stream_parameters["SLEEP_SUMMARY_EPISODE_DAY_ANCHOR"] == "start":
|
||||
parsed_data["local_date_time"] = parsed_data['local_start_date_time']
|
||||
|
|
|
@ -40,5 +40,6 @@ def parseStepsData(steps_data):
|
|||
def main(json_raw, stream_parameters):
|
||||
parsed_data = parseStepsData(json_raw)
|
||||
parsed_data["timestamp"] = 0 # this column is added at readable_datetime.R because we neeed to take into account multiple timezones
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if pd.api.types.is_datetime64_any_dtype( parsed_data['local_date_time']):
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
return(parsed_data)
|
||||
|
|
|
@ -33,5 +33,6 @@ def parseStepsData(steps_data):
|
|||
def main(json_raw, stream_parameters):
|
||||
parsed_data = parseStepsData(json_raw)
|
||||
parsed_data["timestamp"] = 0 # this column is added at readable_datetime.R because we neeed to take into account multiple timezones
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
if pd.api.types.is_datetime64_any_dtype( parsed_data['local_date_time']):
|
||||
parsed_data['local_date_time'] = parsed_data['local_date_time'].dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||
return(parsed_data)
|
||||
|
|
Loading…
Reference in New Issue