1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 setuptools,
7 arviz,
8 formulae,
9 graphviz,
10 pandas,
11 pymc,
12 blackjax,
13 numpyro,
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "bambi";
19 version = "0.13.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "bambinos";
26 repo = "bambi";
27 rev = "refs/tags/${version}";
28 hash = "sha256-9+uTyV3mQlHOKAjXohwkhTzNe/+I5XR/LuH1ZYvhc8I=";
29 };
30
31 nativeBuildInputs = [ setuptools ];
32
33 propagatedBuildInputs = [
34 arviz
35 formulae
36 graphviz
37 pandas
38 pymc
39 ];
40
41 preCheck = ''
42 export HOME=$(mktemp -d)
43 '';
44
45 nativeCheckInputs = [
46 blackjax
47 numpyro
48 pytestCheckHook
49 ];
50
51 disabledTests = [
52 # Tests require network access
53 "test_alias_equal_to_name"
54 "test_average_by"
55 "test_ax"
56 "test_basic"
57 "test_censored_response"
58 "test_custom_prior"
59 "test_data_is_copied"
60 "test_distributional_model"
61 "test_elasticity"
62 "test_extra_namespace"
63 "test_fig_kwargs"
64 "test_gamma_with_splines"
65 "test_group_effects"
66 "test_hdi_prob"
67 "test_legend"
68 "test_non_distributional_model"
69 "test_normal_with_splines"
70 "test_predict_offset"
71 "test_predict_new_groups"
72 "test_predict_new_groups_fail"
73 "test_set_alias_warnings"
74 "test_subplot_kwargs"
75 "test_transforms"
76 "test_use_hdi"
77 "test_with_groups"
78 "test_with_group_and_panel"
79 "test_with_user_values"
80 ];
81
82 pythonImportsCheck = [ "bambi" ];
83
84 meta = with lib; {
85 homepage = "https://bambinos.github.io/bambi";
86 description = "High-level Bayesian model-building interface";
87 changelog = "https://github.com/bambinos/bambi/releases/tag/${version}";
88 license = licenses.mit;
89 maintainers = with maintainers; [ bcdarwin ];
90 # https://github.com/NixOS/nixpkgs/issues/310940
91 broken = true;
92 };
93}