2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2023-01-20 10:41:00 +00:00
|
|
|
, fetchpatch
|
2022-11-02 22:02:43 +00:00
|
|
|
, importlib-metadata
|
2021-09-18 10:52:07 +00:00
|
|
|
, joblib
|
|
|
|
, llvmlite
|
|
|
|
, numba
|
2021-05-20 23:08:51 +00:00
|
|
|
, scikit-learn
|
2021-02-05 17:12:51 +00:00
|
|
|
, scipy
|
2021-09-18 10:52:07 +00:00
|
|
|
, pytestCheckHook
|
2022-02-20 05:27:41 +00:00
|
|
|
, pythonOlder
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pynndescent";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.5.10";
|
2021-09-18 10:52:07 +00:00
|
|
|
format = "setuptools";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-XV3Gg8A+9V/j3faThZcgyhj4XG5uW7C08UhwJ41SiK0=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
patches = [
|
2023-11-16 04:20:00 +00:00
|
|
|
# https://github.com/lmcinnes/pynndescent/pull/224
|
2023-01-20 10:41:00 +00:00
|
|
|
(fetchpatch {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://github.com/lmcinnes/pynndescent/commit/86e0d716a3a4d5f4e6a0a3c2952f6fe339524e96.patch";
|
|
|
|
hash = "sha256-dfnT5P9Qsn/nSAr4Ysqo/olbLLfoZXvBRz33yzhN3J4=";
|
2023-01-20 10:41:00 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
joblib
|
|
|
|
llvmlite
|
|
|
|
numba
|
2021-05-20 23:08:51 +00:00
|
|
|
scikit-learn
|
2021-02-05 17:12:51 +00:00
|
|
|
scipy
|
2022-11-02 22:02:43 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
pytestCheckHook
|
2021-05-03 20:48:10 +00:00
|
|
|
];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
disabledTests = [
|
|
|
|
# numpy.core._exceptions._UFuncNoLoopError
|
|
|
|
"test_sparse_nn_descent_query_accuracy_angular"
|
|
|
|
"test_nn_descent_query_accuracy_angular"
|
|
|
|
"test_alternative_distances"
|
|
|
|
# scipy: ValueError: Unknown Distance Metric: wminkowski
|
|
|
|
# https://github.com/scikit-learn/scikit-learn/pull/21741
|
|
|
|
"test_weighted_minkowski"
|
|
|
|
];
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pynndescent"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Nearest Neighbor Descent";
|
|
|
|
homepage = "https://github.com/lmcinnes/pynndescent";
|
|
|
|
license = licenses.bsd2;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
}
|