-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add error message and tests for plot_motion
.
#2841
base: main
Are you sure you want to change the base?
Add error message and tests for plot_motion
.
#2841
Conversation
plot_motion
.
Yeah I think that sounds super reasonable
Agreed
The idea behind |
Thanks @alejoe91! I've made the related changes, this is now ready for review. Out of interest what kind of third-party apps need low-overhead installations? This would be useful for me to know in general when thinking about dependencies on other packages. |
src/spikeinterface/widgets/motion.py
Outdated
before motion correction. | ||
2) 'Corrected peak depth' displayed the peak location for all detected spikes | ||
over time after motion correction. | ||
3) 'Motion vectors' plot shows the estimated displacement per channel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think I got this wrong, it is displacement across binned depths, not channels? In general I can fix these docstring to better use the terminology from the drift correction tutorial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I think I have fixed it now, by replacing "per channel" with "per spatial bin".
backend : Union[None, "matplotlib"] | ||
Determines the plotting backend. Only "matplotlib" currently supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend : Union[None, "matplotlib"] | |
Determines the plotting backend. Only "matplotlib" currently supported. |
This is automatically generated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @samuelgarcia, you mean it defaults to None
-> "matplotlib"
and so never needs to be set? If so, in can it be removed entirely as an argument tot his class? If it cannot be removed (e.g. to keep consistency with BaseWidget
) I would suggest to add as docstring parameter anyway to avoid confusion.
This PR closes #2725 by adding an error message when
ax
oraxes
arguments are passed, these arebackend_kwargs
which are not supported for this function.This is slightly suboptimal as the documentation still says they are accepted, but at least it is clear what to do when it does go wrong. I looked into making the function support passing
axes
but it would make things very complicated for (I don't think?) not too much benefit.I also added tests for the function and made a couple of minor changes:
x
andy
to make slightly more descriptive.Times [s]
toTime [s]
.I had a couple of questions:
motion_lim
is documented asTuple
orNone
but it actually expects anint
. I guess this could be changed to accept aTuple
similar todepth_lim
?.ax
is set to an emptyAxes
object. Maybe it would be clearer to set this toNone
as it is unused?Also a more general question, the
matplotlib
andscipy
imports are not at the top of the file, and I see the tests do not expectscipy
to be installed. I guess the logic is the same formatplotlib
which is why it is not top of file? Personally I would add any 'core' python modules to the general dependencies and then there is less maintenance required to have to workaround users potentially not having them installed. I don't think anyone will have trouble installingmatplotlib
orscipy
unlike heavier modules such asnumba
. However may there are other considerations (e.g. docker images?).