about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pymc/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pymc/default.nix')
-rw-r--r--pkgs/development/python-modules/pymc/default.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pymc/default.nix b/pkgs/development/python-modules/pymc/default.nix
new file mode 100644
index 0000000000000..4fce3800ef1f9
--- /dev/null
+++ b/pkgs/development/python-modules/pymc/default.nix
@@ -0,0 +1,71 @@
+{ lib
+, aeppl
+, aesara
+, arviz
+, buildPythonPackage
+, cachetools
+, cloudpickle
+, fastprogress
+, fetchFromGitHub
+, numpy
+, pythonOlder
+, pythonRelaxDepsHook
+, scipy
+, typing-extensions
+}:
+
+buildPythonPackage rec {
+  pname = "pymc";
+  version = "4.0.0";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "pymc-devs";
+    repo = "pymc";
+    rev = "v${version}";
+    hash = "sha256-ZMuDQJ+bmrQlrem/OqU/hIie3ZQkAqayU3N8ZtaW7xo=";
+  };
+
+  nativeBuildInputs = [
+    pythonRelaxDepsHook
+  ];
+
+  propagatedBuildInputs = [
+    aeppl
+    aesara
+    arviz
+    cachetools
+    cloudpickle
+    fastprogress
+    numpy
+    scipy
+    typing-extensions
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace ', "pytest-cov"' ""
+  '';
+
+  pythonRelaxDeps = [
+    "aesara"
+    "aeppl"
+  ];
+
+  # The test suite is computationally intensive and test failures are not
+  # indicative for package usability hence tests are disabled by default.
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "pymc"
+  ];
+
+  meta = with lib; {
+    description = "Bayesian estimation, particularly using Markov chain Monte Carlo (MCMC)";
+    homepage = "https://github.com/pymc-devs/pymc3";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ nidabdella ];
+  };
+}