1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 numpy,
6 scipy,
7 torch,
8 autograd,
9 matplotlib,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "pymanopt";
15 version = "2.2.0";
16 format = "setuptools";
17
18 src = fetchFromGitHub {
19 owner = pname;
20 repo = pname;
21 rev = "refs/tags/${version}";
22 hash = "sha256-pDFRYhswcuAHG9pcqvzXIy3Ivhxe5R5Ric7AFRh7MK4=";
23 };
24
25 propagatedBuildInputs = [
26 numpy
27 scipy
28 torch
29 ];
30 nativeCheckInputs = [
31 autograd
32 matplotlib
33 pytestCheckHook
34 ];
35
36 preCheck = ''
37 substituteInPlace "tests/conftest.py" \
38 --replace "import tensorflow as tf" ""
39 substituteInPlace "tests/conftest.py" \
40 --replace "tf.random.set_seed(seed)" ""
41 '';
42
43 disabledTestPaths = [
44 "tests/test_examples.py"
45 "tests/backends/test_tensorflow.py"
46 "tests/test_problem.py"
47 ];
48
49 pythonImportsCheck = [ "pymanopt" ];
50
51 meta = {
52 description = "Python toolbox for optimization on Riemannian manifolds with support for automatic differentiation";
53 homepage = "https://www.pymanopt.org/";
54 license = lib.licenses.bsd3;
55 maintainers = with lib.maintainers; [ yl3dy ];
56 broken = lib.versionAtLeast scipy.version "1.10.0";
57 };
58}