Comments (5)
Thank you for reporting this, I suspect this might be due to artefacts close to each other, can you share the data you are using so I can reproduce the error?
from systole.
My code is failing because the output of the correct_rr()
function changed.
import pandas as pd
from systole.correction import correct_rr
df = pd.read_csv('data.csv')
correct = correct_rr(df['R-R'])
with version 0.2.2:
print(correct)
{'clean_rr': array([565., 560., 560., ..., 507., 512., 509.]), 'ectopic': 66, 'short': 40, 'long': 11, 'extra': 17, 'missed': 0}
print(correct['clean_rr'])
[565. 560. 560. ... 507. 512. 509.]
with version 0.2.3:
print(correct)
(array([565., 560., 560., ..., 507., 512., 509.]), (0, 17, 21, 30, 10))
print(correct['clean_rr'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: tuple indices must be integers or slices, not str
from systole.
It looks like the function is working correctly but the way it returns the results have changed:
https://embodied-computation-group.github.io/systole/generated/correction/systole.correction.correct_rr.html#systole.correction.correct_rr
It is now returning a tuple like:
clean_rr, (nMissed, nExtra, nEctopic, nShort, Long) = correct_rr(df['R-R'])
If you use the code above it should work. Sorry for this refactoring, the function has been completely rewritten in this release.
from systole.
There's no need to be sorry. Thanks for your work and support. Much appreciated. 👍
Not sure whether I'm misreading the docs... but I can't get arguments to work.
correct = correct_rr(df['R-R'], extra_correction=False)
Cleaning the RR interval time series.
... correcting 21 ectopic interval(s).
... correcting 30 short interval(s).
... correcting 12 long interval(s).
Traceback (most recent call last):
File "<stdin>", line 1, 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 'nExtra' referenced before assignment
correct = correct_rr(df['R-R'], n_iterations=2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: correct_rr() got an unexpected keyword argument 'n_iterations'
from systole.
I see the error comes from the absence of extra correction that is not correctly accounted for in the code, I will fix that as soon as possible. Thank you for pointing that out.
For the second example, the n_iteration
argument has been removed in the new API to better fit with the original paper, so the function will not allow running multiple iterations of the algorithm.
from systole.
Related Issues (20)
- plot_evoked does not work as expected for epochs inputs
- Editorial comments to JOSS submission
- Inconsistent spelling of Python
- Package vs library
- Reference not showing up properly HOT 2
- Bibliography
- Recurrence matrix: faster implementation HOT 3
- RR correction order causes index overflows HOT 3
- The Editor's response button is not working
- Add an option to compare corrected and uncorrected peaks in plot_rr
- I want to use this package with emotibit. HOT 2
- Question about function 'readInwaiting' HOT 1
- ppg_peaks draw some error! HOT 2
- Few remarks from a first-timer HOT 3
- bokeh slider is not automatically fitting windows size
- interpolation problem when using ppg_peaks HOT 2
- Labelling of bad segments functionality is not working in the case of artefact rejection for ECG signal
- correct_rr function for ectopic beat correction still produces very high RMSSD a values
- view corrected peaks using systole viewer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systole.