YannickJadoul / Parselmouth

Praat in Python, the Pythonic way
https://parselmouth.readthedocs.io/
GNU General Public License v3.0
1.07k stars 116 forks source link

Numpy v2 incompatibility #125

Closed tikuma-lsuhsc closed 3 months ago

tikuma-lsuhsc commented 5 months ago

While Parselmouth does run with the just released numpy 2, it's output may be faulty.

For example,

>>> ...
>>>sound = pm.Sound(x, fs)
>>>pitch = sound.to_pitch_ac(time_step=0.001)
>>>pitch.ts()[:9]

prints

'[1.126 1.126 1.126 1.126 1.126 1.126 1.126 1.126 1.126]'

rather than expected

'[0.015 0.016 0.017 0.018 0.019 0.02  0.021 0.022 0.023]'

Current Workaround

Downgrade numpy by pinning it the last release

pip install -U 'numpy<2'
YannickJadoul commented 3 months ago

Thanks so much, @hokiedsp! Fixed in 0.4.4, with the fix from pybind11 backported: https://github.com/YannickJadoul/Parselmouth/releases/tag/v0.4.4