summary refs log tree commit diff
path: root/pkgs/development/python-modules/bambi/default.nix
blob: dd76021cab03de0314be8e05fe8d59d7f1ff40dc (plain) (blame)
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
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, pytestCheckHook
, arviz
, blackjax
, formulae
, graphviz
, numpy
, numpyro
, pandas
, pymc
, scipy
, setuptools
}:

buildPythonPackage rec {
  pname = "bambi";
  version = "0.10.0";
  format = "pyproject";

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "bambinos";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-D04eTAlckEqgKA+59BRljlyneHYoqqZvLYmt/gBLHcU=";
  };

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    arviz
    formulae
    numpy
    pandas
    pymc
    scipy
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  nativeCheckInputs = [
    blackjax
    graphviz
    numpyro
    pytestCheckHook
  ];

  disabledTests = [
    # Tests require network access
    "test_custom_prior"
    "test_data_is_copied"
    "test_distributional_model"
    "test_gamma_with_splines"
    "test_non_distributional_model_with_categories"
    "test_non_distributional_model"
    "test_normal_with_splines"
    "test_predict_offset"
    # Assertion issue
    "test_custom_likelihood_function"
  ];

  pythonImportsCheck = [
    "bambi"
  ];

  meta = with lib; {
    homepage = "https://bambinos.github.io/bambi";
    description = "High-level Bayesian model-building interface";
    license = licenses.mit;
    maintainers = with maintainers; [ bcdarwin ];
  };
}