summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pgmpy/default.nix
blob: 3a473f07c38818e2a6b619d4bd2ff86052444972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # dependencies
  google-generativeai,
  joblib,
  networkx,
  numpy,
  opt-einsum,
  pandas,
  pyparsing,
  pyro-ppl,
  scikit-base,
  scikit-learn,
  scipy,
  statsmodels,
  torch,
  tqdm,
  xgboost,

  # tests
  pytestCheckHook,
  pytest-cov-stub,
  mock,
  writableTmpDirAsHomeHook,
}:
buildPythonPackage (finalAttrs: {
  pname = "pgmpy";
  version = "1.0.0-unstable-2025-12-20";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pgmpy";
    repo = "pgmpy";
    rev = "197e1e0444c77c00581a4c32763811e5b03f8503";
    hash = "sha256-TCnn3GrITW8HCrYVeeythiULV130b6uulkijkPpJOqA=";
  };

  dependencies = [
    google-generativeai
    joblib
    networkx
    numpy
    opt-einsum
    pandas
    pyparsing
    pyro-ppl
    scikit-base
    scikit-learn
    scipy
    statsmodels
    torch
    tqdm
    xgboost
  ];

  disabledTests = [
    # 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"

    # AssertionError
    "test_estimate_example_smoke_test"
    "test_gcm"
  ];

  enabledTestPaths = [
    "pgmpy/tests"
  ];

  disabledTestPaths = [
    # requires network access
    "pgmpy/tests/test_datasets"

    # Very slow
    "pgmpy/tests/test_estimators"
    "pgmpy/tests/test_models"
  ];

  nativeCheckInputs = [
    pytestCheckHook
    # xdoctest
    pytest-cov-stub
    mock
    writableTmpDirAsHomeHook
  ];

  pythonImportsCheck = [ "pgmpy" ];

  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/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      happysalada
      sarahec
    ];
  };
})