diff --git a/src/g5505_file_reader.py b/src/g5505_file_reader.py index 572b892..2d06f0d 100644 --- a/src/g5505_file_reader.py +++ b/src/g5505_file_reader.py @@ -116,6 +116,10 @@ def read_txt_files_as_dict(filename : str ): config_dict = yaml.load(stream, Loader=yaml.FullLoader) except yaml.YAMLError as exc: print(exc) + # Verify if file can be read by available intrument configurations. + if not any(key in filename for key in config_dict.keys()): + return {} + #TODO: this may be prone to error if assumed folder structure is non compliant file_encoding = config_dict['default']['file_encoding'] #'utf-8'