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

non-empty data check in edfwriter to prevent unknown OS error #125

Closed BlakeJC94 closed 3 years ago

BlakeJC94 commented 3 years ago

Ran into an issue on Ubuntu and Windows that would cause edfWriter to wither hang or crash and return IOError('Unknown error while calling blockWriteSamples') (edfWriter.py:741). Investigated and found this occurs if len(data_list) == 0 in edfWriter.writeSamples().

Added another conditional for this on line 693 to save future users effort in debugging.

codecov[bot] commented 3 years ago

Codecov Report

Merging #125 (12d8734) into master (02f46ad) will decrease coverage by 0.03%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
- Coverage   67.89%   67.86%   -0.04%     
==========================================
  Files           7        7              
  Lines        3623     3625       +2     
  Branches      166      167       +1     
==========================================
  Hits         2460     2460              
- Misses       1107     1108       +1     
- Partials       56       57       +1     
Impacted Files Coverage Δ
pyedflib/edfwriter.py 78.03% <0.00%> (-0.52%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 02f46ad...12d8734. Read the comment docs.

skjerns commented 3 years ago

Thanks alot!

Maybe we can split up the errors in two different errors and include a more detailed error message?