diff options
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/python-modules/patsy/default.nix | 36 | ||||
-rw-r--r-- | pkgs/development/python-modules/pymc3/default.nix | 64 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 21 |
3 files changed, 103 insertions, 18 deletions
diff --git a/pkgs/development/python-modules/patsy/default.nix b/pkgs/development/python-modules/patsy/default.nix new file mode 100644 index 0000000000000..9efa3126ce3be --- /dev/null +++ b/pkgs/development/python-modules/patsy/default.nix @@ -0,0 +1,36 @@ +{ lib +, fetchPypi +, buildPythonPackage +, nose +, six +, numpy +, scipy # optional, allows spline-related features (see patsy's docs) +, parameterized +}: + +buildPythonPackage rec { + pname = "patsy"; + version = "0.5.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "0fw888zd2s7f5zxm9f98ss93qhwv0sqnbdy21ipj33ccqgakhpz0"; + }; + + checkInputs = [ nose parameterized ]; + checkPhase = "nosetests -v"; + + propagatedBuildInputs = [ + six + numpy + scipy + ]; + + meta = { + description = "A Python package for describing statistical models"; + homepage = https://github.com/pydata/patsy; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ ilya-kolpakov ]; + }; +} + diff --git a/pkgs/development/python-modules/pymc3/default.nix b/pkgs/development/python-modules/pymc3/default.nix new file mode 100644 index 0000000000000..308958abb6d09 --- /dev/null +++ b/pkgs/development/python-modules/pymc3/default.nix @@ -0,0 +1,64 @@ +{ lib +, fetchPypi +, buildPythonPackage +, pythonOlder +, Theano +, pandas +, patsy +, joblib +, tqdm +, six +, h5py +, pytest +, nose +, parameterized +, matplotlib +}: + +buildPythonPackage rec { + pname = "pymc3"; + version = "3.2"; + disabled = pythonOlder "3.5"; + + src = fetchPypi { + inherit pname version; + sha256 = "0hpzhkpv7sbwkcva7x914yvzcf1d1a952ynbcx6mvlgv5lqghc39"; + }; + + # No need for coverage stats in Nix builds + postPatch = '' + substituteInPlace setup.py --replace ", 'pytest-cov'" "" + ''; + + propagatedBuildInputs = [ + Theano + pandas + patsy + joblib + tqdm + six + h5py + ]; + + checkInputs = [ + pytest + nose + parameterized + ]; + + # The test suite is computationally intensive and test failures are not + # indicative for package usability hence tests are disabled by default. + doCheck = false; + + # For some reason tests are run as a part of the *install* phase if enabled. + # Theano writes compiled code to ~/.theano hence we set $HOME. + preInstall = "export HOME=$(mktemp -d)"; + postInstall = "rm -rf $HOME"; + + meta = { + description = "Bayesian estimation, particularly using Markov chain Monte Carlo (MCMC)"; + homepage = http://github.com/pymc-devs/pymc3; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ ilya-kolpakov ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f24d6ff955bd0..93444be7302a6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8244,6 +8244,8 @@ in { pygraphviz = callPackage ../development/python-modules/pygraphviz { }; + pymc3 = callPackage ../development/python-modules/pymc3 { }; + pympler = buildPythonPackage rec { pname = "Pympler"; version = "0.4.3"; @@ -9673,24 +9675,7 @@ in { }; }; - patsy = buildPythonPackage rec { - name = "patsy-${version}"; - version = "0.3.0"; - - src = pkgs.fetchurl{ - url = "mirror://pypi/p/patsy/${name}.zip"; - sha256 = "a55dd4ca09af4b9608b81f30322beb450510964c022708ab50e83a065ccf15f0"; - }; - - buildInputs = with self; [ nose ]; - propagatedBuildInputs = with self; [six numpy]; - - meta = { - description = "A Python package for describing statistical models"; - homepage = "https://github.com/pydata/patsy"; - license = licenses.bsd2; - }; - }; + patsy = callPackage ../development/python-modules/patsy { }; paste = buildPythonPackage rec { name = "paste-${version}"; |