Skip to content

Forward the learn argument from xqrs_detect to XQRS.detect#569

Open
arpitjain099 wants to merge 1 commit into
MIT-LCP:mainfrom
arpitjain099:chore/xqrs-detect-forward-learn
Open

Forward the learn argument from xqrs_detect to XQRS.detect#569
arpitjain099 wants to merge 1 commit into
MIT-LCP:mainfrom
arpitjain099:chore/xqrs-detect-forward-learn

Conversation

@arpitjain099

Copy link
Copy Markdown

xqrs_detect() in wfdb/processing/qrs.py takes (and documents) a learn boolean, but the wrapper never passed it through to XQRS.detect():

xqrs.detect(sampfrom=sampfrom, sampto=sampto, verbose=verbose)

So learn was silently dropped and learning always ran, even when a caller set learn=False. The one-line fix forwards it:

xqrs.detect(sampfrom=sampfrom, sampto=sampto, learn=learn, verbose=verbose)

I also added a regression test (TestXQRSDetect.test_xqrs_detect_forwards_learn) that patches XQRS.detect and asserts the learn argument actually reaches it. The test fails against the old code (the learn kwarg is missing) and passes with the fix. I put it in a Test-prefixed class so pytest collects it (the existing test_qrs class name is not picked up by default collection).

Closes #473

xqrs_detect accepts a learn parameter and documents it, but the call to
XQRS.detect never passed it on, so learn=False was silently ignored and
learning always ran. Pass learn=learn through to the detector and add a
regression test that asserts the argument is forwarded.

Closes MIT-LCP#473

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
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.

wfd.processing.qrs.xqrs_detect() does not pass the learn parameter to xqrs.detect()

1 participant