Skip to content

Commit

Permalink
error raied if no npz files found
Browse files Browse the repository at this point in the history
  • Loading branch information
AminAlam committed May 21, 2024
1 parent d2e2f82 commit c563464
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions elecphys/data_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def load_all_npz_files(npz_folder: str, ignore_channels: Union[
for file_name in files_list:
if not file_name.endswith('.npz'):
files_list.remove(file_name)
if len(files_list) == 0:
raise ValueError(f'No NPZ files found in {npz_folder}')
files_list = utils.sort_file_names(files_list)
all_channels_in_folder = list(range(1, len(files_list) + 1))
channels_list = utils.convert_string_to_list(channels_list)
Expand Down

0 comments on commit c563464

Please sign in to comment.