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 ];
|
2022-08-21 13:32:41 +00:00
|
|
|
checkInputs = [ nose2 autograd matplotlib tensorflow ];
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
2022-08-21 13:32:41 +00:00
|
|
|
runHook preCheck
|
|
|
|
# FIXME: Some numpy regression?
|
|
|
|
# Traceback (most recent call last):
|
|
|
|
# File "/build/source/tests/manifolds/test_hyperbolic.py", line 270, in test_second_order_function_approximation
|
|
|
|
# self.run_hessian_approximation_test()
|
|
|
|
# File "/build/source/tests/manifolds/_manifold_tests.py", line 29, in run_hessian_approximation_test
|
|
|
|
# assert np.allclose(np.linalg.norm(error), 0) or (2.95 <= slope <= 3.05)
|
|
|
|
# AssertionError
|
|
|
|
rm tests/manifolds/test_hyperbolic.py
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
nose2 tests -v
|
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 ];
|
|
|
|
};
|
|
|
|
}
|