cbrnr / sleepecg

Sleep stage detection using ECG
BSD 3-Clause "New" or "Revised" License
86 stars 22 forks source link

Use edfio for reading and writing edf files #195

Closed hofaflo closed 8 months ago

hofaflo commented 8 months ago

edfio could replace PyEDFlib and mne for our use cases. We would have to drop support for Python 3.8, but that is in line with the schedule we decided on in #16 anyway.

cbrnr commented 8 months ago

Really? We need pooch just to get the SciPy ECG toy data?

hofaflo commented 8 months ago

Apparently yes :grimacing: Do you prefer to bundle an ecg signal with the package instead?

cbrnr commented 8 months ago

Do you prefer to bundle an ecg signal with the package instead?

Yes. I'd store it as compressed .npz, then it takes up only 163kB. We could store it in sleepecg/data (in analogy to sleepecg/classifiers)?

cbrnr commented 8 months ago

Maybe we could even add a little function to access the toy data (sleepecg.get_toy_ecg() or something similar)?

cbrnr commented 8 months ago

Regarding dropping support for Python 3.8, I don't think we can already remove from __future__ import annotations, right? This is still required for Python 3.9, or is it?

cbrnr commented 8 months ago

Of course the other option is to export the toy data to EDF and add edfio to our base requirements.

hofaflo commented 8 months ago

I opted for the .npz file because the .edf would be a bit larger and introduce slight signal deviations.

Ad future imports: A few have become obsolete, but most of them have to stay until 3.10, yes.

cbrnr commented 8 months ago

Great! I assume nothing has to be done to make sure the data gets added to the wheels, correct? We're still using MANIFEST.in unfortunately.

hofaflo commented 8 months ago

I think graft sleepecg makes sure this is included, yes. As cibuildwheel runs pytest after installing the built wheel, the checks would fail otherwise anyway.

cbrnr commented 8 months ago

Thanks @hofaflo!