I again tried to get numba working on my slowest code.
I shorted the code to some code should represent my current code problems, also it does not make any sense at all.
The numba compiler seams to have problems with the with the range function over a shape of an array and I am not allowed to copy an array. I am using numba 0.52.0 from conda-forge.
It seam I have to use a signatur or the compiler would not be able to infer the Dictionary.
@jit([(u2[::], DictType(u2, DictType(u2,u2))),
(u2[::], u2[::])], nopython=False)
def _func(io_array, in_percentage_dict):
io_main_class_percentage = io_array.copy()
io_percentage_data = io_array.copy()
for x in range(io_array.shape[1]):
for y in range(io_array.shape[2]):
io_percentage_data[0, x, y] = in_percentage_dict[1][5]
return io_percentage_data, io_main_class_percentage
The errors are:
:1: NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function “_func” failed type inference due to: Internal error at <numba.core.typeinfer.StaticGetItemConstraint object at 0x000001886AAEE4C0>.
tuple index out of range
During: typing of static-get-item at (7)
Enable logging at debug level for details.File “”, line 7:
def _func(io_array, in_percentage_dict):
for x in range(io_array.shape[1]): ^
@jit([(u2[::], DictType(u2, DictType(u2,u2))),
:1: NumbaWarning:
Compilation is falling back to object mode WITHOUT looplifting enabled because Function “_func” failed type inference due to: Cannot determine Numba type of <class ‘numba.core.dispatcher.LiftedLoop’>File “”, line 7:
def _func(io_array, in_percentage_dict):
for x in range(io_array.shape[1]): ^
@jit([(u2[::], DictType(u2, DictType(u2,u2))),
C:\Users\remote\anaconda3\envs\COP4EE-Current_SeH\lib\site-packages\numba\core\object_mode_passes.py:151: NumbaWarning: Function “_func” was compiled in object mode without forceobj=True, but has lifted loops.File “”, line 4:
def _func(io_array, in_percentage_dict):
io_main_class_percentage = io_array.copy()
^warnings.warn(errors.NumbaWarning(warn_msg,
C:\Users\remote\anaconda3\envs\COP4EE-Current_SeH\lib\site-packages\numba\core\object_mode_passes.py:161: NumbaDeprecationWarning:
Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.For more information visit Deprecation Notices — Numba 0.50.1 documentation
File “”, line 4:
def _func(io_array, in_percentage_dict):
io_main_class_percentage = io_array.copy()
^warnings.warn(errors.NumbaDeprecationWarning(msg,
:1: NumbaWarning:
Compilation is falling back to object mode WITH looplifting enabled because Function “_func” failed type inference due to: Internal error at <numba.core.typeinfer.StaticGetItemConstraint object at 0x000001886B095D00>.
tuple index out of range
During: typing of static-get-item at (7)
Enable logging at debug level for details.File “”, line 7:
def _func(io_array, in_percentage_dict):
for x in range(io_array.shape[1]): ^
@jit([(u2[::], DictType(u2, DictType(u2,u2))),
:1: NumbaWarning:
Compilation is falling back to object mode WITHOUT looplifting enabled because Function “_func” failed type inference due to: Cannot determine Numba type of <class ‘numba.core.dispatcher.LiftedLoop’>File “”, line 7:
def _func(io_array, in_percentage_dict):
for x in range(io_array.shape[1]): ^
@jit([(u2[::], DictType(u2, DictType(u2,u2))),
C:\Users\remote\anaconda3\envs\COP4EE-Current_SeH\lib\site-packages\numba\core\object_mode_passes.py:151: NumbaWarning: Function “_func” was compiled in object mode without forceobj=True, but has lifted loops.File “”, line 4:
def _func(io_array, in_percentage_dict):
io_main_class_percentage = io_array.copy()
^warnings.warn(errors.NumbaWarning(warn_msg,
C:\Users\remote\anaconda3\envs\COP4EE-Current_SeH\lib\site-packages\numba\core\object_mode_passes.py:161: NumbaDeprecationWarning:
Fall-back from the nopython compilation path to the object mode compilation path has been detected, this is deprecated behaviour.For more information visit Deprecation Notices — Numba 0.50.1 documentation
File “”, line 4:
def _func(io_array, in_percentage_dict):
io_main_class_percentage = io_array.copy()
^warnings.warn(errors.NumbaDeprecationWarning(msg,