Skip to content

Fix double definition of openephys warnings#3980

Merged
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
alejoe91:fix-openephys-warnings
Jun 10, 2025
Merged

Fix double definition of openephys warnings#3980
alejoe91 merged 2 commits into
SpikeInterface:mainfrom
alejoe91:fix-openephys-warnings

Conversation

@alejoe91

Copy link
Copy Markdown
Member

No description provided.

@alejoe91 alejoe91 requested a review from Copilot June 10, 2025 09:42
@alejoe91 alejoe91 added the extractors Related to extractors module label Jun 10, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes a redundant inline import of the warnings module in the OpenEphys extractor’s deprecation warning block.

  • Removed the duplicated import warnings inside the if load_sync_channel: block
  • Left the deprecation message assignment unchanged
Comments suppressed due to low confidence (2)

src/spikeinterface/extractors/neoextractors/openephys.py:163

  • The deprecation message is assigned to warning_message but never emitted. Add a call to warnings.warn(warning_message, DeprecationWarning) (or a logger) after constructing the message to actually surface the deprecation warning.
warning_message = (

src/spikeinterface/extractors/neoextractors/openephys.py:163

  • Consider adding a unit test to verify that the deprecation warning is emitted when load_sync_channel is true, ensuring this behavior remains covered.
warning_message = (

@alejoe91

alejoe91 commented Jun 10, 2025

Copy link
Copy Markdown
Member Author

This actually results in an UnboundLocalVariable error in case setting timestamps fails...

@alejoe91 alejoe91 added the bug Something isn't working label Jun 10, 2025

@zm711 zm711 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really weird. I thought it would just find the package in some sort of python cache.... But doesn't hurt to delete unnecessary import :)

@alejoe91 alejoe91 merged commit fb3bda8 into SpikeInterface:main Jun 10, 2025
15 checks passed
@alejoe91

Copy link
Copy Markdown
Member Author

@vncntprvst FYI

@alejoe91 alejoe91 deleted the fix-openephys-warnings branch March 20, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working extractors Related to extractors module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants