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
209 stars 121 forks source link

use oldest-supported-numpy to build #164

Closed hofaflo closed 2 years ago

hofaflo commented 2 years ago

In the v0.1.24 release, pyedflib's cython extension was compiled against Numpy 1.22.1 for Python versions >=3.8 (see workflow). Trying to import pyedflib in a local environment with a lower minor NumPy version (e.g. 1.21.5) leads to the cython error message shown in #156.

The discussion on the introduction of an ndarray size change in NumPy 1.20.0 (link) contains a suggestion to use oldest-supported-numpy for building C/cython extensions.

I'm not sure why this error appears at the switch between 1.21 and 1.22 as the size change was introduced in 1.20 and have only tested this on Python 3.10 (Win10, 64bit), but if you and the CI workflows agree, this could be a solution :)

holgern commented 2 years ago

Thanks, this seems to be a good solution.