1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6
7 # build-system
8 setuptools,
9 setuptools-scm,
10
11 # dependencies
12 matplotlib,
13
14 # optional-dependencies
15 arviz,
16 ipython,
17 myst-nb,
18 pandoc,
19 sphinx,
20 sphinx-book-theme,
21 pytest,
22 scipy,
23
24 # checks
25 pytestCheckHook,
26 corner,
27}:
28
29buildPythonPackage rec {
30 pname = "corner";
31 version = "2.2.2";
32 pyproject = true;
33
34 disable = pythonOlder "3.9";
35
36 src = fetchFromGitHub {
37 owner = "dfm";
38 repo = "corner.py";
39 rev = "refs/tags/v${version}";
40 hash = "sha256-MYos01YCSUwivymSE2hbjV7eKXfaMqG89koD2CWZjcQ=";
41 };
42
43 build-system = [
44 setuptools
45 setuptools-scm
46 ];
47
48 dependencies = [ matplotlib ];
49
50 optional-dependencies = {
51 arviz = [ arviz ];
52 docs = [
53 arviz
54 ipython
55 myst-nb
56 pandoc
57 sphinx
58 sphinx-book-theme
59 ];
60 test = [
61 arviz
62 pytest
63 scipy
64 ];
65 };
66
67 pythonImportsCheck = [ "corner" ];
68
69 nativeCheckInputs = [ pytestCheckHook ] ++ corner.optional-dependencies.test;
70
71 # matplotlib.testing.exceptions.ImageComparisonFailure: images not close
72 disabledTests = [
73 "test_arviz"
74 "test_basic"
75 "test_bins"
76 "test_bins_log"
77 "test_color"
78 "test_color_filled"
79 "test_extended_overplotting"
80 "test_hist_bin_factor"
81 "test_labels"
82 "test_levels2"
83 "test_lowNfilled"
84 "test_no_fill_contours"
85 "test_overplot"
86 "test_overplot_log"
87 "test_pandas"
88 "test_quantiles"
89 "test_range_fig_arg"
90 "test_reverse"
91 "test_reverse_overplotting"
92 "test_reverse_truths"
93 "test_smooth1"
94 "test_tight"
95 "test_title_quantiles"
96 "test_title_quantiles_default"
97 "test_title_quantiles_raises"
98 "test_titles1"
99 "test_titles2"
100 "test_top_ticks"
101 "test_truths"
102 ];
103
104 meta = {
105 description = "Make some beautiful corner plots";
106 homepage = "https://github.com/dfm/corner.py";
107 changelog = "https://github.com/dfm/corner.py/releases/tag/v${version}";
108 license = lib.licenses.bsd2;
109 maintainers = with lib.maintainers; [ GaetanLepage ];
110 };
111}