NeuroKit icon indicating copy to clipboard operation
NeuroKit copied to clipboard

`eda_plot` throws ValueError when the number of onsets is not the same as the number of peaks

Open Rvb0rob0t opened this issue 2 years ago • 3 comments

Describe the bug eda_plot throws ValueError when the number of onsets is not the same as the number of peaks because of the sentence https://github.com/neuropsychology/NeuroKit/blob/c1104386655724a5c624e740abf651c939fc5e48/neurokit2/eda/eda_plot.py#L114

To Reproduce

  1. Get a signal with a peak without an onset, like
[0.0,
 0.180624,
 0.217774,
 0.25108,
 0.228022,
 0.226741,
 0.226741,
 0.219055,
 0.217774,
 0.21265]
  1. Process it without cleaning like in #554 (I'm also using an Empatica E4)
  2. Try to plot the resulting signals with eda_plot()
  3. See error

Expected behaviour I would expect one of the following:

  • that in this case, eda_plot would simply not plot the first onset.
  • that it warns that the specific fact that there is a peak without an onset is a problem.

System Specifications

  • OS: Linux (ELF 64bit)

  • Python: 3.10.2

  • NeuroKit2: 0.1.7

  • NumPy: 1.22.3

  • Pandas: 1.4.1

  • SciPy: 1.8.0

  • sklearn: 1.0.2

  • matplotlib: 3.5.1

Rvb0rob0t avatar Mar 30 '22 00:03 Rvb0rob0t

Hi 👋 Thanks for reaching out and opening your first issue here! We'll try to come back to you as soon as possible. ❤️ kenobi

welcome[bot] avatar Mar 30 '22 00:03 welcome[bot]

that in this case, eda_plot would simply not plot the first onset.

Yes we should go ahead with this option, I don't think there is a need for a warning.

Would you mind opening another PR with a fix? Thanks a lot!

DominiqueMakowski avatar Mar 31 '22 02:03 DominiqueMakowski

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Sep 20 '22 19:09 stale[bot]

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Nov 25 '22 04:11 stale[bot]