-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when computing rsp_rate from troughs as np.array or list #1067
Comments
Good catch! Thank you for reporting this. It seems as if this is a documentation error, though perhaps we should change the code to better reflect the actual documentation and to therefore allow for your use of the function to work. Right now it seems to assume a DataFrame and directly uses the dictionary key. Here is the quick fix for now: # Remove dictionary lookup
# rate = nk.rsp_rate(rsp, info['RSP_Troughs'], sampling_rate=1000)
rate = nk.rsp_rate(rsp, info, sampling_rate=1000) |
@DerAndereJohannes Thank you for your quick feedback ! Should I open a PR ? Also if your proposed change is implemented, should the doc be updated to remove pd.DataFrame as a valid format ? Just making sure that there is no confusion, and that it will not be possible in that case to directly pass, for example, the output of |
Sorry for the late response! A documentation change should definitely happen since it is currently incorrect. We can still make the function more lenient and accept all of the below:
This would make the current documentation correct again. If you feel up to the task, feel free to give it a go too ;-) Otherwise, I can do it on your behalf. |
Thank you ! I can open the PR :) |
Go for it Marie-Eve and thanks 🙏 |
Describe the bug
A description of what the bug is. Try coping the last steps that caused the error. Don't forget to also copy if possible the error log (the message related to the error).
In the description of the rsp_rate function, it is mentioned that troughs can either be list, np.array, pd.Series, pd.DataFrame. However, troughs are extracted in the code as followed:
troughs["RSP_Troughs"]
Hence, an error is thrown if a list or an array is specified when calling the function.
To Reproduce
Example steps to reproduce the behaviour. For instance:
System Specifications
It's important that you give us some information about the system you are using. For that you can run:
The text was updated successfully, but these errors were encountered: