mne-tools / mne-tools/mne-python

BUG: EDF stim resampling when NaN/inf are present

Open
#7,576 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Describe the bug

I cannot plot the data again after applying filtering.

Steps to reproduce
	data_highpass = data.copy().filter(l_freq=0.5, h_freq=None)
	
	data.plot(n_channels=61, scalings="auto") # this works as expected
	plt.show()

	data_highpass.plot(n_channels=61, scalings="auto") # here I get the error
	plt.show()
Expected results

It should be able to plot data after filtering

Actual results

ValueError: cannot convert float NaN to integer

Additional information

Platform: Linux-5.3.0-45-generic-x86_64-with-glibc2.10
Python: 3.8.1 (default, Jan 8 2020, 22:29:32) [GCC 7.3.0]
Executable: /home/andrea/anaconda3/envs/bci_competition/bin/python
CPU: x86_64: 8 cores
Memory: 7.6 GB

mne: 0.19.2
numpy: 1.18.1 {blas=mkl_rt, lapack=mkl_rt}
scipy: 1.4.1
matplotlib: 3.2.0 {backend=TkAgg}

sklearn: 0.22.2.post1
numba: Not found
nibabel: Not found
cupy: Not found
pandas: 1.0.1
dipy: Not found
mayavi: Not found
pyvista: Not found
vtk: Not found

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the filtering and plotting sequence from the issue with the reported MNE, NumPy, SciPy, and Matplotlib versions, and inspect where the NaN-to-integer ValueError is raised. Trace the EDF stimulus resampling and plotting path; done means filtered data containing NaN or inf can be plotted without this error, with a regression test covering the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.