python312Packages.pgmpy: 0.1.25 -> 0.1.26 (#342500)

This commit is contained in:
Peder Bergebakken Sundt 2024-09-17 15:08:48 +02:00 committed by GitHub
commit e0f9415f91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,9 +2,8 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
pythonOlder,
# build inputs
# dependencies
networkx,
numpy,
scipy,
@ -16,42 +15,29 @@
tqdm,
joblib,
opt-einsum,
# check inputs
xgboost,
google-generativeai,
# tests
pytestCheckHook,
pytest-cov,
coverage,
mock,
black,
}:
let
buildPythonPackage rec {
pname = "pgmpy";
version = "0.1.25";
in
# optional-dependencies = {
# all = [ daft ];
# };
buildPythonPackage {
inherit pname version;
format = "setuptools";
disabled = pythonOlder "3.7";
version = "0.1.26";
pyproject = true;
src = fetchFromGitHub {
owner = "pgmpy";
repo = pname;
repo = "pgmpy";
rev = "refs/tags/v${version}";
hash = "sha256-d2TNcJQ82XxTWdetLgtKXRpFulAEEzrr+cyRewoA6YI=";
hash = "sha256-RusVREhEXYaJuQXTaCQ7EJgbo4+wLB3wXXCAc3sBGtU=";
};
# TODO: Remove this patch after updating to pgmpy 0.1.26.
# The PR https://github.com/pgmpy/pgmpy/pull/1745 will have been merged.
# It contains the fix below, among other things, which is why we do not use fetchpatch.
postPatch = lib.optionalString (pythonAtLeast "3.12") ''
substituteInPlace pgmpy/tests/test_estimators/test_MarginalEstimator.py \
--replace-fail 'self.assert_' 'self.assertTrue'
'';
propagatedBuildInputs = [
dependencies = [
networkx
numpy
scipy
@ -63,10 +49,21 @@ buildPythonPackage {
tqdm
joblib
opt-einsum
xgboost
google-generativeai
];
disabledTests = [
"test_to_daft" # requires optional dependency daft
# flaky:
# AssertionError: -45.78899127622197 != -45.788991276221964
"test_score"
# self.assertTrue(np.isclose(coef, dep_coefs[i], atol=1e-4))
# AssertionError: False is not true
"test_pillai"
# requires optional dependency daft
"test_to_daft"
];
nativeCheckInputs = [
@ -78,11 +75,11 @@ buildPythonPackage {
black
];
meta = with lib; {
meta = {
description = "Python Library for learning (Structure and Parameter), inference (Probabilistic and Causal), and simulations in Bayesian Networks";
homepage = "https://github.com/pgmpy/pgmpy";
changelog = "https://github.com/pgmpy/pgmpy/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ happysalada ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ happysalada ];
};
}