1{
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.2";
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-kYKyLY2V6M53co+26ZTZP4U6bHkFebKI5Uhh1x1/N58=";
23 };
24
25 propagatedBuildInputs = [
26 numpy
27 scipy
28 ];
29
30 nativeCheckInputs = [ pytestCheckHook ];
31
32 pythonImportsCheck = [
33 "tensorly"
34 "tensorly.base"
35 "tensorly.cp_tensor"
36 "tensorly.tucker_tensor"
37 "tensorly.tt_tensor"
38 "tensorly.tt_matrix"
39 "tensorly.parafac2_tensor"
40 "tensorly.tenalg"
41 "tensorly.decomposition"
42 "tensorly.regression"
43 "tensorly.metrics"
44 "tensorly.random"
45 "tensorly.datasets"
46 "tensorly.plugins"
47 "tensorly.contrib"
48 ];
49
50 pytestFlagsArray = [ "tensorly" ];
51
52 disabledTests = [
53 # this can fail on hydra and other peoples machines, check with others before re-enabling
54 # AssertionError: Partial_SVD took too long, maybe full_matrices set wrongly
55 "test_svd_time"
56 ];
57
58 meta = with lib; {
59 description = "Tensor learning in Python";
60 homepage = "https://tensorly.org/";
61 license = licenses.bsd3;
62 maintainers = with maintainers; [ bcdarwin ];
63 };
64}