Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import pynndescent lazily to speed up import #1090

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Import pynndescent lazily to speed up import.

39d6a08
Select commit
Loading
Failed to load commit list.
Open

Import pynndescent lazily to speed up import #1090

Import pynndescent lazily to speed up import.
39d6a08
Select commit
Loading
Failed to load commit list.
Azure Pipelines / lmcinnes.umap failed Feb 1, 2024 in 39m 45s

Build #20240201.1 had test failures

Details

Tests

  • Failed: 129 (5.14%)
  • Passed: 1,727 (68.86%)
  • Other: 652 (26.00%)
  • Total: 2,508
Code coverage

  • 3134 of 5049 lines covered (62.07%)

Annotations

Check failure on line 294 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / lmcinnes.umap

Build log #L294

11 test(s) failed, 209 test(s) collected.

Check failure on line 1935 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / lmcinnes.umap

Build log #L1935

Bash exited with code '1'.

Check failure on line 296 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / lmcinnes.umap

Build log #L296

11 test(s) failed, 209 test(s) collected.

Check failure on line 1938 in Build log

See this annotation in the file changed.

@azure-pipelines azure-pipelines / lmcinnes.umap

Build log #L1938

Cmd.exe exited with code '1'.

Check failure on line 1 in umap/tests/test_plot.py::test_plot_runs_at_all

See this annotation in the file changed.

@azure-pipelines azure-pipelines / lmcinnes.umap

umap/tests/test_plot.py::test_plot_runs_at_all

mapper = UMAP(n_epochs=100, tqdm_kwds={'bar_format': '{desc}: {percentage:3.0f}%| {bar} {n_fmt}/{total_fmt} [{elapsed}]', 'desc': 'Epochs completed', 'disable': True})
iris = {'data': array([[5.1, 3.5, 1.4, 0.2],
       [4.9, 3. , 1.4, 0.2],
       [4.7, 3.2, 1.3, 0.2],
       [4.6, 3.1, 1.5,... width (cm)', 'petal length (cm)', 'petal width (cm)'], 'filename': 'iris.csv', 'data_module': 'sklearn.datasets.data'}
iris_selection = array([ True,  True,  True,  True, False,  True, False,  True,  True,
       False, False, False, False,  True,  True,...       False,  True,  True, False,  True,  True, False,  True,  True,
        True,  True,  True, False,  True,  True])

    @plot_only
    def test_plot_runs_at_all(mapper, iris, iris_selection):
        from umap import plot as umap_plot
    
        umap_plot.points(mapper)
        umap_plot.points(mapper, labels=iris.target)
        umap_plot.points(mapper, values=iris.data[:, 0])
        umap_plot.points(mapper, labels=iris.target, subset_points=iris_selection)
        umap_plot.points(mapper, values=iris.data[:, 0], subset_points=iris_selection)
        umap_plot.points(mapper, theme="fire")
>       umap_plot.diagnostic(mapper, diagnostic_type="all")

umap/tests/test_plot.py:37: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
umap/plot.py:1202: in diagnostic
    diagnostic(
umap/plot.py:1124: in diagnostic
    accuracy = _nhood_compare(
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/numba/core/dispatcher.py:468: in _compile_for_args
    error_rewrite(e, 'typing')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

e = TypingError('Failed in nopython mode pipeline (step: nopython frontend)\nNo implementation of function Function(<funct...(indices_left.shape[0]):\n        intersection_size = np.intersect1d(indices_left[i], indices_right[i], \n        ^\n')
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           No implementation of function Function(<function intersect1d at 0x7fc553f87a30>) found for signature:
E            
E            >>> intersect1d(array(int32, 1d, C), array(int32, 1d, C), assume_unique=Literal[bool](True))
E            
E           There are 2 candidate implementations:
E             - Of which 2 did not match due to:
E             Overload in function 'jit_np_intersect1d': File: numba/np/arraymath.py: Line 3586.
E               With argument(s): '(array(int32, 1d, C), array(int32, 1d, C), assume_unique=bool)':
E              Rejected as the implementation raised a specific error:
E                TypingError: got an unexpected keyword argument 'assume_unique'
E             raised from /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/numba/core/typing/templates.py:784
E           
E           During: resolving callee type: Function(<function intersect1d at 0x7fc553f87a30>)
E           During: typing of call at /home/vsts/work/1/s/umap/plot.py (209)
E           
E           
E           File "umap/plot.py", line 209:
E           def _nhood_compare(indices_left, indices_right):
E               <source elided>
E               for i in range(indices_left.shape[0]):
E                   intersection_size = np.intersect1d(indices_left[i], indices_right[i], 
E                   ^

/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/numba/core/dispatcher.py:409: TypingError
Raw output
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/numba/core/dispatcher.py:409: numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)

Check failure on line 1 in umap/tests/test_umap_ops.py::test_disconnected_data[True-jaccard-1]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / lmcinnes.umap

umap/tests/test_umap_ops.py::test_disconnected_data[True-jaccard-1]

num_isolates = 1, metric = 'jaccard', force_approximation = True

    @pytest.mark.parametrize("num_isolates", [1, 5])
    @pytest.mark.parametrize("metric", ["jaccard", "hellinger"])
    @pytest.mark.parametrize("force_approximation", [True, False])
    def test_disconnected_data(num_isolates, metric, force_approximation):
        options = [False, True]
        disconnected_data = np.random.choice(a=options, size=(10, 30), p=[0.6, 1 - 0.6])
        # Add some disconnected data for the corner case test
        disconnected_data = np.vstack(
            [disconnected_data, np.zeros((num_isolates, 30), dtype="bool")]
        )
        new_columns = np.zeros((num_isolates + 10, num_isolates), dtype="bool")
        for i in range(num_isolates):
            new_columns[10 + i, i] = True
        disconnected_data = np.hstack([disconnected_data, new_columns])
    
>       with pytest.warns(None) as w:

umap/tests/test_umap_ops.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = WarningsChecker(record=True), expected_warning = None, match_expr = None

    def __init__(
        self,
        expected_warning: Optional[
            Union[Type[Warning], Tuple[Type[Warning], ...]]
        ] = Warning,
        match_expr: Optional[Union[str, Pattern[str]]] = None,
        *,
        _ispytest: bool = False,
    ) -> None:
        check_ispytest(_ispytest)
        super().__init__(_ispytest=True)
    
        msg = "exceptions must be derived from Warning, not %s"
        if expected_warning is None:
>           warnings.warn(WARNS_NONE_ARG, stacklevel=4)
E           pytest.PytestRemovedIn8Warning: Passing None has been deprecated.
E           See https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests for alternatives in common use cases.

/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/recwarn.py:279: PytestRemovedIn8Warning
Raw output
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/recwarn.py:279: pytest.PytestRemovedIn8Warning: Passing None has been deprecated.

Check failure on line 1 in umap/tests/test_umap_ops.py::test_disconnected_data[True-jaccard-5]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / lmcinnes.umap

umap/tests/test_umap_ops.py::test_disconnected_data[True-jaccard-5]

num_isolates = 5, metric = 'jaccard', force_approximation = True

    @pytest.mark.parametrize("num_isolates", [1, 5])
    @pytest.mark.parametrize("metric", ["jaccard", "hellinger"])
    @pytest.mark.parametrize("force_approximation", [True, False])
    def test_disconnected_data(num_isolates, metric, force_approximation):
        options = [False, True]
        disconnected_data = np.random.choice(a=options, size=(10, 30), p=[0.6, 1 - 0.6])
        # Add some disconnected data for the corner case test
        disconnected_data = np.vstack(
            [disconnected_data, np.zeros((num_isolates, 30), dtype="bool")]
        )
        new_columns = np.zeros((num_isolates + 10, num_isolates), dtype="bool")
        for i in range(num_isolates):
            new_columns[10 + i, i] = True
        disconnected_data = np.hstack([disconnected_data, new_columns])
    
>       with pytest.warns(None) as w:

umap/tests/test_umap_ops.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/recwarn.py:279: in __init__
    warnings.warn(WARNS_NONE_ARG, stacklevel=4)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:345: in from_call
    result: Optional[TResult] = func()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:266: in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/threadexception.py:87: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/threadexception.py:63: in thread_exception_runtest_hook
    yield
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/unraisableexception.py:90: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/unraisableexception.py:65: in unraisable_exception_runtest_hook
    yield
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/logging.py:839: in pytest_runtest_call
    yield from self._runtest_for(item, "call")
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/logging.py:822: in _runtest_for
    yield
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/capture.py:882: in pytest_runtest_call
    return (yield)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/skipping.py:257: in pytest_runtest_call
    return (yield)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:181: in pytest_runtest_call
    raise e
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:173: in pytest_runtest_call
    item.runtest()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:1836: in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:193: in pytest_pyfunc_call
    result = testfunction(**testargs)
umap/test
Raw output
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/recwarn.py:279: pytest.PytestRemovedIn8Warning: Passing None has been deprecated.

Check failure on line 1 in umap/tests/test_umap_ops.py::test_disconnected_data[True-hellinger-1]

See this annotation in the file changed.

@azure-pipelines azure-pipelines / lmcinnes.umap

umap/tests/test_umap_ops.py::test_disconnected_data[True-hellinger-1]

num_isolates = 1, metric = 'hellinger', force_approximation = True

    @pytest.mark.parametrize("num_isolates", [1, 5])
    @pytest.mark.parametrize("metric", ["jaccard", "hellinger"])
    @pytest.mark.parametrize("force_approximation", [True, False])
    def test_disconnected_data(num_isolates, metric, force_approximation):
        options = [False, True]
        disconnected_data = np.random.choice(a=options, size=(10, 30), p=[0.6, 1 - 0.6])
        # Add some disconnected data for the corner case test
        disconnected_data = np.vstack(
            [disconnected_data, np.zeros((num_isolates, 30), dtype="bool")]
        )
        new_columns = np.zeros((num_isolates + 10, num_isolates), dtype="bool")
        for i in range(num_isolates):
            new_columns[10 + i, i] = True
        disconnected_data = np.hstack([disconnected_data, new_columns])
    
>       with pytest.warns(None) as w:

umap/tests/test_umap_ops.py:119: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/recwarn.py:279: in __init__
    warnings.warn(WARNS_NONE_ARG, stacklevel=4)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:345: in from_call
    result: Optional[TResult] = func()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:266: in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/threadexception.py:87: in pytest_runtest_call
    yield from thread_exception_runtest_hook()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/threadexception.py:63: in thread_exception_runtest_hook
    yield
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/unraisableexception.py:90: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/unraisableexception.py:65: in unraisable_exception_runtest_hook
    yield
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/logging.py:839: in pytest_runtest_call
    yield from self._runtest_for(item, "call")
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/logging.py:822: in _runtest_for
    yield
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/capture.py:882: in pytest_runtest_call
    return (yield)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/skipping.py:257: in pytest_runtest_call
    return (yield)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:181: in pytest_runtest_call
    raise e
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/runner.py:173: in pytest_runtest_call
    item.runtest()
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:1836: in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_hooks.py:501: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/pluggy/_manager.py:119: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/python.py:193: in pytest_pyfunc_call
    result = testfunction(**testargs)
umap/te
Raw output
/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/_pytest/recwarn.py:279: pytest.PytestRemovedIn8Warning: Passing None has been deprecated.