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