1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, scipy
5, torch
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "linear_operator";
11 version = "0.4.0";
12 format = "pyproject";
13
14 src = fetchFromGitHub {
15 owner = "cornellius-gp";
16 repo = pname;
17 rev = "v${version}";
18 hash = "sha256-0f3F3k3xJACbx42jtwsAmjZwPAOfLywZs8VOrwWicc4=";
19 };
20
21 postPatch = ''
22 substituteInPlace setup.py \
23 --replace 'find_version("linear_operator", "version.py")' \"$version\"
24 '';
25
26 propagatedBuildInputs = [
27 scipy
28 torch
29 ];
30
31 checkInputs = [
32 pytestCheckHook
33 ];
34 pythonImportsCheck = [ "linear_operator" ];
35 disabledTests = [
36 # flaky numerical tests
37 "test_svd"
38 ];
39
40 meta = with lib; {
41 description = "A LinearOperator implementation to wrap the numerical nuts and bolts of GPyTorch";
42 homepage = "https://github.com/cornellius-gp/linear_operator/";
43 license = licenses.mit;
44 maintainers = with maintainers; [ veprbl ];
45 };
46}