1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 numba,
11 numpy,
12 pynndescent,
13 scikit-learn,
14 scipy,
15 tqdm,
16
17 # optional-dependencies
18 bokeh,
19 colorcet,
20 dask,
21 datashader,
22 holoviews,
23 matplotlib,
24 pandas,
25 scikit-image,
26 seaborn,
27 tensorflow,
28 tensorflow-probability,
29
30 # tests
31 pytestCheckHook,
32 writableTmpDirAsHomeHook,
33}:
34
35buildPythonPackage rec {
36 pname = "umap-learn";
37 version = "0.5.9.post2";
38 pyproject = true;
39
40 src = fetchFromGitHub {
41 owner = "lmcinnes";
42 repo = "umap";
43 tag = "release-${version}";
44 hash = "sha256-ollUXPVB07v6DkQ/d1eke0/j1f4Ekfygo1r6CtIRTuk=";
45 };
46
47 build-system = [ setuptools ];
48
49 dependencies = [
50 numba
51 numpy
52 pynndescent
53 scikit-learn
54 scipy
55 tqdm
56 ];
57
58 optional-dependencies = rec {
59 plot = [
60 bokeh
61 colorcet
62 dask
63 datashader
64 holoviews
65 matplotlib
66 pandas
67 scikit-image
68 seaborn
69 ];
70
71 parametric_umap = [
72 tensorflow
73 tensorflow-probability
74 ];
75
76 tbb = [ tbb ];
77
78 all = plot ++ parametric_umap ++ tbb;
79 };
80
81 nativeCheckInputs = [
82 pytestCheckHook
83 writableTmpDirAsHomeHook
84 ];
85
86 disabledTests = [
87 # Plot functionality requires additional packages.
88 # These test also fail with 'RuntimeError: cannot cache function' error.
89 "test_plot_runs_at_all"
90 "test_umap_plot_testability"
91 "test_umap_update_large"
92
93 # Flaky test. Fails with AssertionError sometimes.
94 "test_sparse_hellinger"
95 "test_densmap_trustworthiness_on_iris_supervised"
96
97 # tensorflow maybe incompatible? https://github.com/lmcinnes/umap/issues/821
98 "test_save_load"
99 ];
100
101 meta = {
102 description = "Uniform Manifold Approximation and Projection";
103 homepage = "https://github.com/lmcinnes/umap";
104 changelog = "https://github.com/lmcinnes/umap/releases/tag/release-${src.tag}";
105 license = lib.licenses.bsd3;
106 maintainers = [ ];
107 };
108}