-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set_probe
behavior for RecordingExtractors
#2193
Comments
Hi @h-mayorquin Thanks for writing this up. Fine for me to have the |
Thanks @h-mayorquin I would revise and simplify my recommendation to a static method on BaseRecording
|
And one other idea... |
agree with this!! Thanks for raising, I have spent quite a long time stuck tracking down a bug that was caused by my misuse of the Also agree with @magland that this should not return a probe due to unintended consequences. I guess just
Unfortunately this change will cause a strange and possibly quite confusing error as following lines will attempt to access non-existent methods on I don't think it can hurt to add a little more detail on the assert message. Possibly including that the behaviour of |
We were discussing on slack about
set_probe
behavior. I am recaping the points here in case we want to make a decision about it.Context:
Me and @magland were mentioning that we have been confused about this method. Basically, it returns a new recording with the attached probe instead (as we expected) of setting the probe in the current recording. To achieve the latter, you need to use the
in_place
keyword.Now, @alejoe91 mentioned some technical difficulties that are relevant. Basically, for most probe structures, the method can't modify state unless the following condition is met:
spikeinterface/src/spikeinterface/core/baserecordingsnippets.py
Lines 176 to 185 in 3291976
So, a
true
setter method would not be as general.Then @samuelgarcia mentioned that, in his view,
set_probe
is following the logic ofset_index
in pandas with thein_place
logic. He believes this is just a matter of documentation and not semantics.I disagree with that argument for three reasons:
SettingWithCopyWarning
in stackoverflow and tutorials.in_place
works in whacky ways in Pandas, mantainers have expressed their desire to deprecate the keyword and I don't think we should build on that.My own proposal would be to make the current
set_probe
method work like a true setter and fail when this is not possible. We could have another method then that works to build a probe independent of the structure so this always return a new recorder object. That is, in my view, is another method that should work in a fluent interface way. @magland proposedrecording.create_new_recording_with_probe(probe=probe)
which works very well to me.Any other suggestions or experiences?
It could be that this is very clear than most people and mine and Jeremy's troubles are statistical flukes.
The text was updated successfully, but these errors were encountered: