Skip to content

Setting fbands without ulf crashes the welch method #42

@GGChe

Description

@GGChe

I am using python 3.10.2 under windows 10. I am trying to change the frequency bands of the pyhrv welch method and I am getting an UnbondLocalError.

import pyhrv
rr = [1,2,3,4,5,6,7,8,9,10]
pyhrv.frequency_domain.welch_psd(rr, fbands={'vlf': (0.003, 0.04), 'lf': (0.04, 0.15), 'hf': (0.15, 0.4)})

Error obtained:

>>> pyhrv.frequency_domain.welch_psd(rr, fbands={'vlf': (0.003, 0.04), 'lf': (0.04, 0.15), 'hf': (0.15, 0.4)})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ggaleote\Documents\git\sinus-rhythms-pathologies\.venv\lib\site-packages\pyhrv\frequency_domain.py", line 159, in welch_psd
    fbands = _check_freq_bands(fbands)
  File "C:\Users\ggaleote\Documents\git\sinus-rhythms-pathologies\.venv\lib\site-packages\pyhrv\frequency_domain.py", line 700, in _check_freq_bands
    args_.append(ulf)
UnboundLocalError: local variable 'ulf' referenced before assignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions