1{
2 lib,
3 buildPythonPackage,
4 fetchpatch,
5 cython,
6 numpy,
7 pytestCheckHook,
8 scipy,
9 scikit-learn,
10 fetchPypi,
11 joblib,
12 six,
13 pythonRelaxDepsHook,
14}:
15
16buildPythonPackage rec {
17 pname = "hdbscan";
18 version = "0.8.33";
19 format = "setuptools";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-V/q8Xw5F9I0kB7NccxGSq8iWN2QR/n5LuDb/oD04+Q0=";
24 };
25
26 pythonRemoveDeps = [ "cython" ];
27 nativeBuildInputs = [
28 pythonRelaxDepsHook
29 cython
30 ];
31 propagatedBuildInputs = [
32 numpy
33 scipy
34 scikit-learn
35 joblib
36 six
37 ];
38 preCheck = ''
39 cd hdbscan/tests
40 rm __init__.py
41 '';
42 nativeCheckInputs = [ pytestCheckHook ];
43 disabledTests = [
44 # known flaky tests: https://github.com/scikit-learn-contrib/hdbscan/issues/420
45 "test_mem_vec_diff_clusters"
46 "test_all_points_mem_vec_diff_clusters"
47 "test_approx_predict_diff_clusters"
48 # another flaky test https://github.com/scikit-learn-contrib/hdbscan/issues/421
49 "test_hdbscan_boruvka_balltree_matches"
50 # more flaky tests https://github.com/scikit-learn-contrib/hdbscan/issues/570
51 "test_hdbscan_boruvka_balltree"
52 "test_hdbscan_best_balltree_metric"
53 ];
54
55 pythonImportsCheck = [ "hdbscan" ];
56
57 meta = with lib; {
58 description = "Hierarchical Density-Based Spatial Clustering of Applications with Noise, a clustering algorithm with a scikit-learn compatible API";
59 homepage = "https://github.com/scikit-learn-contrib/hdbscan";
60 license = licenses.bsd3;
61 };
62}