1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # dependencies
7 networkx,
8 numpy,
9 scipy,
10 scikit-learn,
11 pandas,
12 pyparsing,
13 torch,
14 statsmodels,
15 tqdm,
16 joblib,
17 opt-einsum,
18 xgboost,
19 google-generativeai,
20
21 # tests
22 pytestCheckHook,
23 pytest-cov-stub,
24 coverage,
25 mock,
26 black,
27}:
28buildPythonPackage rec {
29 pname = "pgmpy";
30 version = "0.1.26";
31 pyproject = true;
32
33 src = fetchFromGitHub {
34 owner = "pgmpy";
35 repo = "pgmpy";
36 tag = "v${version}";
37 hash = "sha256-RusVREhEXYaJuQXTaCQ7EJgbo4+wLB3wXXCAc3sBGtU=";
38 };
39
40 dependencies = [
41 networkx
42 numpy
43 scipy
44 scikit-learn
45 pandas
46 pyparsing
47 torch
48 statsmodels
49 tqdm
50 joblib
51 opt-einsum
52 xgboost
53 google-generativeai
54 ];
55
56 disabledTests = [
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"
67 ];
68
69 nativeCheckInputs = [
70 pytestCheckHook
71 # xdoctest
72 pytest-cov-stub
73 coverage
74 mock
75 black
76 ];
77
78 meta = {
79 description = "Python Library for learning (Structure and Parameter), inference (Probabilistic and Causal), and simulations in Bayesian Networks";
80 homepage = "https://github.com/pgmpy/pgmpy";
81 changelog = "https://github.com/pgmpy/pgmpy/releases/tag/v${version}";
82 license = lib.licenses.mit;
83 maintainers = with lib.maintainers; [ happysalada ];
84 };
85}