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
|
|
|
|
, nose2
|
2022-08-21 13:32:41 +00:00
|
|
|
, matplotlib
|
|
|
|
, tensorflow
|
2021-08-22 07:53:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pymanopt";
|
2022-09-11 15:47:08 +00:00
|
|
|
version = "2.0.1";
|
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}";
|
2022-09-11 15:47:08 +00:00
|
|
|
sha256 = "sha256-VwCUqKI1PkR8nUVaa73bkTw67URKPaza3VU9g+rB+Mg=";
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
propagatedBuildInputs = [ numpy scipy torch ];
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ nose2 autograd matplotlib tensorflow ];
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2022-08-21 13:32:41 +00:00
|
|
|
runHook preCheck
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
# upstream themselves seem unsure about the robustness of these
|
|
|
|
# tests - see https://github.com/pymanopt/pymanopt/issues/219
|
|
|
|
grep -lr 'test_second_order_function_approximation' tests/ | while read -r fn ; do
|
|
|
|
substituteInPlace "$fn" \
|
|
|
|
--replace \
|
|
|
|
'test_second_order_function_approximation' \
|
|
|
|
'dont_test_second_order_function_approximation'
|
|
|
|
done
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
nose2 tests -v
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
runHook postCheck
|
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 ];
|
|
|
|
};
|
|
|
|
}
|