bmcfee / resampy

Efficient sample rate conversion in python
https://resampy.readthedocs.io
ISC License
253 stars 36 forks source link

Missing argument in guvectorize decorator ? #112

Closed blakesmithsonos closed 2 years ago

blakesmithsonos commented 2 years ago

I see here that the ftylist argument has been recently removed from the decorator's arguments. In numba>=0.53 this seems to be required. In my pipeline, I'm now suddenly getting the following error which led me to track it down to this.

  File "...python3.7/site-packages/resampy/interpn.py", line 75, in <module>
    nopython=True,
TypeError: guvectorize() missing 1 required positional argument: 'signature'
bmcfee commented 2 years ago

Thanks for flagging this. I'm not sure it's correct to identify the issue with numba>=0.53 though. Our CI tests have been running on 0.53 for a while, and my dev machine uses 0.56 without issue:

In [6]: import numba

In [7]: import numpy as np

In [8]: import resampy

In [9]: x = np.random.randn(22050)

In [10]: resampy.resample(x, 22050, 11025)
Out[10]: 
array([-0.55596902, -0.34749474,  0.35927397, ..., -1.36776424,
       -0.30098502,  1.32339942])

In [11]: numba.__version__
Out[11]: '0.56.0'

I noticed that your link is pointing to an old fork of numba, not the main repository. In the upstream repo, the relevant link is https://github.com/numba/numba/blob/3a5627831ca85255cd1d3c74d07b602731fa51cb/numba/np/ufunc/decorators.py#L133 and reading through it, I see no requirement to provide explicit ftylist: https://github.com/numba/numba/blob/3a5627831ca85255cd1d3c74d07b602731fa51cb/numba/np/ufunc/decorators.py#L177-L180

Are you sure that you have a correct / up to date numba installation?

blakesmithsonos commented 2 years ago

You're absolutely right, my numba version was out-of-date 😓 Thanks for the quick reply and your help !