nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # nativeBuildInputs
8 writableTmpDirAsHomeHook,
9
10 # build-system
11 packaging,
12 setuptools,
13
14 # dependencies
15 h5netcdf,
16 matplotlib,
17 numpy,
18 pandas,
19 scipy,
20 typing-extensions,
21 xarray,
22 xarray-einstats,
23
24 # tests
25 bokeh,
26 cloudpickle,
27 emcee,
28 ffmpeg,
29 h5py,
30 jax,
31 jaxlib,
32 numba,
33 numpyro,
34 #, pymc3 (circular dependency)
35 pyro-ppl,
36 #, pystan (not packaged)
37 pytestCheckHook,
38 torchvision,
39 zarr,
40}:
41
42buildPythonPackage (finalAttrs: {
43 pname = "arviz";
44 version = "0.23.1";
45 pyproject = true;
46
47 src = fetchFromGitHub {
48 owner = "arviz-devs";
49 repo = "arviz";
50 tag = "v${finalAttrs.version}";
51 hash = "sha256-twAYCH8jsOnXVD3+sstOLEGG1Enbq8M8ZQWffFVzS48=";
52 };
53
54 nativeBuildInputs = [
55 # Arviz wants to write a stamp file to the homedir at import time.
56 # Without $HOME being writable, `pythonImportsCheck` fails.
57 # https://github.com/arviz-devs/arviz/commit/4db612908f588d89bb5bfb6b83a08ada3d54fd02
58 writableTmpDirAsHomeHook
59 ];
60
61 build-system = [
62 packaging
63 setuptools
64 ];
65
66 dependencies = [
67 h5netcdf
68 h5py
69 matplotlib
70 numpy
71 pandas
72 scipy
73 typing-extensions
74 xarray
75 xarray-einstats
76 ];
77
78 nativeCheckInputs = [
79 bokeh
80 cloudpickle
81 emcee
82 ffmpeg
83 jax
84 jaxlib
85 numba
86 numpyro
87 # pymc3 (circular dependency)
88 pyro-ppl
89 # pystan (not packaged)
90 pytestCheckHook
91 torchvision
92 zarr
93 ];
94
95 enabledTestPaths = [
96 "arviz/tests/base_tests/"
97 ];
98
99 disabledTestPaths = [
100 # AttributeError: module 'zarr.storage' has no attribute 'DirectoryStore'
101 # https://github.com/arviz-devs/arviz/issues/2357
102 "arviz/tests/base_tests/test_data_zarr.py::TestDataZarr::test_io_function"
103 "arviz/tests/base_tests/test_data_zarr.py::TestDataZarr::test_io_method"
104 ];
105
106 disabledTests = [
107 # Tests require network access
108 "test_plot_ppc_transposed"
109 "test_plot_separation"
110 "test_plot_trace_legend"
111 "test_cov"
112
113 # countourpy is not available at the moment
114 "test_plot_kde"
115 "test_plot_kde_2d"
116 "test_plot_pair"
117 ];
118
119 # Tests segfault on darwin
120 doCheck = !stdenv.hostPlatform.isDarwin;
121
122 pythonImportsCheck = [ "arviz" ];
123
124 meta = {
125 description = "Library for exploratory analysis of Bayesian models";
126 homepage = "https://arviz-devs.github.io/arviz/";
127 changelog = "https://github.com/arviz-devs/arviz/blob/${finalAttrs.src.tag}/CHANGELOG.md";
128 license = lib.licenses.asl20;
129 maintainers = with lib.maintainers; [ omnipotententity ];
130 };
131})