Skip to content

Pass kwargs from ecg_process to ecg_clean #1079

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

Merged

Conversation

atpage
Copy link
Contributor

@atpage atpage commented Mar 10, 2025

Description

ecg_clean() accepts powerline as a kwarg, which gets passed down to signal_filter(). However, the ecg_process() wrapper that calls ecg_clean() does not accept or pass kwargs, including powerline.

This patch is an extension of the work in Issue #610. It enables passing kwargs to ecg_clean() from a higher level, namely ecg_process().

For instance, `powerline=60` can now be given as an argument to ecg_process (Issue neuropsychology#610)
@DerAndereJohannes DerAndereJohannes mentioned this pull request Apr 25, 2025
14 tasks
@DerAndereJohannes
Copy link
Collaborator

Thanks atpage for the pull request! Using this

I checked the branch using the following code:

import neurokit2 as nk
import matplotlib.pyplot as plt

ecg = nk.ecg_simulate(duration=10, sampling_rate=1000)

noise = nk.signal_simulate(frequency=60, amplitude=0.2)

noisy_ecg = ecg + noise

signals, info = nk.ecg_process(noisy_ecg, powerline=60)

nk.signal_plot(signals["ECG_Clean"])

plt.show()

and it seems to work well. The failed checks on this branch come from a different reason, so I will merge it into dev.

@DerAndereJohannes DerAndereJohannes merged commit 59f6e0c into neuropsychology:dev Apr 26, 2025
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants