Skip to content

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

@TomDonoghue

Description

@TomDonoghue

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions