Add backwards compatibility when passing sparsity kwargs to create_sorting_analyzer#4677
Open
chrishalcrow wants to merge 4 commits into
Open
Add backwards compatibility when passing sparsity kwargs to create_sorting_analyzer#4677chrishalcrow wants to merge 4 commits into
chrishalcrow wants to merge 4 commits into
Conversation
zm711
reviewed
Jul 10, 2026
zm711
left a comment
Member
There was a problem hiding this comment.
Just one required tweak. Otherwise just some comments.
Comment on lines
+183
to
+184
| "Passing sparsity arguments via keyword arguments is deprecated. " | ||
| "Please pass them into the `sparsity_kwargs` dictionary instead.", |
Member
There was a problem hiding this comment.
The message should include the deprecation version number so users know when we are stopping them.
| @@ -165,6 +166,26 @@ def create_sorting_analyzer( | |||
| if sparsity_kwargs is None: | |||
| sparsity_kwargs = dict() | |||
Member
There was a problem hiding this comment.
Just checked on 3.12 and the literal is still 20% faster. Back in earlier version so 3 it was 2x faster. But still benefit of just using the literal.
|
|
||
| sorting_analyzer = create_sorting_analyzer(sorting=sorting, recording=recording, sparse=False, return_in_uV=True) | ||
|
|
||
| # Check that we can still pass sparsity kwargs using the old signature |
Member
There was a problem hiding this comment.
Just for me being an old man could you add to the comment that radius_um is a sparsity_kwarg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the monster #4624 we added
**job_kwargstocreate_sorting_analyzerand changed**sparsity_kwargstosparsity_kwargs=None, without handling backwards compat. This PR fixes this.