depot/third_party/nixpkgs/pkgs/development/python-modules/pymanopt/default.nix
Default email 13da32182d Project import generated by Copybara.
GitOrigin-RevId: a7855f2235a1876f97473a76151fec2afa02b287
2022-08-21 15:32:41 +02:00

50 lines
1.3 KiB
Nix

{ lib
, fetchFromGitHub
, buildPythonPackage
, numpy
, scipy
, pytorch
, autograd
, nose2
, matplotlib
, tensorflow
}:
buildPythonPackage rec {
pname = "pymanopt";
version = "2.0.0";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "refs/tags/${version}";
sha256 = "sha256-dqyduExNgXIbEFlgkckaPfhLFSVLqPgwAOyBUdowwiQ=";
};
propagatedBuildInputs = [ numpy scipy pytorch ];
checkInputs = [ nose2 autograd matplotlib tensorflow ];
checkPhase = ''
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
nose2 tests -v
runHook postCheck
'';
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 ];
};
}