You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are gists available for using PyEDFlib to write EDF files, and pyedflib seems to be relatively well maintained and used.
This proposal is to enable exporting EDF files, with a warning of course that there maybe loss of data in the info object. This would also enable mne-bids to perform writing EDF file datasets, which is a RECOMMENDED file format for storage of EEG/iEEG data.
In addition, this would enable writing to an open-access file format that is heavily interfaced in EEG industry. For example, Persyst, an EEG-analytics company can only read in manufacturing formats (natus/NK/etc.) and EDF. It cannot read fiff, BrainVision, or other open source formats.
Thanks for the heads up @sappelhoff! IMO PyPI availability (pyEDFlib) trumps pure Python (EDFlib-Python) in this case, also because it is an optional dependency. Another issue might be the custom license, which is probably compatible with BSD, but I'm not sure. However, it shouldn't be too difficult to switch to a different EDF writer if the situation changes.
honestly it's really a bummer that there is 3 EDF libraries in Python. Can
we make these people
collaborate so there is one good, well maintained and well tested library
with a permissive BSD/MIT license?
I think it's necessary for the community to consolidate and the python
ecosystem has understood this for years
(contrarily to C++ or Javascripts world which are a lot more messy to
navigate).
my 2c
If you count our own reader and Biosig there are even more. I completely agree that there should only be one well maintained EDF package in pure Python licensed under BSD/MIT.
I just noticed that EDFlib-Python is advertised as licensed under BSD-3 (in contrast to the LICENSE file in the repo). So maybe that's a good starting point? How would you proceed @agramfort?
If you count our own reader and Biosig there are even more. I completely agree that there should only be one well maintained EDF package in pure Python licensed under BSD/MIT.
I just noticed that EDFlib-Python is advertised as licensed under BSD-3 (in contrast to the LICENSE file in the repo).
honestly it's really a bummer that there is 3 EDF libraries in Python. Can we make these people collaborate so there is one good, well maintained and well tested library with a permissive BSD/MIT license?
There can be many reasons why people sometimes don't want to collaborate.
One example: how strict should an EDF-reader be in (dis)allowing to read from a not 100% compliant EDF file?
EDFlib and EDFbrowser are very strict. Not everybody likes that.
For me, the longterm future of the EDF format is more important than trying to please angry or disappointed users who have a database full of non-compliant files.
You're right, I didn't read the text but assumed because it is classified as "Other" that it is not any of the popular licenses (maybe it is possible to change this setting in GitLab somewhere?).
There can be many reasons why people sometimes don't want to collaborate.
One example: how strict should an EDF-reader be in (dis)allowing to read from a not 100% compliant EDF file?
EDFlib and EDFbrowser are very strict. Not everybody likes that.
For me, the longterm future of the EDF format is more important than trying to please angry or disappointed users who have a database full of non-compliant files.
Good example, we regularly deal with non-compliant files. I agree that it is important to enforce the file format, but often it's just tiny inconsistencies (such as different encodings) that are pretty easy to fix. This allows people to access their data, whereas the alternative is to have no data at all.
I think a good solution is to enforce strict mode by default, but allow some minor deviations optionally.
Regarding EDFlib-Python, would you be up for a PyPI release?
I would favor a strict support of the standard (whatever it means...)
otherwise you put the burden on yourself and not on the users who are often
very creative....
Regarding EDFlib-Python, would you be up for a PyPI release?
+1 for using @Teuniz 's "strict" EDFlib-Python library. I'd rather have an EDF file that can be read by EDFBrowser, then just "EDF by name" and can only be read by MNE/EEGlab functions.
If there is a pypi release, we can then add that as an optional dependency in export_edf?
An EDF writer should definitely be super strict. My comments on relaxing some restrictions a little apply only to a reader.
That's not going to happen. EDFlib is finished and offered "as is". Consider it an LTS release.
Any bugs wiil be fixed ofcourse. New function calls will be taken into consideration if it makes sense.
API breakage is not going to happen though.
Ofcourse, there's always the option to clone & fork and turn it into a "community project" but my support will be limited
to the vanilla EDFlib.
Understood and no problem. The Python version of EDFlib is split into a reader and a writer part
(they are different files) and you can simply grab the writer only and don't bother with the reader if you wish.
Reacted by Clemens Brunner, Stefan Appelhoff and Adam Li
@Teuniz would you be open to doing a PyPi release of python EDFlib? One of us could help out with the changes needed for packaging, if that makes a difference. If not, I think our only option for using EDFlib is incoporating the writer into our externals/ (which we tend to be hesitant to add things to)
@Teuniz would you be open to doing a PyPi release of python EDFlib? One of us could help out with the changes needed for packaging, if that makes a difference. If not, I think our only option for using EDFlib is incoporating the writer into our externals/ (which we tend to be hesitant to add things to)
I'll look into it, I have never done it before but I have a colleague with lots of Python experience.
It's just that we are entering the holiday period here, so it will take some time.
Reacted by Daniel McCloy, Adam Li and Stefan Appelhoff
Activity
larsoner commentedon Jul 13, 2021
Sounds reasonable to me
sappelhoff commentedon Jul 14, 2021
Just so that this doesn't get lost, @Teuniz has chimed in in mne-tools/mne-bids#840 (comment) and suggested https://gitlab.com/Teuniz/EDFlib-Python as an alternative.
Pros over
PyEDFlib:Cons:
Finally, I think both packages have an edge over https://github.com/bids-standard/pyedf which is a separate package independent of EDFlib, ... but it never took off.
cbrnr commentedon Jul 14, 2021
Thanks for the heads up @sappelhoff! IMO PyPI availability (pyEDFlib) trumps pure Python (EDFlib-Python) in this case, also because it is an optional dependency. Another issue might be the custom license, which is probably compatible with BSD, but I'm not sure. However, it shouldn't be too difficult to switch to a different EDF writer if the situation changes.
agramfort commentedon Jul 15, 2021
cbrnr commentedon Jul 15, 2021
If you count our own reader and Biosig there are even more. I completely agree that there should only be one well maintained EDF package in pure Python licensed under BSD/MIT.
I just noticed that EDFlib-Python is advertised as licensed under BSD-3 (in contrast to the
LICENSEfile in the repo). So maybe that's a good starting point? How would you proceed @agramfort?Teuniz commentedon Jul 15, 2021
Correct me if I'm wrong but the license file at https://gitlab.com/Teuniz/EDFlib-Python/-/blob/master/LICENSE has the same text as here: https://opensource.org/licenses/BSD-3-Clause
Teuniz commentedon Jul 15, 2021
There can be many reasons why people sometimes don't want to collaborate.
One example: how strict should an EDF-reader be in (dis)allowing to read from a not 100% compliant EDF file?
EDFlib and EDFbrowser are very strict. Not everybody likes that.
For me, the longterm future of the EDF format is more important than trying to please angry or disappointed users who have a database full of non-compliant files.
cbrnr commentedon Jul 15, 2021
You're right, I didn't read the text but assumed because it is classified as "Other" that it is not any of the popular licenses (maybe it is possible to change this setting in GitLab somewhere?).
cbrnr commentedon Jul 15, 2021
Good example, we regularly deal with non-compliant files. I agree that it is important to enforce the file format, but often it's just tiny inconsistencies (such as different encodings) that are pretty easy to fix. This allows people to access their data, whereas the alternative is to have no data at all.
I think a good solution is to enforce strict mode by default, but allow some minor deviations optionally.
Regarding EDFlib-Python, would you be up for a PyPI release?
agramfort commentedon Jul 15, 2021
adam2392 commentedon Jul 15, 2021
+1 for using @Teuniz 's "strict" EDFlib-Python library. I'd rather have an EDF file that can be read by EDFBrowser, then just "EDF by name" and can only be read by MNE/EEGlab functions.
If there is a pypi release, we can then add that as an optional dependency in
export_edf?cbrnr commentedon Jul 15, 2021
An EDF writer should definitely be super strict. My comments on relaxing some restrictions a little apply only to a reader.
Teuniz commentedon Jul 16, 2021
That's not going to happen. EDFlib is finished and offered "as is". Consider it an LTS release.
Any bugs wiil be fixed ofcourse. New function calls will be taken into consideration if it makes sense.
API breakage is not going to happen though.
Ofcourse, there's always the option to clone & fork and turn it into a "community project" but my support will be limited
to the vanilla EDFlib.
cbrnr commentedon Jul 16, 2021
I think we were mostly talking about the writer component, because we already have our own reader which is not that strict.
Teuniz commentedon Jul 16, 2021
Understood and no problem. The Python version of EDFlib is split into a reader and a writer part
(they are different files) and you can simply grab the writer only and don't bother with the reader if you wish.
adam2392 commentedon Jul 16, 2021
Awesome!
What would be the next best course of action here if EDFlib isn't pypi released?
drammock commentedon Jul 16, 2021
@Teuniz would you be open to doing a PyPi release of python EDFlib? One of us could help out with the changes needed for packaging, if that makes a difference. If not, I think our only option for using EDFlib is incoporating the writer into our
externals/(which we tend to be hesitant to add things to)Teuniz commentedon Jul 16, 2021
I'll look into it, I have never done it before but I have a colleague with lots of Python experience.
It's just that we are entering the holiday period here, so it will take some time.
adam2392 commentedon Aug 4, 2021
I took a stab at sketching out the export functionality. The barebones works (with some details not matching up).
Just a friendly ping to see if there was any update on getting a PyPi release? I can help with it if needed?
Teuniz commentedon Aug 5, 2021
It's done, you can find it here: https://pypi.org/project/EDFlib-Python/