1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, numpy
6, pytestCheckHook
7, pythonOlder
8, scipy
9}:
10
11buildPythonPackage rec {
12 pname = "tensorly";
13 version = "0.8.1";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.7";
17
18 src = fetchFromGitHub {
19 owner = pname;
20 repo = pname;
21 rev = "refs/tags/${version}";
22 hash = "sha256-hwpdExW/ESOavFkL3old1Efo5WC+PYmcgJp5/oLelaA=";
23 };
24
25 propagatedBuildInputs = [
26 numpy
27 scipy
28 ];
29
30 nativeCheckInputs = [
31 pytestCheckHook
32 ];
33
34 pythonImportsCheck = [
35 "tensorly"
36 "tensorly.base"
37 "tensorly.cp_tensor"
38 "tensorly.tucker_tensor"
39 "tensorly.tt_tensor"
40 "tensorly.tt_matrix"
41 "tensorly.parafac2_tensor"
42 "tensorly.tenalg"
43 "tensorly.decomposition"
44 "tensorly.regression"
45 "tensorly.metrics"
46 "tensorly.random"
47 "tensorly.datasets"
48 "tensorly.plugins"
49 "tensorly.contrib"
50 ];
51
52 pytestFlagsArray = [
53 "tensorly"
54 ];
55
56 disabledTests = [
57 # this can fail on hydra and other peoples machines, check with others before re-enabling
58 # AssertionError: Partial_SVD took too long, maybe full_matrices set wrongly
59 "test_svd_time"
60 ];
61
62 meta = with lib; {
63 description = "Tensor learning in Python";
64 homepage = "https://tensorly.org/";
65 license = licenses.bsd3;
66 maintainers = with maintainers; [ bcdarwin ];
67 };
68}