Repository navigation
Reuse cached noise levels only for the random slices that drew them - #4955
Open
grahamfindlay wants to merge 1 commit into
Open
grahamfindlay wants to merge 1 commit into
grahamfindlay wants to merge 1 commit into
Conversation
get_noise_levels was caching its result under a key that ignored random_slices_kwargs, so a call could get noise levels drawn with another seed or chunk layout (SpikeInterface#4928). Now it keeps each draw's kwargs (with defaults filled in) in a private unsaved dict on the recording, and reuses the cache only when a call's kwargs match them. A call without a seed accepts any seed. Noise levels set by hand or loaded from a folder count as an unseeded draw with the defaults, and set_property drops the stored kwargs. Additionally, highpass_spatial_filter now uses get_noise_levels.
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.
Fixes #4928.
get_noise_levels was caching its result under a key that ignored random_slices_kwargs, so a call could get noise levels drawn with another seed or chunk layout (#4928). Now it keeps each draw's kwargs (with defaults filled in) in a private unsaved dict on the recording.
set_propertydrops the stored kwargs.highpass_spatial_filternow uses get_noise_levels.While doing this I noticed that passing
random_slices_kwargsan old way, as top-level keyword arguments, still works with a deprecation warning:Based on the comments, it appears to have been intended for removal in 0.103.0. I left it so that the code that turns the first form into the second now runs before checking the cache, so settings passed the old way are compared too. But I would like to remove this old deprecated call style in a follow-up PR, and switch anything that uses it (
highpass_spatial_filterandwaveform_thresholderas far as I can tell) to userandom_slices_kwargs.