2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder
|
2022-07-14 12:49:19 +00:00
|
|
|
, pytestCheckHook, nose, glibcLocales, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy, scipy, matplotlib, h5py }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bayespy";
|
2021-03-23 19:22:30 +00:00
|
|
|
version = "0.5.22";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Python 2 not supported and not some old Python 3 because MPL doesn't support
|
|
|
|
# them properly.
|
|
|
|
disabled = pythonOlder "3.4";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-03-23 19:22:30 +00:00
|
|
|
sha256 = "ed0057dc22bd392df4b3bba23536117e1b2866e3201b12c5a37428d23421a5ba";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
patches = [
|
|
|
|
# Change from scipy to locally defined epsilon
|
|
|
|
# https://github.com/bayespy/bayespy/pull/126
|
|
|
|
(fetchpatch {
|
|
|
|
name = "locally-defined-epsilon.patch";
|
|
|
|
url = "https://github.com/bayespy/bayespy/commit/9be53bada763e19c2b6086731a6aa542ad33aad0.patch";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-KYt/0GcaNWR9K9/uS2OXgK7g1Z+Bayx9+IQGU75Mpuo=";
|
2022-07-14 12:49:19 +00:00
|
|
|
})
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
# Fix deprecated numpy types
|
|
|
|
# https://sources.debian.org/src/python-bayespy/0.5.22-5/debian/patches/pr127-Fix-deprecated-numpy-types.patch/
|
|
|
|
./pr127-Fix-deprecated-numpy-types.patch
|
2022-07-14 12:49:19 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook nose glibcLocales ];
|
2022-07-14 12:49:19 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ numpy scipy matplotlib h5py ];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Assertion error
|
|
|
|
"test_message_to_parents"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "bayespy" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.bayespy.org";
|
|
|
|
description = "Variational Bayesian inference tools for Python";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jluttine ];
|
|
|
|
};
|
|
|
|
}
|