diff --git a/microSWIFTtelemetry/sbd/compile_sbd.py b/microSWIFTtelemetry/sbd/compile_sbd.py index f4fca0c..5fa7baa 100644 --- a/microSWIFTtelemetry/sbd/compile_sbd.py +++ b/microSWIFTtelemetry/sbd/compile_sbd.py @@ -11,6 +11,7 @@ "compile_sbd", ] +import os import warnings from collections import defaultdict from typing import Any @@ -32,6 +33,8 @@ def compile_sbd( Compile contents of short burst data files into the specified variable type or output. + Valid variable types: 'dict' or 'pandas' + Args: sbd_folder (str): directory containing.sbd files var_type (str): variable type to be returned @@ -56,9 +59,13 @@ def compile_sbd( data.append(swift_data) errors.append(error_message) - else: #TODO: support reading from a folder of SBDs - raise NotImplementedError('Reading from a folder on the local ' - 'machine is not supported yet.') + else: + for file in os.listdir(sbd_folder): + with open(os.path.join(sbd_folder, file), 'rb') as file: + swift_data, error_message = read_sbd(file) + if swift_data: + data.append(swift_data) + errors.append(error_message) errors = _combine_dict_list(errors) diff --git a/microSWIFTtelemetry/version.py b/microSWIFTtelemetry/version.py index 72ecf4e..921aa61 100644 --- a/microSWIFTtelemetry/version.py +++ b/microSWIFTtelemetry/version.py @@ -4,7 +4,7 @@ # Format expected by setup.py and doc/source/conf.py: string of form "X.Y.Z" _version_major = 0 _version_minor = 3 -_version_micro = 1 # use '' for first of series, number for 1 and above +_version_micro = 2 # use '' for first of series, number for 1 and above # _version_extra = 'dev' _version_extra = '' # TODO: Uncomment this for full releases