Created
June 24, 2025 23:33
-
-
Save mweinelt/4cd988122a3609f2f74b16c113c3a37b to your computer and use it in GitHub Desktop.
pynndesecent, python 3.13, test failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sourcing python-remove-tests-dir-hook | |
Sourcing python-catch-conflicts-hook.sh | |
Sourcing python-remove-bin-bytecode-hook.sh | |
Sourcing pypa-build-hook | |
Using pypaBuildPhase | |
Sourcing python-runtime-deps-check-hook | |
Using pythonRuntimeDepsCheckHook | |
Sourcing pypa-install-hook | |
Using pypaInstallPhase | |
Sourcing python-imports-check-hook.sh | |
Using pythonImportsCheckPhase | |
Sourcing python-namespaces-hook | |
Sourcing python-catch-conflicts-hook.sh | |
Sourcing pytest-check-hook | |
Using pytestCheckPhase | |
Running phase: unpackPhase | |
unpacking source archive /nix/store/7aqh0rnvih7p160fc7q3lry0la99cvv0-source | |
source root is source | |
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/setup.py" | |
Running phase: patchPhase | |
Running phase: updateAutotoolsGnuConfigScriptsPhase | |
Running phase: configurePhase | |
no configure script, doing nothing | |
Running phase: buildPhase | |
Executing pypaBuildPhase | |
Creating a wheel... | |
pypa build flags: --no-isolation --outdir dist/ --wheel | |
* Getting build dependencies for wheel... | |
/nix/store/1jzascxfclrgksjdj84bf99c2m56jzk2-python3.13-setuptools-80.7.1/lib/python3.13/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'test_suite' | |
warnings.warn(msg) | |
/nix/store/1jzascxfclrgksjdj84bf99c2m56jzk2-python3.13-setuptools-80.7.1/lib/python3.13/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'tests_require' | |
warnings.warn(msg) | |
/nix/store/1jzascxfclrgksjdj84bf99c2m56jzk2-python3.13-setuptools-80.7.1/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. | |
!! | |
******************************************************************************** | |
Please consider removing the following classifiers in favor of a SPDX license expression: | |
License :: OSI Approved | |
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. | |
******************************************************************************** | |
!! | |
self._finalize_license_expression() | |
running egg_info | |
creating pynndescent.egg-info | |
writing pynndescent.egg-info/PKG-INFO | |
writing dependency_links to pynndescent.egg-info/dependency_links.txt | |
writing requirements to pynndescent.egg-info/requires.txt | |
writing top-level names to pynndescent.egg-info/top_level.txt | |
writing manifest file 'pynndescent.egg-info/SOURCES.txt' | |
reading manifest file 'pynndescent.egg-info/SOURCES.txt' | |
reading manifest template 'MANIFEST.in' | |
no previously-included directories found matching 'pynndescent/__pycache__' | |
adding license file 'LICENSE' | |
writing manifest file 'pynndescent.egg-info/SOURCES.txt' | |
* Building wheel... | |
/nix/store/1jzascxfclrgksjdj84bf99c2m56jzk2-python3.13-setuptools-80.7.1/lib/python3.13/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'test_suite' | |
warnings.warn(msg) | |
/nix/store/1jzascxfclrgksjdj84bf99c2m56jzk2-python3.13-setuptools-80.7.1/lib/python3.13/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'tests_require' | |
warnings.warn(msg) | |
/nix/store/1jzascxfclrgksjdj84bf99c2m56jzk2-python3.13-setuptools-80.7.1/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. | |
!! | |
******************************************************************************** | |
Please consider removing the following classifiers in favor of a SPDX license expression: | |
License :: OSI Approved | |
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. | |
******************************************************************************** | |
!! | |
self._finalize_license_expression() | |
running bdist_wheel | |
running build | |
running build_py | |
creating build/lib/pynndescent | |
copying pynndescent/sparse.py -> build/lib/pynndescent | |
copying pynndescent/rp_trees.py -> build/lib/pynndescent | |
copying pynndescent/distances.py -> build/lib/pynndescent | |
copying pynndescent/__init__.py -> build/lib/pynndescent | |
copying pynndescent/pynndescent_.py -> build/lib/pynndescent | |
copying pynndescent/optimal_transport.py -> build/lib/pynndescent | |
copying pynndescent/graph_utils.py -> build/lib/pynndescent | |
copying pynndescent/sparse_nndescent.py -> build/lib/pynndescent | |
copying pynndescent/threaded_rp_trees.py -> build/lib/pynndescent | |
copying pynndescent/utils.py -> build/lib/pynndescent | |
installing to build/bdist.linux-x86_64/wheel | |
running install | |
running install_lib | |
creating build/bdist.linux-x86_64/wheel | |
creating build/bdist.linux-x86_64/wheel/pynndescent | |
copying build/lib/pynndescent/rp_trees.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/distances.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/sparse.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/sparse_nndescent.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/graph_utils.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/optimal_transport.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/threaded_rp_trees.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/__init__.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/pynndescent_.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
copying build/lib/pynndescent/utils.py -> build/bdist.linux-x86_64/wheel/./pynndescent | |
running install_egg_info | |
running egg_info | |
writing pynndescent.egg-info/PKG-INFO | |
writing dependency_links to pynndescent.egg-info/dependency_links.txt | |
writing requirements to pynndescent.egg-info/requires.txt | |
writing top-level names to pynndescent.egg-info/top_level.txt | |
reading manifest file 'pynndescent.egg-info/SOURCES.txt' | |
reading manifest template 'MANIFEST.in' | |
no previously-included directories found matching 'pynndescent/__pycache__' | |
adding license file 'LICENSE' | |
writing manifest file 'pynndescent.egg-info/SOURCES.txt' | |
Copying pynndescent.egg-info to build/bdist.linux-x86_64/wheel/./pynndescent-0.5.13-py3.13.egg-info | |
running install_scripts | |
creating build/bdist.linux-x86_64/wheel/pynndescent-0.5.13.dist-info/WHEEL | |
creating '/build/source/dist/.tmp-kh87ppn1/pynndescent-0.5.13-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it | |
adding 'pynndescent/__init__.py' | |
adding 'pynndescent/distances.py' | |
adding 'pynndescent/graph_utils.py' | |
adding 'pynndescent/optimal_transport.py' | |
adding 'pynndescent/pynndescent_.py' | |
adding 'pynndescent/rp_trees.py' | |
adding 'pynndescent/sparse.py' | |
adding 'pynndescent/sparse_nndescent.py' | |
adding 'pynndescent/threaded_rp_trees.py' | |
adding 'pynndescent/utils.py' | |
adding 'pynndescent-0.5.13.dist-info/licenses/LICENSE' | |
adding 'pynndescent-0.5.13.dist-info/METADATA' | |
adding 'pynndescent-0.5.13.dist-info/WHEEL' | |
adding 'pynndescent-0.5.13.dist-info/top_level.txt' | |
adding 'pynndescent-0.5.13.dist-info/RECORD' | |
removing build/bdist.linux-x86_64/wheel | |
Successfully built pynndescent-0.5.13-py3-none-any.whl | |
Finished creating a wheel... | |
Finished executing pypaBuildPhase | |
Running phase: pythonRuntimeDepsCheckHook | |
Executing pythonRuntimeDepsCheck | |
Checking runtime dependencies for pynndescent-0.5.13-py3-none-any.whl | |
Finished executing pythonRuntimeDepsCheck | |
Running phase: installPhase | |
Executing pypaInstallPhase | |
Successfully installed pynndescent-0.5.13-py3-none-any.whl | |
Finished executing pypaInstallPhase | |
Running phase: pythonOutputDistPhase | |
Executing pythonOutputDistPhase | |
Finished executing pythonOutputDistPhase | |
Running phase: fixupPhase | |
shrinking RPATHs of ELF executables and libraries in /nix/store/rivihqd1f4911518rj0pqf0x9dfw9h3v-python3.13-pynndescent-0.5.13 | |
checking for references to /build/ in /nix/store/rivihqd1f4911518rj0pqf0x9dfw9h3v-python3.13-pynndescent-0.5.13... | |
patching script interpreter paths in /nix/store/rivihqd1f4911518rj0pqf0x9dfw9h3v-python3.13-pynndescent-0.5.13 | |
stripping (with command strip and flags -S -p) in /nix/store/rivihqd1f4911518rj0pqf0x9dfw9h3v-python3.13-pynndescent-0.5.13/lib | |
shrinking RPATHs of ELF executables and libraries in /nix/store/1km6gqvrb1iqk5pvx3h9al8fh9j1h3qp-python3.13-pynndescent-0.5.13-dist | |
checking for references to /build/ in /nix/store/1km6gqvrb1iqk5pvx3h9al8fh9j1h3qp-python3.13-pynndescent-0.5.13-dist... | |
patching script interpreter paths in /nix/store/1km6gqvrb1iqk5pvx3h9al8fh9j1h3qp-python3.13-pynndescent-0.5.13-dist | |
Executing pythonRemoveTestsDir | |
Finished executing pythonRemoveTestsDir | |
Running phase: installCheckPhase | |
no Makefile or custom installCheckPhase, doing nothing | |
Running phase: pythonCatchConflictsPhase | |
Running phase: pythonRemoveBinBytecodePhase | |
Running phase: pythonImportsCheckPhase | |
Executing pythonImportsCheckPhase | |
Check whether the following modules can be imported: pynndescent | |
Running phase: pytestCheckPhase | |
Executing pytestCheckPhase | |
pytest flags: -m pytest | |
============================= test session starts ============================== | |
platform linux -- Python 3.13.4, pytest-8.3.5, pluggy-1.6.0 | |
rootdir: /build/source | |
collected 147 items | |
pynndescent/tests/test_distances.py ..................................s. [ 24%] | |
........... [ 31%] | |
pynndescent/tests/test_pynndescent_.py FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 54%] | |
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 74%] | |
pynndescent/tests/test_rank.py ..................................... [100%] | |
=================================== FAILURES =================================== | |
______________________ test_nn_descent_neighbor_accuracy _______________________ | |
nn_data = array([[0.14105441, 0.88850555, 0.62257485, 0.36834125, 0.18491072], | |
[0.50009596, 0.36925626, 0.96432206, 0.802..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
seed = 189212 | |
def test_nn_descent_neighbor_accuracy(nn_data, seed): | |
> knn_indices, _ = NNDescent( | |
nn_data, "euclidean", {}, 10, random_state=np.random.RandomState(seed) | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:19: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_angular_nn_descent_neighbor_accuracy ___________________ | |
nn_data = array([[0.74328432, 0.02055253, 0.4223818 , 0.68373549, 0.81034626], | |
[0.46659191, 0.14267628, 0.18503059, 0.604..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
seed = 189212 | |
def test_angular_nn_descent_neighbor_accuracy(nn_data, seed): | |
> knn_indices, _ = NNDescent( | |
nn_data, "cosine", {}, 10, random_state=np.random.RandomState(seed) | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:37: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________ test_bitpacked_nn_descent_neighbor_accuracy __________________ | |
nn_data = array([[0.9969731 , 0.56170564, 0.84570654, 0.87879746, 0.71283472], | |
[0.1854705 , 0.49150947, 0.85743385, 0.810..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
seed = 189212 | |
def test_bitpacked_nn_descent_neighbor_accuracy(nn_data, seed): | |
bitpacked_data = (nn_data * 256).astype(np.uint8) | |
unpacked_data = np.zeros( | |
(bitpacked_data.shape[0], bitpacked_data.shape[1] * 8), dtype=np.float32 | |
) | |
for i in range(unpacked_data.shape[0]): | |
for j in range(unpacked_data.shape[1]): | |
unpacked_data[i, j] = (bitpacked_data[i, j // 8] & (1 << (j % 8))) > 0 | |
> knn_indices, _ = NNDescent( | |
bitpacked_data, "bit_jaccard", {}, 10, random_state=np.random.RandomState(seed) | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:64: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_sparse_nn_descent_neighbor_accuracy ___________________ | |
sparse_nn_data = <Compressed Sparse Row sparse matrix of dtype 'float64' | |
with 25000 stored elements and shape (1000, 50)> | |
seed = 189212 | |
@pytest.mark.skipif( | |
list(map(int, re.findall(r"[0-9]+\.[0-9]+\.?[0-9]*", scipy.version.version)[0].split("."))) < [1, 3, 0], | |
reason="requires scipy >= 1.3.0", | |
) | |
def test_sparse_nn_descent_neighbor_accuracy(sparse_nn_data, seed): | |
> knn_indices, _ = NNDescent( | |
sparse_nn_data, "euclidean", n_neighbors=20, random_state=None | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:86: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:880: in __init__ | |
self._neighbor_graph = sparse_nnd.nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt...t_rp_tree(inds, indptr, data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/sparse_nndescent.py (30) | |
E | |
E File "pynndescent/sparse_nndescent.py", line 30: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, inds, indptr, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd638eaac0>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (70) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd638eaac0>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (70) | |
E | |
E | |
E File "pynndescent/sparse_nndescent.py", line 70: | |
E def init_rp_tree(inds, indptr, data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates( | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd638e9580>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (309) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd638e9580>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (309) | |
E | |
E | |
E File "pynndescent/sparse_nndescent.py", line 309: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(inds, indptr, data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______________ test_sparse_angular_nn_descent_neighbor_accuracy _______________ | |
sparse_nn_data = <Compressed Sparse Row sparse matrix of dtype 'float64' | |
with 25000 stored elements and shape (1000, 50)> | |
@pytest.mark.skipif( | |
list(map(int, scipy.version.version.split("."))) < [1, 3, 0], | |
reason="requires scipy >= 1.3.0", | |
) | |
def test_sparse_angular_nn_descent_neighbor_accuracy(sparse_nn_data): | |
> knn_indices, _ = NNDescent( | |
sparse_nn_data, "cosine", {}, 20, random_state=None | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:108: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:880: in __init__ | |
self._neighbor_graph = sparse_nnd.nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt...t_rp_tree(inds, indptr, data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/sparse_nndescent.py (30) | |
E | |
E File "pynndescent/sparse_nndescent.py", line 30: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, inds, indptr, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd638eaac0>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (70) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd638eaac0>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (70) | |
E | |
E | |
E File "pynndescent/sparse_nndescent.py", line 70: | |
E def init_rp_tree(inds, indptr, data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates( | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd638e9580>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (309) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd638e9580>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (309) | |
E | |
E | |
E File "pynndescent/sparse_nndescent.py", line 309: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(inds, indptr, data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
________________________ test_nn_descent_query_accuracy ________________________ | |
nn_data = array([[0.04065836, 0.80076041, 0.14486028, 0.89776798, 0.63666438], | |
[0.07781016, 0.26391195, 0.89927382, 0.315..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
def test_nn_descent_query_accuracy(nn_data): | |
> nnd = NNDescent(nn_data[200:], "euclidean", n_neighbors=10, random_state=None) | |
pynndescent/tests/test_pynndescent_.py:127: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
____________________ test_nn_descent_query_accuracy_angular ____________________ | |
nn_data = array([[0.25032999, 0.41382174, 0.54719399, 0.68889993, 0.15708314], | |
[0.36460727, 0.88103113, 0.68768044, 0.808..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
def test_nn_descent_query_accuracy_angular(nn_data): | |
> nnd = NNDescent(nn_data[200:], "cosine", n_neighbors=30, random_state=None) | |
pynndescent/tests/test_pynndescent_.py:144: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
____________________ test_sparse_nn_descent_query_accuracy _____________________ | |
sparse_nn_data = <Compressed Sparse Row sparse matrix of dtype 'float64' | |
with 25000 stored elements and shape (1000, 50)> | |
def test_sparse_nn_descent_query_accuracy(sparse_nn_data): | |
> nnd = NNDescent( | |
sparse_nn_data[200:], "euclidean", n_neighbors=15, random_state=None | |
) | |
pynndescent/tests/test_pynndescent_.py:161: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:880: in __init__ | |
self._neighbor_graph = sparse_nnd.nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt...t_rp_tree(inds, indptr, data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/sparse_nndescent.py (30) | |
E | |
E File "pynndescent/sparse_nndescent.py", line 30: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, inds, indptr, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd638eaac0>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (70) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd638eaac0>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (70) | |
E | |
E | |
E File "pynndescent/sparse_nndescent.py", line 70: | |
E def init_rp_tree(inds, indptr, data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates( | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd638e9580>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (309) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd638e9580>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (309) | |
E | |
E | |
E File "pynndescent/sparse_nndescent.py", line 309: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(inds, indptr, data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
________________ test_sparse_nn_descent_query_accuracy_angular _________________ | |
sparse_nn_data = <Compressed Sparse Row sparse matrix of dtype 'float64' | |
with 25000 stored elements and shape (1000, 50)> | |
def test_sparse_nn_descent_query_accuracy_angular(sparse_nn_data): | |
> nnd = NNDescent(sparse_nn_data[200:], "cosine", n_neighbors=50, random_state=None) | |
pynndescent/tests/test_pynndescent_.py:180: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:880: in __init__ | |
self._neighbor_graph = sparse_nnd.nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt...t_rp_tree(inds, indptr, data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/sparse_nndescent.py (30) | |
E | |
E File "pynndescent/sparse_nndescent.py", line 30: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, inds, indptr, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd638eaac0>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (70) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd638eaac0>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (70) | |
E | |
E | |
E File "pynndescent/sparse_nndescent.py", line 70: | |
E def init_rp_tree(inds, indptr, data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates( | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd638e9580>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (309) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd638e9580>)) | |
E During: typing of call at /build/source/pynndescent/sparse_nndescent.py (309) | |
E | |
E | |
E File "pynndescent/sparse_nndescent.py", line 309: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(inds, indptr, data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_bitpacked_nn_descent_query_accuracy ___________________ | |
nn_data = array([[0.26170143, 0.00665105, 0.56532535, 0.2073348 , 0.47678617], | |
[0.6002073 , 0.65713315, 0.46971425, 0.078..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
def test_bitpacked_nn_descent_query_accuracy(nn_data): | |
bitpacked_data = (nn_data * 256).astype(np.uint8) | |
unpacked_data = np.zeros( | |
(bitpacked_data.shape[0], bitpacked_data.shape[1] * 8), dtype=np.float32 | |
) | |
for i in range(unpacked_data.shape[0]): | |
for j in range(unpacked_data.shape[1]): | |
unpacked_data[i, j] = (bitpacked_data[i, j // 8] & (1 << (j % 8))) > 0 | |
> nnd = NNDescent( | |
bitpacked_data[200:], "bit_jaccard", n_neighbors=50, random_state=None | |
) | |
pynndescent/tests/test_pynndescent_.py:207: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________________ test_transformer_equivalence _________________________ | |
nn_data = array([[0.17799423, 0.43356237, 0.64162502, 0.7577647 , 0.55680721], | |
[0.30401282, 0.43916809, 0.18188389, 0.518..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
def test_transformer_equivalence(nn_data): | |
N_NEIGHBORS = 15 | |
EPSILON = 0.15 | |
train = nn_data[:400] | |
test = nn_data[:200] | |
# Note we shift N_NEIGHBORS to conform to sklearn's KNeighborTransformer defn | |
> nnd = NNDescent( | |
data=train, n_neighbors=N_NEIGHBORS + 1, random_state=42, compressed=False | |
) | |
pynndescent/tests/test_pynndescent_.py:234: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
____________________________ test_random_state_none ____________________________ | |
nn_data = array([[0.83028813, 0.12672347, 0.19459421, 0.17358944, 0.49364438], | |
[0.05320161, 0.79341235, 0.26112313, 0.151..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
spatial_data = array([[-3.0056171 , 0.61763996, 0.29443747, -0.19585614, 0.77869105, | |
0.8641467 , 0.48352352, -0.25806785.... , 0. , | |
0. , 0. , 0. , 0. , 0. ]], | |
dtype=float32) | |
def test_random_state_none(nn_data, spatial_data): | |
> knn_indices, _ = NNDescent( | |
nn_data, "euclidean", {}, 10, random_state=None | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:255: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
______________________________ test_deterministic ______________________________ | |
def test_deterministic(): | |
seed = np.random.RandomState(42) | |
x1 = seed.normal(0, 100, (1000, 50)) | |
x2 = seed.normal(0, 100, (1000, 50)) | |
> index1 = NNDescent(x1, random_state=np.random.RandomState(42)) | |
pynndescent/tests/test_pynndescent_.py:278: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________ test_rp_trees_should_not_stack_overflow_with_duplicate_data __________ | |
seed = 189212 | |
cosine_hang_data = array([[-0.34907595, -0.1496765 , -2.58207274, ..., 2.25055422, | |
-0.79883356, 0.79232488], | |
[-0.1891104... | |
[-0.95391804, -2.52210669, -3.74721598, ..., 4.46856483, | |
-1.63162477, 1.53352323]], shape=(4400, 50)) | |
def test_rp_trees_should_not_stack_overflow_with_duplicate_data(seed, cosine_hang_data): | |
n_neighbors = 10 | |
> knn_indices, _ = NNDescent( | |
cosine_hang_data, | |
"cosine", | |
{}, | |
n_neighbors, | |
random_state=np.random.RandomState(seed), | |
n_trees=20, | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:295: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_deduplicated_data_behaves_normally ____________________ | |
seed = 189212 | |
cosine_hang_data = array([[-0.34907595, -0.1496765 , -2.58207274, ..., 2.25055422, | |
-0.79883356, 0.79232488], | |
[-0.1891104... | |
[-0.95391804, -2.52210669, -3.74721598, ..., 4.46856483, | |
-1.63162477, 1.53352323]], shape=(4400, 50)) | |
def test_deduplicated_data_behaves_normally(seed, cosine_hang_data): | |
data = np.unique(cosine_hang_data, axis=0) | |
data = data[~np.all(data == 0, axis=1)] | |
data = data[:1000] | |
n_neighbors = 10 | |
> knn_indices, _ = NNDescent( | |
data, | |
"cosine", | |
{}, | |
n_neighbors, | |
random_state=np.random.RandomState(seed), | |
n_trees=20, | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:317: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______ test_rp_trees_should_not_stack_overflow_with_near_duplicate_data _______ | |
seed = 189212 | |
cosine_near_duplicates_data = array([[100.01764 , 100. ], | |
[100.01883 , 100. ], | |
[100.021 , 100. ], | |
[100.02009 ,... ], | |
[100.01559 , 100. ], | |
[100.01755 , 100. ], | |
[100.016914, 100. ]], dtype=float32) | |
def test_rp_trees_should_not_stack_overflow_with_near_duplicate_data( | |
seed, cosine_near_duplicates_data | |
): | |
n_neighbors = 10 | |
> knn_indices, _ = NNDescent( | |
cosine_near_duplicates_data, | |
"cosine", | |
{}, | |
n_neighbors, | |
random_state=np.random.RandomState(seed), | |
n_trees=20, | |
)._neighbor_graph | |
pynndescent/tests/test_pynndescent_.py:350: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______________________ test_output_when_verbose_is_true _______________________ | |
spatial_data = array([[ 3.45440120e-01, 1.24932146e+00, 4.75778401e-01, | |
-4.87599336e-02, -7.72169471e-01, -8.22534859e-01, | |
..., | |
0.00000000e+00, 0.00000000e+00, 0.00000000e+00, | |
0.00000000e+00, 0.00000000e+00]], dtype=float32) | |
seed = 189212 | |
def test_output_when_verbose_is_true(spatial_data, seed): | |
out = io.StringIO() | |
with redirect_stdout(out): | |
> _ = NNDescent( | |
data=spatial_data, | |
metric="euclidean", | |
metric_kwds={}, | |
n_neighbors=4, | |
random_state=np.random.RandomState(seed), | |
n_trees=5, | |
n_iters=2, | |
verbose=True, | |
) | |
pynndescent/tests/test_pynndescent_.py:368: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_____________________ test_no_output_when_verbose_is_false _____________________ | |
spatial_data = array([[-1.3018036 , -0.03458112, -0.9106182 , -0.21785875, 0.26034927, | |
-1.1669229 , 0.71742254, 1.0694066 .... , 0. , | |
0. , 0. , 0. , 0. , 0. ]], | |
dtype=float32) | |
seed = 189212 | |
def test_no_output_when_verbose_is_false(spatial_data, seed): | |
out = io.StringIO() | |
with redirect_stdout(out): | |
> _ = NNDescent( | |
data=spatial_data, | |
metric="euclidean", | |
metric_kwds={}, | |
n_neighbors=4, | |
random_state=np.random.RandomState(seed), | |
n_trees=5, | |
n_iters=2, | |
verbose=False, | |
) | |
pynndescent/tests/test_pynndescent_.py:386: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________ test_transformer_output_when_verbose_is_true _________________ | |
spatial_data = array([[ 0.44695002, 1.56058 , 1.0129353 , -0.66778165, 0.97107184, | |
-1.0476568 , 1.750758 , -1.0871501 .... , 0. , | |
0. , 0. , 0. , 0. , 0. ]], | |
dtype=float32) | |
seed = 189212 | |
def test_transformer_output_when_verbose_is_true(spatial_data, seed): | |
out = io.StringIO() | |
with redirect_stdout(out): | |
_ = PyNNDescentTransformer( | |
n_neighbors=4, | |
metric="euclidean", | |
metric_kwds={}, | |
random_state=np.random.RandomState(seed), | |
n_trees=5, | |
n_iters=2, | |
verbose=True, | |
> ).fit_transform(spatial_data) | |
pynndescent/tests/test_pynndescent_.py:413: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/nix/store/lcwr3sxp90dx13zfv3nkb1blc83xchhh-python3.13-scikit-learn-1.6.1/lib/python3.13/site-packages/sklearn/utils/_set_output.py:319: in wrapped | |
data_to_wrap = f(self, X, *args, **kwargs) | |
pynndescent/pynndescent_.py:2256: in fit_transform | |
self.fit(X, compress_index=False) | |
pynndescent/pynndescent_.py:2174: in fit | |
self.index_ = NNDescent( | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
________________ test_transformer_output_when_verbose_is_false _________________ | |
spatial_data = array([[ 1.3213372 , 0.79957026, -0.30695146, -1.1013254 , -1.7207671 , | |
0.19366603, 0.14521146, 0.31293032.... , 0. , | |
0. , 0. , 0. , 0. , 0. ]], | |
dtype=float32) | |
seed = 189212 | |
def test_transformer_output_when_verbose_is_false(spatial_data, seed): | |
out = io.StringIO() | |
with redirect_stdout(out): | |
_ = PyNNDescentTransformer( | |
n_neighbors=4, | |
metric="standardised_euclidean", | |
metric_kwds={"sigma": np.ones(spatial_data.shape[1])}, | |
random_state=np.random.RandomState(seed), | |
n_trees=5, | |
n_iters=2, | |
verbose=False, | |
> ).fit_transform(spatial_data) | |
pynndescent/tests/test_pynndescent_.py:430: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
/nix/store/lcwr3sxp90dx13zfv3nkb1blc83xchhh-python3.13-scikit-learn-1.6.1/lib/python3.13/site-packages/sklearn/utils/_set_output.py:319: in wrapped | |
data_to_wrap = f(self, X, *args, **kwargs) | |
pynndescent/pynndescent_.py:2256: in fit_transform | |
self.fit(X, compress_index=False) | |
pynndescent/pynndescent_.py:2174: in fit | |
self.index_ = NNDescent( | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_____________________________ test_pickle_unpickle _____________________________ | |
def test_pickle_unpickle(): | |
seed = np.random.RandomState(42) | |
x1 = seed.normal(0, 100, (1000, 50)) | |
x2 = seed.normal(0, 100, (1000, 50)) | |
> index1 = NNDescent(x1, "euclidean", {}, 10, random_state=None) | |
pynndescent/tests/test_pynndescent_.py:441: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______________________ test_compressed_pickle_unpickle ________________________ | |
def test_compressed_pickle_unpickle(): | |
seed = np.random.RandomState(42) | |
x1 = seed.normal(0, 100, (1000, 50)) | |
x2 = seed.normal(0, 100, (1000, 50)) | |
> index1 = NNDescent(x1, "euclidean", {}, 10, random_state=None, compressed=True) | |
pynndescent/tests/test_pynndescent_.py:461: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______________________ test_transformer_pickle_unpickle _______________________ | |
def test_transformer_pickle_unpickle(): | |
seed = np.random.RandomState(42) | |
x1 = seed.normal(0, 100, (1000, 50)) | |
x2 = seed.normal(0, 100, (1000, 50)) | |
> index1 = PyNNDescentTransformer(n_neighbors=10).fit(x1) | |
pynndescent/tests/test_pynndescent_.py:481: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:2174: in fit | |
self.index_ = NNDescent( | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______________________________ test_joblib_dump _______________________________ | |
def test_joblib_dump(): | |
seed = np.random.RandomState(42) | |
x1 = seed.normal(0, 100, (1000, 50)) | |
x2 = seed.normal(0, 100, (1000, 50)) | |
> index1 = NNDescent(x1, "euclidean", {}, 10, random_state=None) | |
pynndescent/tests/test_pynndescent_.py:501: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______________ test_update_no_prepare_query_accuracy[euclidean] _______________ | |
nn_data = array([[0.08717562, 0.74886074, 0.08318417, 0.73080798, 0.95449368], | |
[0.7859424 , 0.64957612, 0.27099145, 0.690..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["euclidean", "cosine"]) | |
def test_update_no_prepare_query_accuracy(nn_data, metric): | |
> nnd = NNDescent(nn_data[200:800], metric=metric, n_neighbors=10, random_state=None) | |
pynndescent/tests/test_pynndescent_.py:517: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
________________ test_update_no_prepare_query_accuracy[cosine] _________________ | |
nn_data = array([[0.49515761, 0.45261352, 0.95840464, 0.97839214, 0.94819459], | |
[0.98493233, 0.49173882, 0.45890711, 0.768..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["euclidean", "cosine"]) | |
def test_update_no_prepare_query_accuracy(nn_data, metric): | |
> nnd = NNDescent(nn_data[200:800], metric=metric, n_neighbors=10, random_state=None) | |
pynndescent/tests/test_pynndescent_.py:517: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______________ test_update_w_prepare_query_accuracy[euclidean] ________________ | |
nn_data = array([[0.99754206, 0.62460812, 0.67259408, 0.49108137, 0.78531799], | |
[0.44461824, 0.8212686 , 0.84079163, 0.912..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["euclidean", "cosine"]) | |
def test_update_w_prepare_query_accuracy(nn_data, metric): | |
> nnd = NNDescent( | |
nn_data[200:800], | |
metric=metric, | |
n_neighbors=10, | |
random_state=None, | |
compressed=False, | |
) | |
pynndescent/tests/test_pynndescent_.py:566: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________ test_update_w_prepare_query_accuracy[cosine] _________________ | |
nn_data = array([[0.30257459, 0.91502373, 0.13810664, 0.32069906, 0.16646868], | |
[0.69825849, 0.34750073, 0.73767088, 0.566..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["euclidean", "cosine"]) | |
def test_update_w_prepare_query_accuracy(nn_data, metric): | |
> nnd = NNDescent( | |
nn_data[200:800], | |
metric=metric, | |
n_neighbors=10, | |
random_state=None, | |
compressed=False, | |
) | |
pynndescent/tests/test_pynndescent_.py:566: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[0-manhattan] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 0, metric = 'manhattan' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[0-euclidean] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 0, metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_update_with_changed_data[0-cosine] ____________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 0, metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[1-manhattan] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 1, metric = 'manhattan' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[1-euclidean] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 1, metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_update_with_changed_data[1-cosine] ____________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 1, metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[2-manhattan] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 2, metric = 'manhattan' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[2-euclidean] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 2, metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_update_with_changed_data[2-cosine] ____________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 2, metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[3-manhattan] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 3, metric = 'manhattan' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[3-euclidean] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 3, metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_update_with_changed_data[3-cosine] ____________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 3, metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[4-manhattan] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 4, metric = 'manhattan' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[4-euclidean] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 4, metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_update_with_changed_data[4-cosine] ____________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 4, metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[5-manhattan] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 5, metric = 'manhattan' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[5-euclidean] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 5, metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_update_with_changed_data[5-cosine] ____________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 5, metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[6-manhattan] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 6, metric = 'manhattan' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[6-euclidean] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 6, metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_update_with_changed_data[6-cosine] ____________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 6, metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[7-manhattan] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 7, metric = 'manhattan' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________ test_update_with_changed_data[7-euclidean] __________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 7, metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
___________________ test_update_with_changed_data[7-cosine] ____________________ | |
update_data = [(array([[0.92961609, 0.31637555, 0.18391881, 0.20456028, 0.56772503], | |
[0.5955447 , 0.96451452, 0.6531771 , 0.7... [0.8750829 , 0.69547793, 0.18209623, 0.22261694, 0.46702918]], | |
shape=(1000, 5)), [0, 1, 2, 3, 4, 5, ...]), ...] | |
case = 7, metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["manhattan", "euclidean", "cosine"]) | |
@pytest.mark.parametrize("case", list(range(8))) # the number of cases in update_data | |
def test_update_with_changed_data(update_data, case, metric): | |
def evaluate(nn_descent, xs_to_fit, xs_to_query): | |
true_nn = NearestNeighbors(metric=metric, n_neighbors=k).fit(xs_to_fit) | |
neighbors, _ = nn_descent.query(xs_to_query, k=k) | |
neighbors_expected = true_nn.kneighbors(xs_to_query, k, return_distance=False) | |
p_correct = evaluate_predictions(neighbors_expected, neighbors, k) | |
assert p_correct >= 0.95, ( | |
"NN-descent query did not get 95% " "accuracy on nearest neighbors" | |
) | |
k = 10 | |
xs_orig, xs_fresh, xs_updated, indices_updated = update_data[case] | |
queries1 = xs_orig | |
# original | |
> index = NNDescent(xs_orig, metric=metric, n_neighbors=40, random_state=1234) | |
pynndescent/tests/test_pynndescent_.py:618: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________ test_tree_numbers_after_multiple_updates[1] __________________ | |
n_trees = 1 | |
@pytest.mark.parametrize("n_trees", [1, 2, 3, 10]) | |
def test_tree_numbers_after_multiple_updates(n_trees): | |
trees_after_update = max(1, int(np.round(n_trees / 3))) | |
> nnd = NNDescent(np.array([[1.0]]), n_neighbors=1, n_trees=n_trees) | |
pynndescent/tests/test_pynndescent_.py:642: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________ test_tree_numbers_after_multiple_updates[2] __________________ | |
n_trees = 2 | |
@pytest.mark.parametrize("n_trees", [1, 2, 3, 10]) | |
def test_tree_numbers_after_multiple_updates(n_trees): | |
trees_after_update = max(1, int(np.round(n_trees / 3))) | |
> nnd = NNDescent(np.array([[1.0]]), n_neighbors=1, n_trees=n_trees) | |
pynndescent/tests/test_pynndescent_.py:642: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________ test_tree_numbers_after_multiple_updates[3] __________________ | |
n_trees = 3 | |
@pytest.mark.parametrize("n_trees", [1, 2, 3, 10]) | |
def test_tree_numbers_after_multiple_updates(n_trees): | |
trees_after_update = max(1, int(np.round(n_trees / 3))) | |
> nnd = NNDescent(np.array([[1.0]]), n_neighbors=1, n_trees=n_trees) | |
pynndescent/tests/test_pynndescent_.py:642: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________ test_tree_numbers_after_multiple_updates[10] _________________ | |
n_trees = 10 | |
@pytest.mark.parametrize("n_trees", [1, 2, 3, 10]) | |
def test_tree_numbers_after_multiple_updates(n_trees): | |
trees_after_update = max(1, int(np.round(n_trees / 3))) | |
> nnd = NNDescent(np.array([[1.0]]), n_neighbors=1, n_trees=n_trees) | |
pynndescent/tests/test_pynndescent_.py:642: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_______________________ test_tree_init_false[euclidean] ________________________ | |
nn_data = array([[0.82459894, 0.08604764, 0.01016379, 0.12074439, 0.3263681 ], | |
[0.03172984, 0.55723523, 0.60819482, 0.024..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["euclidean", "cosine"]) | |
def test_tree_init_false(nn_data, metric): | |
> nnd = NNDescent( | |
nn_data[200:], metric=metric, n_neighbors=10, random_state=None, tree_init=False | |
) | |
pynndescent/tests/test_pynndescent_.py:660: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_________________________ test_tree_init_false[cosine] _________________________ | |
nn_data = array([[0.98695644, 0.33425315, 0.77929177, 0.93092914, 0.52440043], | |
[0.23512488, 0.1553602 , 0.95939288, 0.401..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["euclidean", "cosine"]) | |
def test_tree_init_false(nn_data, metric): | |
> nnd = NNDescent( | |
nn_data[200:], metric=metric, n_neighbors=10, random_state=None, tree_init=False | |
) | |
pynndescent/tests/test_pynndescent_.py:660: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_____________________ test_one_dimensional_data[euclidean] _____________________ | |
nn_data = array([[0.73128115, 0.62501349, 0.45505512, 0.98201867, 0.14978135], | |
[0.45024925, 0.13874492, 0.70487097, 0.605..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
metric = 'euclidean' | |
@pytest.mark.parametrize( | |
"metric", ["euclidean", "manhattan"] | |
) # cosine makes no sense for 1D | |
def test_one_dimensional_data(nn_data, metric): | |
> nnd = NNDescent( | |
nn_data[200:, :1], | |
metric=metric, | |
n_neighbors=20, | |
random_state=None, | |
tree_init=False, | |
) | |
pynndescent/tests/test_pynndescent_.py:684: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
_____________________ test_one_dimensional_data[manhattan] _____________________ | |
nn_data = array([[0.17196229, 0.82598028, 0.69904943, 0.37439974, 0.60900657], | |
[0.93550793, 0.41063286, 0.39154143, 0.107..., 0. , 0. ], | |
[0. , 0. , 0. , 0. , 0. ]], | |
shape=(1002, 5)) | |
metric = 'manhattan' | |
@pytest.mark.parametrize( | |
"metric", ["euclidean", "manhattan"] | |
) # cosine makes no sense for 1D | |
def test_one_dimensional_data(nn_data, metric): | |
> nnd = NNDescent( | |
nn_data[200:, :1], | |
metric=metric, | |
n_neighbors=20, | |
random_state=None, | |
tree_init=False, | |
) | |
pynndescent/tests/test_pynndescent_.py:684: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
________________________ test_tree_no_split[euclidean] _________________________ | |
small_data = array([[28.13039979, 16.57979176, 31.80550748, 32.01977256, 27.61190147], | |
[14.91434806, 12.68102166, 8.8696147...852, 30.98468932, 10.65281454, 31.98563219], | |
[14.44627291, 28.72245822, 36.54024792, 23.29684076, 7.85484759]]) | |
sparse_small_data = <Compressed Sparse Row sparse matrix of dtype 'float64' | |
with 640 stored elements and shape (40, 32)> | |
metric = 'euclidean' | |
@pytest.mark.parametrize("metric", ["euclidean", "cosine"]) | |
def test_tree_no_split(small_data, sparse_small_data, metric): | |
k = 10 | |
for data, data_type in zip([small_data, sparse_small_data], ["dense", "sparse"]): | |
n_instances = data.shape[0] | |
leaf_size = n_instances + 1 # just to be safe | |
data_train = data[n_instances // 2 :] | |
data_test = data[: n_instances // 2] | |
> nnd = NNDescent( | |
data_train, | |
metric=metric, | |
n_neighbors=data_train.shape[0] - 1, | |
random_state=None, | |
tree_init=True, | |
leaf_size=leaf_size, | |
) | |
pynndescent/tests/test_pynndescent_.py:717: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
__________________________ test_tree_no_split[cosine] __________________________ | |
small_data = array([[37.30915758, 33.49158636, 11.22876664, 18.47620384, 5.80685874], | |
[30.6148086 , 13.57136031, 31.4033750...725, 8.98868987, 32.77889697, 11.49747471], | |
[17.52130225, 29.43756355, 9.40601524, 28.27027073, 5.36939169]]) | |
sparse_small_data = <Compressed Sparse Row sparse matrix of dtype 'float64' | |
with 640 stored elements and shape (40, 32)> | |
metric = 'cosine' | |
@pytest.mark.parametrize("metric", ["euclidean", "cosine"]) | |
def test_tree_no_split(small_data, sparse_small_data, metric): | |
k = 10 | |
for data, data_type in zip([small_data, sparse_small_data], ["dense", "sparse"]): | |
n_instances = data.shape[0] | |
leaf_size = n_instances + 1 # just to be safe | |
data_train = data[n_instances // 2 :] | |
data_test = data[: n_instances // 2] | |
> nnd = NNDescent( | |
data_train, | |
metric=metric, | |
n_neighbors=data_train.shape[0] - 1, | |
random_state=None, | |
tree_init=True, | |
leaf_size=leaf_size, | |
) | |
pynndescent/tests/test_pynndescent_.py:717: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
________________________________ test_bad_data _________________________________ | |
@pytest.mark.skipif( | |
"NUMBA_DISABLE_JIT" in os.environ, reason="Too expensive for disabled Numba" | |
) | |
def test_bad_data(): | |
data = np.sqrt( | |
np.load("pynndescent/tests/test_data/pynndescent_bug_np.npz")["arr_0"] | |
) | |
> index = NNDescent(data, metric="cosine") | |
pynndescent/tests/test_pynndescent_.py:750: | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
pynndescent/pynndescent_.py:923: in __init__ | |
self._neighbor_graph = nn_descent( | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:424: in _compile_for_args | |
error_rewrite(e, 'typing') | |
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | |
e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nFailed in nopython mode pipeline (step: nopyt... init_rp_tree(data, dist, current_graph, leaf_array)\n ^\n\nDuring: Pass nopython_type_inference') | |
issue_type = 'typing' | |
def error_rewrite(e, issue_type): | |
""" | |
Rewrite and raise Exception `e` with help supplied based on the | |
specified issue_type. | |
""" | |
if config.SHOW_HELP: | |
help_msg = errors.error_extras[issue_type] | |
e.patch_message('\n'.join((str(e).rstrip(), help_msg))) | |
if config.FULL_TRACEBACKS: | |
raise e | |
else: | |
> raise e.with_traceback(None) | |
E numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Failed in nopython mode pipeline (step: nopython frontend) | |
E Invalid use of iternext with parameters (range_state_int64) | |
E | |
E During: typing of intrinsic-call at /build/source/pynndescent/pynndescent_.py (77) | |
E | |
E File "pynndescent/pynndescent_.py", line 77: | |
E def generate_leaf_updates(leaf_block, dist_thresholds, data, dist): | |
E <source elided> | |
E | |
E updates = [[(-1, -1, np.inf)] for i in range(leaf_block.shape[0])] | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function generate_leaf_updates at 0x7ffd6317a5c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (111) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 111: | |
E def init_rp_tree(data, dist, current_graph, leaf_array): | |
E <source elided> | |
E | |
E updates = generate_leaf_updates(leaf_block, dist_thresholds, data, dist) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x7ffd6317a0c0>)) | |
E During: typing of call at /build/source/pynndescent/pynndescent_.py (347) | |
E | |
E | |
E File "pynndescent/pynndescent_.py", line 347: | |
E def nn_descent( | |
E <source elided> | |
E if rp_tree_init: | |
E init_rp_tree(data, dist, current_graph, leaf_array) | |
E ^ | |
E | |
E During: Pass nopython_type_inference | |
/nix/store/qaq1png1jn59gxl742i4ck8jsmhdf2r6-python3.13-numba-0.61.2/lib/python3.13/site-packages/numba/core/dispatcher.py:365: TypingError | |
=============================== warnings summary =============================== | |
pynndescent/tests/test_distances.py::test_binary_check[sokalmichener] | |
pynndescent/tests/test_distances.py::test_sparse_binary_check[sokalmichener] | |
/nix/store/in6wyzdhhz9pbcbd5fmz6qmbgjiggfxa-python3.13-scipy-1.15.3/lib/python3.13/site-packages/scipy/spatial/distance.py:2322: DeprecationWarning: The sokalmichener metric is deprecated since SciPy 1.15.0 and will be removed in SciPy 1.17.0. Replace usage of 'sokalmichener(u, v)' with 'rogerstanimoto(u, v)'. | |
return pdist_fn(X, out=out, **kwargs) | |
pynndescent/tests/test_distances.py::test_bit_jaccard | |
/nix/store/lcwr3sxp90dx13zfv3nkb1blc83xchhh-python3.13-scikit-learn-1.6.1/lib/python3.13/site-packages/sklearn/metrics/pairwise.py:2466: DataConversionWarning: Data was converted to boolean for metric jaccard | |
warnings.warn(msg, DataConversionWarning) | |
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html | |
=========================== short test summary info ============================ | |
FAILED pynndescent/tests/test_pynndescent_.py::test_nn_descent_neighbor_accuracy - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_angular_nn_descent_neighbor_accuracy - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_bitpacked_nn_descent_neighbor_accuracy - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_sparse_nn_descent_neighbor_accuracy - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_sparse_angular_nn_descent_neighbor_accuracy - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_nn_descent_query_accuracy - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_nn_descent_query_accuracy_angular - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_sparse_nn_descent_query_accuracy - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_sparse_nn_descent_query_accuracy_angular - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_bitpacked_nn_descent_query_accuracy - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_transformer_equivalence - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_random_state_none - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_deterministic - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_rp_trees_should_not_stack_overflow_with_duplicate_data - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_deduplicated_data_behaves_normally - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_rp_trees_should_not_stack_overflow_with_near_duplicate_data - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_output_when_verbose_is_true - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_no_output_when_verbose_is_false - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_transformer_output_when_verbose_is_true - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_transformer_output_when_verbose_is_false - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_pickle_unpickle - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_compressed_pickle_unpickle - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_transformer_pickle_unpickle - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_joblib_dump - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_no_prepare_query_accuracy[euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_no_prepare_query_accuracy[cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_w_prepare_query_accuracy[euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_w_prepare_query_accuracy[cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[0-manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[0-euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[0-cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[1-manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[1-euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[1-cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[2-manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[2-euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[2-cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[3-manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[3-euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[3-cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[4-manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[4-euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[4-cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[5-manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[5-euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[5-cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[6-manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[6-euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[6-cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[7-manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[7-euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_update_with_changed_data[7-cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_tree_numbers_after_multiple_updates[1] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_tree_numbers_after_multiple_updates[2] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_tree_numbers_after_multiple_updates[3] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_tree_numbers_after_multiple_updates[10] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_tree_init_false[euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_tree_init_false[cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_one_dimensional_data[euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_one_dimensional_data[manhattan] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_tree_no_split[euclidean] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_tree_no_split[cosine] - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
FAILED pynndescent/tests/test_pynndescent_.py::test_bad_data - numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopy... | |
======= 63 failed, 83 passed, 1 skipped, 3 warnings in 73.10s (0:01:13) ======== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment