about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/linear_operator/default.nix
blob: 48fb004c14c4bf8b0dbcd7e0b87b5491db20341a (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, scipy
, torch
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "linear_operator";
  version = "0.4.0";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "cornellius-gp";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-0f3F3k3xJACbx42jtwsAmjZwPAOfLywZs8VOrwWicc4=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace 'find_version("linear_operator", "version.py")' \"$version\"
  '';

  propagatedBuildInputs = [
    scipy
    torch
  ];

  checkInputs = [
    pytestCheckHook
  ];
  pythonImportsCheck = [ "linear_operator" ];
  disabledTests = [
    # flaky numerical tests
    "test_svd"
  ];

  meta = with lib; {
    description = "A LinearOperator implementation to wrap the numerical nuts and bolts of GPyTorch";
    homepage = "https://github.com/cornellius-gp/linear_operator/";
    license = licenses.mit;
    maintainers = with maintainers; [ veprbl ];
  };
}