Skip to content

Commit

Permalink
Merge pull request #3245 from zm711/is-filtered
Browse files Browse the repository at this point in the history
Add `is_filtered` to annotations in `binary.json`
  • Loading branch information
alejoe91 authored Sep 11, 2024
2 parents 469187a + b76d5a7 commit 36ccbd4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/spikeinterface/core/baserecording.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ def _save(self, format="binary", verbose: bool = False, **save_kwargs):
channel_ids=self.get_channel_ids(),
time_axis=0,
file_offset=0,
is_filtered=self.is_filtered(),
gain_to_uV=self.get_channel_gains(),
offset_to_uV=self.get_channel_offsets(),
)
Expand Down
4 changes: 3 additions & 1 deletion src/spikeinterface/core/binaryrecordingextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ def __init__(
num_chan=None,
):
# This assigns num_channels if num_channels is not None, otherwise num_chan is assigned
# num_chan needs to be be kept for backward compatibility but should not be used by the
# end user
num_channels = num_channels or num_chan
assert num_channels is not None, "You must provide num_channels or num_chan"
if num_chan is not None:
warnings.warn("`num_chan` is to be deprecated in version 0.100, please use `num_channels` instead")
warnings.warn("`num_chan` is to be deprecated as of version 0.100, please use `num_channels` instead")

if channel_ids is None:
channel_ids = list(range(num_channels))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def test_sequential_reading_of_small_traces(folder_with_binary_files):
dtype = "float32"

file_paths = [folder / "traces_cached_seg0.raw"]
# `num_chan` is kept for backward compatibility so including it at least one test
# run is good to ensure that it is appropriately accepted as an argument
recording = BinaryRecordingExtractor(
num_chan=num_channels,
file_paths=file_paths,
Expand Down

0 comments on commit 36ccbd4

Please sign in to comment.