Skip to content
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

FutureWarning in log of failed docs build due to ecg_delineate #897

Closed
danibene opened this issue Sep 6, 2023 · 2 comments
Closed

FutureWarning in log of failed docs build due to ecg_delineate #897

danibene opened this issue Sep 6, 2023 · 2 comments

Comments

@danibene
Copy link
Collaborator

danibene commented Sep 6, 2023

The docs build is currently failing: https://github.com/neuropsychology/NeuroKit/actions/runs/6081656167/job/16538141261?pr=863
And includes the following warning:

D:\a\NeuroKit\NeuroKit\neurokit2\ecg\ecg_delineate.py:1015: FutureWarning: The behavior of obj[i:j] with a float-dtype index is deprecated. In a future version, this will be treated as positional instead of label-based. For label-based slicing, use obj.loc[i:j] instead
  segment = heartbeat[:0]  # Select left hand side

I thought this should be addressed by changing heartbeat[:0] to heartbeat.iloc[:0], but this led to a failing test:
https://github.com/neuropsychology/NeuroKit/actions/runs/6098830607/job/16549573373

So it would be good if someone could eventually look into the best way to address this warning

@danibene danibene changed the title FutureWarning in log of failed docs check due to ecg_delineate FutureWarning in log of failed docs build due to ecg_delineate Sep 6, 2023
@danibene danibene mentioned this issue Sep 6, 2023
2 tasks
@DominiqueMakowski
Copy link
Member

Shouldn't it be .loc[0:] ?

I think it's because the index is a float (corresponding to time) and we want to subset the stuff after the R-peak (that happens at 0 ms)

danibene added a commit to danibene/NeuroKit that referenced this issue Sep 7, 2023
@danibene danibene mentioned this issue Sep 7, 2023
2 tasks
@danibene
Copy link
Collaborator Author

danibene commented Sep 7, 2023

Shouldn't it be .loc[0:] ?

I think it's because the index is a float (corresponding to time) and we want to subset the stuff after the R-peak (that happens at 0 ms)

Ah yes that makes sense thank you!

@danibene danibene closed this as completed Sep 7, 2023
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

No branches or pull requests

2 participants