numpy.fft sub-package cannot be used
Found this while trying out: https://github.com/fluiddyn/transonic-demos/pull/1
Minimal example
import numpy as np
from numpy.fft import fft
from transonic import jit
@jit
def test(u):
u_fft = fft(u)
return u
print(test(np.exp(2j * np.pi * np.arange(8) / 8)))
Traceback
❯ TRANSONIC_DEBUG=1 python test_fft.py
DEBUG: extast.parse
DEBUG: compute ancestors and chains
DEBUG: compute code dependance
DEBUG: {'test': 'from numpy.fft import fft'}
Traceback (most recent call last):
File "/home/avmo/.pyenv/versions/fluiddyn/lib/python3.8/site-packages/transonic/analyses/util.py", line 387, in get_exterior_code
with open(str(file_path), "r") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'numpy/fft.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test_fft.py", line 8, in <module>
def test(u):
File "/home/avmo/.pyenv/versions/fluiddyn/lib/python3.8/site-packages/transonic/justintime.py", line 193, in jit
decor = JIT(frame, backend=backend, native=native, xsimd=xsimd, openmp=openmp)
File "/home/avmo/.pyenv/versions/fluiddyn/lib/python3.8/site-packages/transonic/justintime.py", line 208, in __init__
self.mod = _get_module_jit(backend, frame=frame)
File "/home/avmo/.pyenv/versions/fluiddyn/lib/python3.8/site-packages/transonic/justintime.py", line 185, in _get_module_jit
return ModuleJIT(backend_name=backend_name, frame=frame)
File "/home/avmo/.pyenv/versions/fluiddyn/lib/python3.8/site-packages/transonic/justintime.py", line 115, in __init__
) = analysis_jit(self.get_source(), self.filename, backend_name)
File "/home/avmo/.pyenv/versions/fluiddyn/lib/python3.8/site-packages/transonic/analyses/justintime.py", line 109, in analysis_jit
codes_dependance, code_ext, jitted_dicts, spe = get_exterior_code(
File "/home/avmo/.pyenv/versions/fluiddyn/lib/python3.8/site-packages/transonic/analyses/util.py", line 390, in get_exterior_code
raise NotImplementedError(file_name + " can no be found")
NotImplementedError: numpy.fft can no be found
Edited by Ashwin V. Mohanan