Skip to content

Conversation

@h-mayorquin
Copy link
Collaborator

While I was working on #1742 I realized that the BinaryRecordingExtractor does not follow the convention of the library of referring to number of channels as num_channels (as we do in BaseRecording.get_num_channels). Instead, it uses num_chan.

This PR starts adding a new argument BinaryRecordingExtractor and will throw a deprecation warning for the old argument.

@h-mayorquin h-mayorquin added the deprecations Related to code deprecation label Jun 28, 2023
@samuelgarcia
Copy link
Member

Good idea. And lets keep the wrning for a while because we have so many code with the old variable name....

@h-mayorquin h-mayorquin marked this pull request as ready for review June 28, 2023 19:30
@h-mayorquin h-mayorquin self-assigned this Jun 29, 2023
is_filtered=None,
num_chan=None,
):
num_channels = num_channels or num_chan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if they are both given? and maybe different? e.g. num_channels=16 and num_chan=32?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This:
https://en.wikipedia.org/wiki/Short-circuit_evaluation

Together with this:
https://docs.python.org/3/library/stdtypes.html#truth-value-testing

It is a common python idiom but maybe I should make the point of avoiding it as it can be confusing.

Copy link
Member

@alejoe91 alejoe91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h-mayorquin thanks for this! I have a small comment: IMO we should make the init checks even more stringent! Currently, one could pass both arguments and in that case the behavior is not clear

@alejoe91 alejoe91 added this to the 0.98.0 milestone Jul 3, 2023
@alejoe91 alejoe91 merged commit dc498f2 into SpikeInterface:main Jul 3, 2023
@alejoe91 alejoe91 deleted the binary_recording branch July 3, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecations Related to code deprecation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants