From 358bbb98dfa9749c78a46776cd9e81fa555b0130 Mon Sep 17 00:00:00 2001 From: Cole Hurwitz Date: Tue, 5 Dec 2023 10:24:47 -0800 Subject: [PATCH 1/4] add .stream.cbin compatibility --- src/spikeinterface/extractors/cbin_ibl.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/spikeinterface/extractors/cbin_ibl.py b/src/spikeinterface/extractors/cbin_ibl.py index 37ed931d1a..b739b7280c 100644 --- a/src/spikeinterface/extractors/cbin_ibl.py +++ b/src/spikeinterface/extractors/cbin_ibl.py @@ -53,9 +53,12 @@ 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 + cbin_file = curr_cbin_files[0] ch_file = cbin_file.with_suffix(".ch") meta_file = cbin_file.with_suffix(".meta") From 5e3c955e94cb7db1de220010e950fd650a894b3c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 18:26:52 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/extractors/cbin_ibl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/extractors/cbin_ibl.py b/src/spikeinterface/extractors/cbin_ibl.py index b739b7280c..0ffd690ba8 100644 --- a/src/spikeinterface/extractors/cbin_ibl.py +++ b/src/spikeinterface/extractors/cbin_ibl.py @@ -54,7 +54,7 @@ def __init__(self, folder_path, load_sync_channel=False, stream_name="ap"): # explore files cbin_files = list(folder_path.glob(f"*{stream_name}.cbin")) - #snippets downloaded from IBL have the .stream.cbin suffix + # 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 From e43b977c58a09120e4eeee80e8265dc8b0277af4 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Wed, 6 Dec 2023 16:21:45 +0100 Subject: [PATCH 3/4] Update src/spikeinterface/extractors/cbin_ibl.py Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com> --- src/spikeinterface/extractors/cbin_ibl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spikeinterface/extractors/cbin_ibl.py b/src/spikeinterface/extractors/cbin_ibl.py index 0ffd690ba8..4dc2cb36bf 100644 --- a/src/spikeinterface/extractors/cbin_ibl.py +++ b/src/spikeinterface/extractors/cbin_ibl.py @@ -57,7 +57,7 @@ def __init__(self, folder_path, load_sync_channel=False, stream_name="ap"): # 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 + 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") From b5ceb88c0fc9a4d62f3ba584bfa4f5df9dc9dd93 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:23:42 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/spikeinterface/extractors/cbin_ibl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/extractors/cbin_ibl.py b/src/spikeinterface/extractors/cbin_ibl.py index 4dc2cb36bf..dcc0211232 100644 --- a/src/spikeinterface/extractors/cbin_ibl.py +++ b/src/spikeinterface/extractors/cbin_ibl.py @@ -57,7 +57,9 @@ def __init__(self, folder_path, load_sync_channel=False, stream_name="ap"): # 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" + 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")