pyedf icon indicating copy to clipboard operation
pyedf copied to clipboard

Issue when using EDFRecordingExtractor with pyEDFlib

Open betty6you opened this issue 3 years ago • 3 comments

To use EDFRecordingExtractor, I installed pyEDFlib. It works well for extracting the data, but when I start to run sorters, it shows the error below.

File ~.conda\envs\si_env\lib\site-packages\neo\rawio\edfrawio.py:70, in EDFRawIO._parse_header(self) 67 if ('EDF+' in file_version_header) and ('EDF+C' not in file_version_header): 68 raise ValueError('Only continuous EDF+ files are currently supported.') ---> 70 self.edf_reader = EdfReader(self.filename) 71 # load headers, signal information and 72 self.edf_header = self.edf_reader.getHeader()

File pyedflib_extensions_pyedflib.pyx:146, in pyedflib._extensions._pyedflib.CyEdfReader.init()

File pyedflib_extensions_pyedflib.pyx:209, in pyedflib._extensions._pyedflib.CyEdfReader.open()

File pyedflib_extensions_pyedflib.pyx:181, in pyedflib._extensions._pyedflib.CyEdfReader.check_open_ok()

OSError: C:\Users\betty\Desktop\SpikeInterface\EDF\Week2Day1_220822_155852_section1.edf: file has already been opened

I don't know how to close it. Please help me with it.

betty6you avatar Oct 06 '22 17:10 betty6you

Have you tried the close() method?

To help any more, I'll need to see more of your code.

palday avatar Oct 07 '22 04:10 palday

Thanks! Here is my code. https://github.com/betty6you/EDFRecordingExtractor/blob/main/EDF_extractor_test.ipynb

betty6you avatar Oct 12 '22 16:10 betty6you

Yes, you need to actually execute the cell with close() and then the file will be closed

un-executed jupyter cell containing call to close

palday avatar Oct 13 '22 00:10 palday