Skip to content

BlackrockRawIO: Fix int overflow - #1669

Merged
zm711 merged 5 commits into
NeuralEnsemble:masterfrom
zm711:blackrock-overflow
Mar 28, 2025
Merged

zm711 merged 5 commits into
NeuralEnsemble:masterfrom
zm711:blackrock-overflow

Conversation

@zm711

@zm711 zm711 commented Mar 26, 2025

Copy link
Copy Markdown
Contributor

Discovered as a warning in our CI. Should fix just to be safe

neo/test/rawiotest/test_blackrockrawio.py::TestBlackrockRawIO::test_read_all
  /home/runner/work/python-neo/python-neo/neo/rawio/blackrockrawio.py:287: RuntimeWarning: overflow encountered in scalar multiply
    _id = f"Unit {1000 * channel_id + unit_id}"

channel_id is an uint16 so we convert to a python int. This should prevent overflows.

@zm711
zm711 requested review from alejoe91 and samuelgarcia March 26, 2025 18:27
Comment thread neo/rawio/blackrockrawio.py Resolved
@zm711

zm711 commented Mar 26, 2025

Copy link
Copy Markdown
Contributor Author

With this PR we no longer have the warning on CI : )

@zm711
zm711 merged commit b87b8f2 into NeuralEnsemble:master Mar 28, 2025
@zm711
zm711 deleted the blackrock-overflow branch March 28, 2025 10:30
@zm711 zm711 added this to the 0.14.1 milestone Mar 28, 2025
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

Successfully merging this pull request may close these issues.

2 participants