Repository navigation
Reject negative infinity in expanded signals in calc_adc_params - #630
Open
tompollard wants to merge 1 commit into
Open
tompollard wants to merge 1 commit into
tompollard wants to merge 1 commit into
Conversation
The inf check for e_p_signal only compared the channel minimum and maximum against math.inf, so a channel containing -inf got past it and failed later with "cannot convert float NaN to integer". Use math.isinf so both signs are caught, as the p_signal branch already does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
calc_adc_paramschecks for infinite values before computing the ADC gain and baseline. Forp_signalthis usesnp.isinf, but fore_p_signalit only compared each channel's minimum and maximum againstmath.inf. A channel containing-infgot past the check and failed later with a misleading error:It now uses
math.isinf, so-infraises "Signal contains inf. Cannot perform adc." like thep_signalbranch.Testing:
TestSignal.test_adc_params_infcovers+infand-infin bothp_signalande_p_signal. The-inf/e_p_signalcase fails onmainand passes with this change.uv run pytest -m "not network": 349 passed.ruff format --checkandruff checkpass. Changelog entry added inchangelog.d/.