Skip to content

Commit

Permalink
Merge pull request #2297 from colehurwitz/main
Browse files Browse the repository at this point in the history
Add `.stream.cbin` compatibility to `CompressedBinaryIblExtractor`
  • Loading branch information
samuelgarcia authored Dec 13, 2023
2 parents 9d0b1e6 + b5ceb88 commit f0e688e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/spikeinterface/extractors/cbin_ibl.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ def __init__(self, folder_path, load_sync_channel=False, stream_name="ap"):
assert stream_name in ["ap", "lp"], "stream_name must be one of: 'ap', 'lp'"

# explore files
cbin_files = list(folder_path.glob(f"*.{stream_name}.cbin"))
assert len(cbin_files) == 1
cbin_file = cbin_files[0]
cbin_files = list(folder_path.glob(f"*{stream_name}.cbin"))
# snippets downloaded from IBL have the .stream.cbin suffix
cbin_stream_files = list(folder_path.glob(f"*.{stream_name}.stream.cbin"))
curr_cbin_files = cbin_stream_files if len(cbin_stream_files) > len(cbin_files) else cbin_files
assert (
len(curr_cbin_files) == 1
), f"There should only be one `*.cbin` file in the folder, but {print(curr_cbin_files)} have been found"
cbin_file = curr_cbin_files[0]
ch_file = cbin_file.with_suffix(".ch")
meta_file = cbin_file.with_suffix(".meta")

Expand Down

0 comments on commit f0e688e

Please sign in to comment.