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

improved speedup write with F-contiguous arrays #137

Closed LucaCerina closed 3 years ago

LucaCerina commented 3 years ago

Referencing discussion in #92 all Fortran-contiguous arrays are transformed before writing. This vastly improves write speed for this kind of arrays.

skjerns commented 3 years ago

Thank's alot for the contribution!

in edfwriter.py there is also the line in 787-791 :) you can just copy&paste the segment from before. Else it looks good to me.

LucaCerina commented 3 years ago

You are right, I forgot people may be calling edfwriter directly. As a solution I moved the check at edfwriter level instead of highlevel. Once its done before writing samples, we don't need the other ravel calls because 'data_list[i]' is already flattened and C-contiguous

skjerns commented 3 years ago

thanks :) looks good now!

skjerns commented 3 years ago

oops appareantly the "all checks passed" was a display error and now some builds fail. I'll check it out and fix it if necessary. Should not be a major bug though