summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/umap-learn/default.nix
blob: 5c4743fdbae2c8544d3dba31a0b21127c0747b82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,

  # dependencies
  numba,
  numpy,
  pynndescent,
  scikit-learn,
  scipy,
  tqdm,

  # optional-dependencies
  bokeh,
  colorcet,
  dask,
  datashader,
  holoviews,
  matplotlib,
  pandas,
  scikit-image,
  seaborn,
  tensorflow,
  tensorflow-probability,

  # tests
  pytestCheckHook,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
  pname = "umap-learn";
  version = "0.5.9.post2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "lmcinnes";
    repo = "umap";
    tag = "release-${version}";
    hash = "sha256-ollUXPVB07v6DkQ/d1eke0/j1f4Ekfygo1r6CtIRTuk=";
  };

  build-system = [ setuptools ];

  dependencies = [
    numba
    numpy
    pynndescent
    scikit-learn
    scipy
    tqdm
  ];

  optional-dependencies = rec {
    plot = [
      bokeh
      colorcet
      dask
      datashader
      holoviews
      matplotlib
      pandas
      scikit-image
      seaborn
    ];

    parametric_umap = [
      tensorflow
      tensorflow-probability
    ];

    tbb = [
      # Not packaged.
      #tbb
    ];

    all = plot ++ parametric_umap ++ tbb;
  };

  nativeCheckInputs = [
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  disabledTests = [
    # Plot functionality requires additional packages.
    # These test also fail with 'RuntimeError: cannot cache function' error.
    "test_plot_runs_at_all"
    "test_umap_plot_testability"
    "test_umap_update_large"

    # Flaky test. Fails with AssertionError sometimes.
    "test_sparse_hellinger"
    "test_densmap_trustworthiness_on_iris_supervised"

    # tensorflow maybe incompatible? https://github.com/lmcinnes/umap/issues/821
    "test_save_load"
  ];

  meta = {
    description = "Uniform Manifold Approximation and Projection";
    homepage = "https://github.com/lmcinnes/umap";
    changelog = "https://github.com/lmcinnes/umap/releases/tag/release-${src.tag}";
    license = lib.licenses.bsd3;
    maintainers = [ ];
  };
}