22 lib ,
33 buildPythonPackage ,
44 fetchFromGitHub ,
5- pythonAtLeast ,
6- pythonOlder ,
7- # build inputs
5+
6+ # dependencies
87 networkx ,
98 numpy ,
109 scipy ,
1615 tqdm ,
1716 joblib ,
1817 opt-einsum ,
19- # check inputs
18+ xgboost ,
19+ google-generativeai ,
20+
21+ # tests
2022 pytestCheckHook ,
2123 pytest-cov ,
2224 coverage ,
2325 mock ,
2426 black ,
2527} :
26- let
28+ buildPythonPackage rec {
2729 pname = "pgmpy" ;
28- version = "0.1.25" ;
29- in
30- # optional-dependencies = {
31- # all = [ daft ];
32- # };
33- buildPythonPackage {
34- inherit pname version ;
35- format = "setuptools" ;
36-
37- disabled = pythonOlder "3.7" ;
30+ version = "0.1.26" ;
31+ pyproject = true ;
3832
3933 src = fetchFromGitHub {
4034 owner = "pgmpy" ;
41- repo = pname ;
35+ repo = "pgmpy" ;
4236 rev = "refs/tags/v${ version } " ;
43- hash = "sha256-d2TNcJQ82XxTWdetLgtKXRpFulAEEzrr+cyRewoA6YI =" ;
37+ hash = "sha256-RusVREhEXYaJuQXTaCQ7EJgbo4+wLB3wXXCAc3sBGtU =" ;
4438 } ;
4539
46- # TODO: Remove this patch after updating to pgmpy 0.1.26.
47- # The PR https://github.com/pgmpy/pgmpy/pull/1745 will have been merged.
48- # It contains the fix below, among other things, which is why we do not use fetchpatch.
49- postPatch = lib . optionalString ( pythonAtLeast "3.12" ) ''
50- substituteInPlace pgmpy/tests/test_estimators/test_MarginalEstimator.py \
51- --replace-fail 'self.assert_' 'self.assertTrue'
52- '' ;
53-
54- propagatedBuildInputs = [
40+ dependencies = [
5541 networkx
5642 numpy
5743 scipy
@@ -63,10 +49,21 @@ buildPythonPackage {
6349 tqdm
6450 joblib
6551 opt-einsum
52+ xgboost
53+ google-generativeai
6654 ] ;
6755
6856 disabledTests = [
69- "test_to_daft" # requires optional dependency daft
57+ # flaky:
58+ # AssertionError: -45.78899127622197 != -45.788991276221964
59+ "test_score"
60+
61+ # self.assertTrue(np.isclose(coef, dep_coefs[i], atol=1e-4))
62+ # AssertionError: False is not true
63+ "test_pillai"
64+
65+ # requires optional dependency daft
66+ "test_to_daft"
7067 ] ;
7168
7269 nativeCheckInputs = [
@@ -78,11 +75,11 @@ buildPythonPackage {
7875 black
7976 ] ;
8077
81- meta = with lib ; {
78+ meta = {
8279 description = "Python Library for learning (Structure and Parameter), inference (Probabilistic and Causal), and simulations in Bayesian Networks" ;
8380 homepage = "https://github.com/pgmpy/pgmpy" ;
8481 changelog = "https://github.com/pgmpy/pgmpy/releases/tag/v${ version } " ;
85- license = licenses . mit ;
86- maintainers = with maintainers ; [ happysalada ] ;
82+ license = lib . licenses . mit ;
83+ maintainers = with lib . maintainers ; [ happysalada ] ;
8784 } ;
8885}
0 commit comments