1{
2 lib,
3 buildPythonPackage,
4 dm-tree,
5 fetchFromGitHub,
6 emcee,
7 h5netcdf,
8 matplotlib,
9 netcdf4,
10 numba,
11 numpy,
12 pandas,
13 setuptools,
14 cloudpickle,
15 pytestCheckHook,
16 scipy,
17 packaging,
18 pythonOlder,
19 typing-extensions,
20 xarray,
21 xarray-einstats,
22 zarr,
23 ffmpeg,
24 h5py,
25 jaxlib,
26 torchvision,
27 jax,
28 # , pymc3 (circular dependency)
29 pyro-ppl,
30 #, pystan (not packaged)
31 numpyro,
32 bokeh,
33}:
34
35buildPythonPackage rec {
36 pname = "arviz";
37 version = "0.18.0";
38 pyproject = true;
39
40 disabled = pythonOlder "3.10";
41
42 src = fetchFromGitHub {
43 owner = "arviz-devs";
44 repo = "arviz";
45 rev = "refs/tags/v${version}";
46 hash = "sha256-SZRqSqChQBSA9/jBXN2ds9hh6TI3qZksHai1j2oVsq0=";
47 };
48
49 build-system = [
50 packaging
51 setuptools
52 ];
53
54 dependencies = [
55 dm-tree
56 h5netcdf
57 matplotlib
58 netcdf4
59 numpy
60 pandas
61 scipy
62 typing-extensions
63 xarray
64 xarray-einstats
65 ];
66
67 nativeCheckInputs = [
68 cloudpickle
69 emcee
70 ffmpeg
71 h5py
72 jax
73 jaxlib
74 numba
75 numpyro
76 # pymc3 (circular dependency)
77 pyro-ppl
78 # pystan (not packaged)
79 pytestCheckHook
80 torchvision
81 zarr
82 bokeh
83 ];
84
85 preCheck = ''
86 export HOME=$(mktemp -d);
87 '';
88
89 pytestFlagsArray = [ "arviz/tests/base_tests/" ];
90
91 disabledTests = [
92 # Tests require network access
93 "test_plot_ppc_transposed"
94 "test_plot_separation"
95 "test_plot_trace_legend"
96 "test_cov"
97 # countourpy is not available at the moment
98 "test_plot_kde"
99 "test_plot_kde_2d"
100 "test_plot_pair"
101 # Array mismatch
102 "test_plot_ts"
103 # The following two tests fail in a common venv-based setup.
104 # An issue has been opened upstream: https://github.com/arviz-devs/arviz/issues/2282
105 "test_plot_ppc_discrete"
106 "test_plot_ppc_discrete_save_animation"
107 # Assertion error
108 "test_data_zarr"
109 "test_plot_forest"
110 ];
111
112 pythonImportsCheck = [ "arviz" ];
113
114 meta = with lib; {
115 description = "Library for exploratory analysis of Bayesian models";
116 homepage = "https://arviz-devs.github.io/arviz/";
117 changelog = "https://github.com/arviz-devs/arviz/blob/v${version}/CHANGELOG.md";
118 license = licenses.asl20;
119 maintainers = with maintainers; [ omnipotententity ];
120 };
121}