1{ lib
2, buildPythonPackage
3, fetchPypi
4, importlib-metadata
5, joblib
6, llvmlite
7, numba
8, scikit-learn
9, scipy
10, pytestCheckHook
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "pynndescent";
16 version = "0.5.8";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.6";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-p8VSVpv2BKEB/VS7odJ8EjieBllF3uOmd3pRjGOkbys=";
24 };
25
26 propagatedBuildInputs = [
27 joblib
28 llvmlite
29 numba
30 scikit-learn
31 scipy
32 ] ++ lib.optionals (pythonOlder "3.8") [
33 importlib-metadata
34 ];
35
36 checkInputs = [
37 pytestCheckHook
38 ];
39
40 disabledTests = [
41 # numpy.core._exceptions._UFuncNoLoopError
42 "test_sparse_nn_descent_query_accuracy_angular"
43 "test_nn_descent_query_accuracy_angular"
44 "test_alternative_distances"
45 # scipy: ValueError: Unknown Distance Metric: wminkowski
46 # https://github.com/scikit-learn/scikit-learn/pull/21741
47 "test_weighted_minkowski"
48 ];
49
50 pythonImportsCheck = [
51 "pynndescent"
52 ];
53
54 meta = with lib; {
55 description = "Nearest Neighbor Descent";
56 homepage = "https://github.com/lmcinnes/pynndescent";
57 license = licenses.bsd2;
58 maintainers = with maintainers; [ mic92 ];
59 };
60}