2018-04-29 18:22:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2021-03-23 22:30:55 +00:00
|
|
|
, fetchpatch
|
2018-04-29 18:22:12 +00:00
|
|
|
, cython
|
|
|
|
, numpy
|
2021-03-23 22:30:55 +00:00
|
|
|
, pytestCheckHook
|
2018-04-29 18:22:12 +00:00
|
|
|
, scipy
|
2021-05-14 18:46:36 +00:00
|
|
|
, scikit-learn
|
2018-04-29 18:22:12 +00:00
|
|
|
, fetchPypi
|
2019-06-22 15:11:06 +00:00
|
|
|
, joblib
|
2019-11-05 16:46:38 +00:00
|
|
|
, six
|
2018-04-29 18:22:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hdbscan";
|
2021-02-20 09:09:10 +00:00
|
|
|
version = "0.8.27";
|
2018-04-29 18:22:12 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-02-20 09:09:10 +00:00
|
|
|
sha256 = "e3a418d0d36874f7b6a1bf0b7461f3857fc13a525fd48ba34caed2fe8973aa26";
|
2018-04-29 18:22:12 +00:00
|
|
|
};
|
2021-03-23 22:30:55 +00:00
|
|
|
patches = [
|
|
|
|
# This patch fixes compatibility with numpy 1.20. It will be in the next release
|
|
|
|
# after 0.8.27
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/scikit-learn-contrib/hdbscan/commit/5b67a4fba39c5aebe8187a6a418da677f89a63e0.patch";
|
|
|
|
sha256 = "07d7jdwk0b8kgaqkifd529sarji01j1jiih7cfccc5kxmlb5py9h";
|
|
|
|
})
|
|
|
|
];
|
2018-04-29 18:22:12 +00:00
|
|
|
|
2019-06-22 15:11:06 +00:00
|
|
|
nativeBuildInputs = [ cython ];
|
2021-05-14 18:46:36 +00:00
|
|
|
propagatedBuildInputs = [ numpy scipy scikit-learn joblib six ];
|
2021-03-23 22:30:55 +00:00
|
|
|
preCheck = ''
|
|
|
|
cd hdbscan/tests
|
|
|
|
rm __init__.py
|
|
|
|
'';
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
2021-05-19 22:01:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# known flaky tests: https://github.com/scikit-learn-contrib/hdbscan/issues/420
|
|
|
|
"test_mem_vec_diff_clusters"
|
|
|
|
"test_all_points_mem_vec_diff_clusters"
|
|
|
|
"test_approx_predict_diff_clusters"
|
2021-05-26 21:22:19 +00:00
|
|
|
# another flaky test https://github.com/scikit-learn-contrib/hdbscan/issues/421
|
|
|
|
"test_hdbscan_boruvka_balltree_matches"
|
2021-05-19 22:01:51 +00:00
|
|
|
];
|
2018-04-29 18:22:12 +00:00
|
|
|
|
2021-09-01 19:24:07 +00:00
|
|
|
pythonImportsCheck = [ "hdbscan" ];
|
|
|
|
|
2018-04-29 18:22:12 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Hierarchical Density-Based Spatial Clustering of Applications with Noise, a clustering algorithm with a scikit-learn compatible API";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/scikit-learn-contrib/hdbscan";
|
2018-04-29 18:22:12 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ ixxie ];
|
|
|
|
};
|
|
|
|
}
|