|
|
@ -140,10 +140,21 @@ def _sanity_check(data_frame): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def parse_folder(folder, quiet=False): |
|
|
|
def parse_folder(folder, quiet=False): |
|
|
|
"""parses all csv files in a folder to one large dataframe""" |
|
|
|
"""parses all csv files in a folder to one large dataframe |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Will raise an ValueError, if no sensospot data could be found in |
|
|
|
|
|
|
|
the folder |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
folder: path of folder containing data files |
|
|
|
|
|
|
|
quiet: skip sanity check, defaults to False |
|
|
|
|
|
|
|
returns: pandas dataframe with parsed data |
|
|
|
|
|
|
|
""" |
|
|
|
folder_path = Path(folder) |
|
|
|
folder_path = Path(folder) |
|
|
|
file_list = list_csv_files(folder_path) |
|
|
|
file_list = list_csv_files(folder_path) |
|
|
|
data_frame = parse_multiple_files(file_list) |
|
|
|
try: |
|
|
|
|
|
|
|
data_frame = parse_multiple_files(file_list) |
|
|
|
|
|
|
|
except ValueError: |
|
|
|
|
|
|
|
raise ValueError(f"No sensospot data found in folder '{folder}'") |
|
|
|
data_frame = add_optional_measurement_parameters(data_frame, folder_path) |
|
|
|
data_frame = add_optional_measurement_parameters(data_frame, folder_path) |
|
|
|
if quiet: |
|
|
|
if quiet: |
|
|
|
return data_frame |
|
|
|
return data_frame |
|
|
|