Skip to content
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

[MNT] - Warning on scipy.stats.mode #11

Open
TomDonoghue opened this issue Apr 11, 2023 · 2 comments
Open

[MNT] - Warning on scipy.stats.mode #11

TomDonoghue opened this issue Apr 11, 2023 · 2 comments

Comments

@TomDonoghue
Copy link
Member

As of scipy version 1.9.0, there is a new 'keepdims' argument in scipy.stats.mode that needs to be set for future-proofing, and will start to fail in scipy version 1.11.0: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mode.html

This relates to the use of scipy.stats.mode here:
https://github.com/HSUPipeline/convnwb/blob/main/convnwb/timestamps/align.py#L168

For future scipy usage, this could be updated to:
ixis_mode = stats.mode(ixis, keepdims=True)[0][0]

Or, equivalent updates:
ixis_mode = stats.mode(ixis, keepdims=True).mode[0]
ixis_mode = stats.mode(ixis, keepdims=False).mode

Basically - the fix is easy, but need to decide whether to enforce a specific version of scipy, and/or do a version check.

@weijiazh97
Copy link

sync_behav_out, sync_neural_out = match_pulses(sync_behav, sync_neural, n_pulses=500, start_offset=100)
Change start_offset number has a significant effect on the output

@TomDonoghue
Copy link
Member Author

This is now fixed, by adding a version check, so both old and new scipy versions should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants