2021-08-22 07:53:02 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, numpy
|
|
|
|
, scipy
|
2022-09-09 14:08:57 +00:00
|
|
|
, torch
|
2021-08-22 07:53:02 +00:00
|
|
|
, autograd
|
2022-08-21 13:32:41 +00:00
|
|
|
, matplotlib
|
2023-07-15 17:15:38 +00:00
|
|
|
, pytestCheckHook
|
2021-08-22 07:53:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pymanopt";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.2.0";
|
2023-07-15 17:15:38 +00:00
|
|
|
format = "setuptools";
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-pDFRYhswcuAHG9pcqvzXIy3Ivhxe5R5Ric7AFRh7MK4=";
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
propagatedBuildInputs = [ numpy scipy torch ];
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeCheckInputs = [ autograd matplotlib pytestCheckHook ];
|
2021-08-22 07:53:02 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
preCheck = ''
|
|
|
|
substituteInPlace "tests/conftest.py" \
|
|
|
|
--replace "import tensorflow as tf" ""
|
|
|
|
substituteInPlace "tests/conftest.py" \
|
|
|
|
--replace "tf.random.set_seed(seed)" ""
|
2021-08-22 07:53:02 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/test_examples.py"
|
|
|
|
"tests/backends/test_tensorflow.py"
|
|
|
|
"tests/test_problem.py"
|
|
|
|
];
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pymanopt" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Python toolbox for optimization on Riemannian manifolds with support for automatic differentiation";
|
|
|
|
homepage = "https://www.pymanopt.org/";
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
maintainers = with lib.maintainers; [ yl3dy ];
|
2023-07-15 17:15:38 +00:00
|
|
|
broken = lib.versionAtLeast scipy.version "1.10.0";
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
|
|
|
}
|