Skip to content

TypeError: tuple indices must be integers or slices, not str #43

Open
@MeisterP

Description

@MeisterP

After updating to v0.2.3 (September 2022)
I get the following error when calling correct_rr(rr):

Cleaning the RR interval time series.
... correcting 3 missed interval(s).
... correcting 1 extra interval(s).
... correcting 89 ectopic interval(s).
... correcting 5 short interval(s).
... correcting 5 long interval(s).
Traceback (most recent call last):
  File "<string>", line 79, in <module>
TypeError: tuple indices must be integers or slices, not str

While trying to disable things one by one to debug (eg. correct_rr(rr, missed_correction=False) I got:

Cleaning the RR interval time series.
... correcting 1 extra interval(s).
... correcting 89 ectopic interval(s).
... correcting 5 short interval(s).
... correcting 5 long interval(s).
Traceback (most recent call last):
  File "<string>", line 77, in <module>
  File "/usr/lib/python3.10/site-packages/systole/correction.py", line 363, in correct_rr
    return _correct_rr(
  File "/usr/lib/python3.10/site-packages/systole/correction.py", line 263, in _correct_rr
    return clean_rr, (nMissed, nExtra, nEctopic, nShort, nLong)
UnboundLocalError: local variable 'nMissed' referenced before assignment

correct_rr(rr, n_iterations=2) doesn't work either:

Traceback (most recent call last):
  File "<string>", line 77, in <module>
TypeError: correct_rr() got an unexpected keyword argument 'n_iterations'

With version 0.2.2 correct_rr(rr, n_iterations=2, missed_correction=False) works as expected without errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions