2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
numpy,
|
|
|
|
scipy,
|
|
|
|
torch,
|
|
|
|
autograd,
|
|
|
|
matplotlib,
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
torch
|
|
|
|
];
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|