From 1e66dad838f3046501ce9fef6f59f9b08a3e234c Mon Sep 17 00:00:00 2001 From: JulioV Date: Thu, 11 Mar 2021 13:35:34 -0500 Subject: [PATCH] Fix bug in empatica_zip container script --- src/data/streams/empatica_zip/container.py | 6 +++++- tools/config.schema.yaml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/data/streams/empatica_zip/container.py b/src/data/streams/empatica_zip/container.py index a1e3a993..542acdcd 100644 --- a/src/data/streams/empatica_zip/container.py +++ b/src/data/streams/empatica_zip/container.py @@ -84,7 +84,11 @@ def pull_data(data_configuration, device, sensor, container, columns_to_download participant_data = pd.DataFrame(columns=columns_to_download.values()) participant_data.set_index('timestamp', inplace=True) - for zipfile in list((Path(data_configuration["FOLDER"]) / Path(device)).rglob("*.zip")): + available_zipfiles = list((Path(data_configuration["FOLDER"]) / Path(device)).rglob("*.zip")) + if len(available_zipfiles) == 0: + warnings.warn("There were no zip files in: {}. If you were expecting data for this participant the [EMPATICA][DEVICE_IDS] key in their participant file is missing the pid".format((Path(data_configuration["FOLDER"]) / Path(device)))) + + for zipfile in available_zipfiles: print("Extracting {} data from {} for {}".format(sensor, zipfile, device)) with ZipFile(zipfile, 'r') as zipFile: listOfFileNames = zipFile.namelist() diff --git a/tools/config.schema.yaml b/tools/config.schema.yaml index dadcd0db..89667db8 100644 --- a/tools/config.schema.yaml +++ b/tools/config.schema.yaml @@ -138,7 +138,7 @@ properties: pattern: "^.*\\.csv$" IF_MISSING_TZCODE: type: string - enum: [USE_DEFAULT] + enum: [STOP, USE_DEFAULT] DEFAULT_TZCODE: type: string FITBIT: