Replace deprecated Numba types in jit-compiled functions
connortann opened this issue · 0 comments
connortann commented
At present we have several warnings in the test suite along the lines of Encountered the use of a type that is scheduled for deprecation
.
If we wish for shap to remain compatible with the latest versions of other libraries, we should address this issue by updating the jit-compiled functions as explained in the numbda docs here:
Here is an extract of some relevant warnings from the test suite:
tests/maskers/test_image.py::test_serialization_image_masker_inpaint_telea
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'heap' of function '_siftdown'.
For more information visit https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types
File "../../../../../opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/numba/cpython/heapq.py", line 12:
@register_jitable
def _siftdown(heap, startpos, pos):
^
tests/maskers/test_image.py::test_serialization_image_masker_inpaint_telea
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'heap' of function '_siftup'.
For more information visit https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types
File "../../../../../opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/numba/cpython/heapq.py", line 28:
@register_jitable
def _siftup(heap, pos):
^
tests/maskers/test_image.py::test_serialization_image_masker_inpaint_telea
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'heap' of function 'hq_heappop.<locals>.hq_heappop_impl'.
For more information visit https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types
File "../../../../../opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/numba/cpython/heapq.py", line 138:
def hq_heappop_impl(heap):
^
tests/maskers/test_image.py::test_serialization_image_masker_inpaint_telea
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'seq' of function 'sequence_bool.<locals>.sequence_bool_impl'.
For more information visit https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types
File "../../../../../opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/numba/cpython/listobj.py", line 673:
def sequence_bool(context, builder, sig, args):
def sequence_bool_impl(seq):
^
tests/maskers/test_image.py::test_serialization_image_masker_inpaint_telea
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'heap' of function 'heappush.<locals>.hq_heappush_impl'.
For more information visit https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types
File "../../../../../opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages/numba/cpython/heapq.py", line 155:
def hq_heappush_impl(heap, item):
^
tests/maskers/test_image.py::test_serialization_image_masker_inpaint_telea
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'q' of function '_jit_build_partition_tree'.
For more information visit https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types
File "shap/maskers/_image.py", line 175:
@jit(nopython=False)
def _jit_build_partition_tree(xmin, xmax, ymin, ymax, zmin, zmax, total_ywidth, total_zwidth, M, clustering, q):
^