holgern / pyedflib

pyedflib is a python library to read/write EDF+/BDF+ files based on EDFlib.
http://pyedflib.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
214 stars 121 forks source link

EDFWriter raises error when writing annotations #119

Closed meta00 closed 3 years ago

meta00 commented 3 years ago

Hi, I am writing an edf file with highlevel.write_edf using the output of highlevel.read_edf. My example file is attached. The error is raised at line 736 of edfwriter.py for if duration_in_seconds >= 0: E TypeError: '>=' not supported between instances of 'bytes' and 'int'. This is because in the annotations of the header, the annotation event's duration_in_seconds is read as a bytes type. I tried to convert that to float, it worked and wrote out an edf file. This file once read in again has duration_in_seconds of bytes type. Could you fix either the reader or writer? out.edf.zip

Thanks for your attention.

skjerns commented 3 years ago

Thanks for reporting this error.

I fixed it in #126