Package Details: python-pynndescent 0.5.13-1

Git Clone URL: https://aur.archlinux.org/python-pynndescent.git (read-only, click to copy)
Package Base: python-pynndescent
Description: Simple fast approximate nearest neighbor search
Upstream URL: https://github.com/lmcinnes/pynndescent
Licenses: BSD-2-Clause
Submitter: xantares
Maintainer: a821
Last Packager: a821
Votes: 1
Popularity: 0.000000
First Submitted: 2020-03-21 19:59 (UTC)
Last Updated: 2024-06-18 07:24 (UTC)

Latest Comments

carlosal1015 commented on 2023-07-17 15:35 (UTC)

Hi, I have the following error:

==> Retrieving sources...
  -> Downloading pynndescent-0.5.10.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   122  100   122    0     0   1225      0 --:--:-- --:--:-- --:--:--  1232
100   283  100   283    0     0   1679      0 --:--:-- --:--:-- --:--:--  1679
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 1111k  100 1111k    0     0  3468k      0 --:--:-- --:--:-- --:--:-- 3468k
==> Validating source files with sha256sums...
    pynndescent-0.5.10.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting pynndescent-0.5.10.tar.gz with bsdtar
==> Starting build()...
* Getting build dependencies for wheel...
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'
adding license file 'LICENSE'
no previously-included directories found matching 'pynndescent/__pycache__'
writing manifest file 'pynndescent.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/pynndescent
copying pynndescent/distances.py -> build/lib/pynndescent
copying pynndescent/pynndescent_.py -> build/lib/pynndescent
copying pynndescent/__init__.py -> build/lib/pynndescent
copying pynndescent/utils.py -> build/lib/pynndescent
copying pynndescent/threaded_rp_trees.py -> build/lib/pynndescent
copying pynndescent/sparse_nndescent.py -> build/lib/pynndescent
copying pynndescent/optimal_transport.py -> build/lib/pynndescent
copying pynndescent/graph_utils.py -> build/lib/pynndescent
copying pynndescent/sparse.py -> build/lib/pynndescent
copying pynndescent/rp_trees.py -> build/lib/pynndescent
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/pynndescent
copying build/lib/pynndescent/distances.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/__init__.py -> build/bdist.linux-x86_64/wheel/pynndescent
copying build/lib/pynndescent/utils.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/sparse_nndescent.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/graph_utils.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/rp_trees.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.10-py3.11.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/pynndescent-0.5.10.dist-info/WHEEL
creating '/tmp/makepkg/python-pynndescent/src/pynndescent-0.5.10/dist/.tmp-zhmpl1c_/pynndescent-0.5.10-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.10.dist-info/LICENSE'
adding 'pynndescent-0.5.10.dist-info/METADATA'
adding 'pynndescent-0.5.10.dist-info/WHEEL'
adding 'pynndescent-0.5.10.dist-info/top_level.txt'
adding 'pynndescent-0.5.10.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built pynndescent-0.5.10-py3-none-any.whl
==> Starting check()...
============================= test session starts ==============================
platform linux -- Python 3.11.3, pytest-7.4.0, pluggy-1.0.0
rootdir: /tmp/makepkg/python-pynndescent/src/pynndescent-0.5.10
collected 144 items
pynndescent/tests/test_distances.py ............F.................F..... [ 25%]
s..........                                                              [ 32%]
pynndescent/tests/test_pynndescent_.py ................................. [ 55%]
...........................                                              [ 74%]
pynndescent/tests/test_rank.py .....................................     [100%]
=================================== FAILURES ===================================
_________________________ test_binary_check[kulsinski] _________________________
binary_data = array([[ True, False, False, False, False, False, False, False,  True,
        False,  True, False,  True, False, Fals...se, False, False, False,
        False, False, False, False, False, False, False, False, False,
        False, False]])
metric = 'kulsinski'
    @pytest.mark.parametrize(
        "metric",
        [
            "jaccard",
            "matching",
            "dice",
            "kulsinski",
            "rogerstanimoto",
            "russellrao",
            "sokalmichener",
            "sokalsneath",
            "yule",
        ],
    )
    def test_binary_check(binary_data, metric):
>       dist_matrix = pairwise_distances(binary_data, metric=metric)
pynndescent/tests/test_distances.py:70: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
X = array([[ True, False, False, False, False, False, False, False,  True,
        False,  True, False,  True, False, Fals...se, False, False, False,
        False, False, False, False, False, False, False, False, False,
        False, False]])
Y = None, metric = 'kulsinski', n_jobs = None, force_all_finite = True
kwds = {}
    def pairwise_distances(
        X, Y=None, metric="euclidean", *, n_jobs=None, force_all_finite=True, **kwds
    ):
        """Compute the distance matrix from a vector array X and optional Y.

        This method takes either a vector array or a distance matrix, and returns
        a distance matrix. If the input is a vector array, the distances are
        computed. If the input is a distances matrix, it is returned instead.

        This method provides a safe way to take a distance matrix as input, while
        preserving compatibility with many other algorithms that take a vector
        array.

        If Y is given (default is None), then the returned matrix is the pairwise
        distance between the arrays from both X and Y.

        Valid values for metric are:

        - From scikit-learn: ['cityblock', 'cosine', 'euclidean', 'l1', 'l2',
          'manhattan']. These metrics support sparse matrix
          inputs.
          ['nan_euclidean'] but it does not yet support sparse matrices.

        - From scipy.spatial.distance: ['braycurtis', 'canberra', 'chebyshev',
          'correlation', 'dice', 'hamming', 'jaccard', 'kulsinski', 'mahalanobis',
          'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean',
          'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule']
          See the documentation for scipy.spatial.distance for details on these
          metrics. These metrics do not support sparse matrix inputs.

        .. note::
            `'kulsinski'` is deprecated from SciPy 1.9 and will be removed in SciPy 1.11.

        .. note::
            `'matching'` has been removed in SciPy 1.9 (use `'hamming'` instead).

        Note that in the case of 'cityblock', 'cosine' and 'euclidean' (which are
        valid scipy.spatial.distance metrics), the scikit-learn implementation
        will be used, which is faster and has support for sparse matrices (except
        for 'cityblock'). For a verbose description of the metrics from
        scikit-learn, see :func:`sklearn.metrics.pairwise.distance_metrics`
        function.

        Read more in the :ref:`User Guide <metrics>`.

        Parameters
        ----------
        X : ndarray of shape (n_samples_X, n_samples_X) or \
                (n_samples_X, n_features)
            Array of pairwise distances between samples, or a feature array.
            The shape of the array should be (n_samples_X, n_samples_X) if
            metric == "precomputed" and (n_samples_X, n_features) otherwise.

        Y : ndarray of shape (n_samples_Y, n_features), default=None
            An optional second feature array. Only allowed if
            metric != "precomputed".

        metric : str or callable, default='euclidean'
            The metric to use when calculating distance between instances in a
            feature array. If metric is a string, it must be one of the options
            allowed by scipy.spatial.distance.pdist for its metric parameter, or
            a metric listed in ``pairwise.PAIRWISE_DISTANCE_FUNCTIONS``.
            If metric is "precomputed", X is assumed to be a distance matrix.
            Alternatively, if metric is a callable function, it is called on each
            pair of instances (rows) and the resulting value recorded. The callable
            should take two arrays from X as input and return a value indicating
            the distance between them.

        n_jobs : int, default=None
            The number of jobs to use for the computation. This works by breaking
            down the pairwise matrix into n_jobs even slices and computing them in
            parallel.

            ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
            ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
            for more details.

        force_all_finite : bool or 'allow-nan', default=True
            Whether to raise an error on np.inf, np.nan, pd.NA in array. Ignored
            for a metric listed in ``pairwise.PAIRWISE_DISTANCE_FUNCTIONS``. The
            possibilities are:

            - True: Force all values of array to be finite.
            - False: accepts np.inf, np.nan, pd.NA in array.
            - 'allow-nan': accepts only np.nan and pd.NA values in array. Values
              cannot be infinite.

            .. versionadded:: 0.22
               ``force_all_finite`` accepts the string ``'allow-nan'``.

            .. versionchanged:: 0.23
               Accepts `pd.NA` and converts it into `np.nan`.

        **kwds : optional keyword parameters
            Any further parameters are passed directly to the distance function.
            If using a scipy.spatial.distance metric, the parameters are still
            metric dependent. See the scipy docs for usage examples.

        Returns
        -------
        D : ndarray of shape (n_samples_X, n_samples_X) or \
                (n_samples_X, n_samples_Y)
            A distance matrix D such that D_{i, j} is the distance between the
            ith and jth vectors of the given matrix X, if Y is None.
            If Y is not None, then D_{i, j} is the distance between the ith array
            from X and the jth array from Y.

        See Also
        --------
        pairwise_distances_chunked : Performs the same calculation as this
            function, but returns a generator of chunks of the distance matrix, in
            order to limit memory usage.
        paired_distances : Computes the distances between corresponding elements
            of two arrays.
        """
        if (
            metric not in _VALID_METRICS
            and not callable(metric)
            and metric != "precomputed"
        ):
>           raise ValueError(
                "Unknown metric %s. Valid metrics are %s, or 'precomputed', or a callable"
                % (metric, _VALID_METRICS)
            )
E           ValueError: Unknown metric kulsinski. Valid metrics are ['euclidean', 'l2', 'l1', 'manhattan', 'cityblock', 'braycurtis', 'canberra', 'chebyshev', 'correlation', 'cosine', 'dice', 'hamming', 'jaccard', 'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule', 'wminkowski', 'nan_euclidean', 'haversine'], or 'precomputed', or a callable
/usr/lib/python3.11/site-packages/sklearn/metrics/pairwise.py:2151: ValueError
_____________________ test_sparse_binary_check[kulsinski] ______________________
sparse_binary_data = <12x20 sparse matrix of type '<class 'numpy.bool_'>'
    with 66 stored elements in Compressed Sparse Row format>
metric = 'kulsinski'
    @pytest.mark.parametrize(
        "metric",
        [
            "jaccard",
            "matching",
            "dice",
            "kulsinski",
            "rogerstanimoto",
            "russellrao",
            "sokalmichener",
            "sokalsneath",
        ],
    )
    def test_sparse_binary_check(sparse_binary_data, metric):
        if metric in spdist.sparse_named_distances:
>           dist_matrix = pairwise_distances(np.asarray(sparse_binary_data.todense()), metric=metric)
pynndescent/tests/test_distances.py:177: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
X = array([[False, False,  True,  True, False,  True, False,  True, False,
        False, False,  True, False, False,  Tru...se, False, False, False,
        False, False, False, False, False, False, False, False, False,
        False, False]])
Y = None, metric = 'kulsinski', n_jobs = None, force_all_finite = True
kwds = {}
    def pairwise_distances(
        X, Y=None, metric="euclidean", *, n_jobs=None, force_all_finite=True, **kwds
    ):
        """Compute the distance matrix from a vector array X and optional Y.

        This method takes either a vector array or a distance matrix, and returns
        a distance matrix. If the input is a vector array, the distances are
        computed. If the input is a distances matrix, it is returned instead.

        This method provides a safe way to take a distance matrix as input, while
        preserving compatibility with many other algorithms that take a vector
        array.

        If Y is given (default is None), then the returned matrix is the pairwise
        distance between the arrays from both X and Y.

        Valid values for metric are:

        - From scikit-learn: ['cityblock', 'cosine', 'euclidean', 'l1', 'l2',
          'manhattan']. These metrics support sparse matrix
          inputs.
          ['nan_euclidean'] but it does not yet support sparse matrices.

        - From scipy.spatial.distance: ['braycurtis', 'canberra', 'chebyshev',
          'correlation', 'dice', 'hamming', 'jaccard', 'kulsinski', 'mahalanobis',
          'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean',
          'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule']
          See the documentation for scipy.spatial.distance for details on these
          metrics. These metrics do not support sparse matrix inputs.

        .. note::
            `'kulsinski'` is deprecated from SciPy 1.9 and will be removed in SciPy 1.11.

        .. note::
            `'matching'` has been removed in SciPy 1.9 (use `'hamming'` instead).

        Note that in the case of 'cityblock', 'cosine' and 'euclidean' (which are
        valid scipy.spatial.distance metrics), the scikit-learn implementation
        will be used, which is faster and has support for sparse matrices (except
        for 'cityblock'). For a verbose description of the metrics from
        scikit-learn, see :func:`sklearn.metrics.pairwise.distance_metrics`
        function.

        Read more in the :ref:`User Guide <metrics>`.

        Parameters
        ----------
        X : ndarray of shape (n_samples_X, n_samples_X) or \
                (n_samples_X, n_features)
            Array of pairwise distances between samples, or a feature array.
            The shape of the array should be (n_samples_X, n_samples_X) if
            metric == "precomputed" and (n_samples_X, n_features) otherwise.

        Y : ndarray of shape (n_samples_Y, n_features), default=None
            An optional second feature array. Only allowed if
            metric != "precomputed".

        metric : str or callable, default='euclidean'
            The metric to use when calculating distance between instances in a
            feature array. If metric is a string, it must be one of the options
            allowed by scipy.spatial.distance.pdist for its metric parameter, or
            a metric listed in ``pairwise.PAIRWISE_DISTANCE_FUNCTIONS``.
            If metric is "precomputed", X is assumed to be a distance matrix.
            Alternatively, if metric is a callable function, it is called on each
            pair of instances (rows) and the resulting value recorded. The callable
            should take two arrays from X as input and return a value indicating
            the distance between them.

        n_jobs : int, default=None
            The number of jobs to use for the computation. This works by breaking
            down the pairwise matrix into n_jobs even slices and computing them in
            parallel.

            ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
            ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
            for more details.

        force_all_finite : bool or 'allow-nan', default=True
            Whether to raise an error on np.inf, np.nan, pd.NA in array. Ignored
            for a metric listed in ``pairwise.PAIRWISE_DISTANCE_FUNCTIONS``. The
            possibilities are:

            - True: Force all values of array to be finite.
            - False: accepts np.inf, np.nan, pd.NA in array.
            - 'allow-nan': accepts only np.nan and pd.NA values in array. Values
              cannot be infinite.

            .. versionadded:: 0.22
               ``force_all_finite`` accepts the string ``'allow-nan'``.

            .. versionchanged:: 0.23
               Accepts `pd.NA` and converts it into `np.nan`.

        **kwds : optional keyword parameters
            Any further parameters are passed directly to the distance function.
            If using a scipy.spatial.distance metric, the parameters are still
            metric dependent. See the scipy docs for usage examples.

        Returns
        -------
        D : ndarray of shape (n_samples_X, n_samples_X) or \
                (n_samples_X, n_samples_Y)
            A distance matrix D such that D_{i, j} is the distance between the
            ith and jth vectors of the given matrix X, if Y is None.
            If Y is not None, then D_{i, j} is the distance between the ith array
            from X and the jth array from Y.

        See Also
        --------
        pairwise_distances_chunked : Performs the same calculation as this
            function, but returns a generator of chunks of the distance matrix, in
            order to limit memory usage.
        paired_distances : Computes the distances between corresponding elements
            of two arrays.
        """
        if (
            metric not in _VALID_METRICS
            and not callable(metric)
            and metric != "precomputed"
        ):
>           raise ValueError(
                "Unknown metric %s. Valid metrics are %s, or 'precomputed', or a callable"
                % (metric, _VALID_METRICS)
            )
E           ValueError: Unknown metric kulsinski. Valid metrics are ['euclidean', 'l2', 'l1', 'manhattan', 'cityblock', 'braycurtis', 'canberra', 'chebyshev', 'correlation', 'cosine', 'dice', 'hamming', 'jaccard', 'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule', 'wminkowski', 'nan_euclidean', 'haversine'], or 'precomputed', or a callable
/usr/lib/python3.11/site-packages/sklearn/metrics/pairwise.py:2151: ValueError
=========================== short test summary info ============================
FAILED pynndescent/tests/test_distances.py::test_binary_check[kulsinski] - ValueError: Unknown metric kulsinski. Valid metrics are ['euclidean', 'l2', 'l1', 'manhattan', 'cityblock', 'braycurtis', 'canberra', 'chebyshev', 'correlation', 'cosine', 'dice', 'hamming', 'jaccard', 'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule', 'wminkowski', 'nan_euclidean', 'haversine'], or 'precomputed', or a callable
FAILED pynndescent/tests/test_distances.py::test_sparse_binary_check[kulsinski] - ValueError: Unknown metric kulsinski. Valid metrics are ['euclidean', 'l2', 'l1', 'manhattan', 'cityblock', 'braycurtis', 'canberra', 'chebyshev', 'correlation', 'cosine', 'dice', 'hamming', 'jaccard', 'mahalanobis', 'matching', 'minkowski', 'rogerstanimoto', 'russellrao', 'seuclidean', 'sokalmichener', 'sokalsneath', 'sqeuclidean', 'yule', 'wminkowski', 'nan_euclidean', 'haversine'], or 'precomputed', or a callable
============= 2 failed, 141 passed, 1 skipped in 181.57s (0:03:01) =============
==> ERROR: A failure occurred in check().
    Aborting...

a821 commented on 2023-01-26 19:04 (UTC)

numba is the problem but I see you already submitted a bug: https://bugs.archlinux.org/task/77269