From caccd8a8b2cd1fae2a2e5445af6112e5874c81da Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 10 Jul 2024 17:36:37 +0200 Subject: [PATCH] python311Packages.corner: init at 2.2.2 --- .../python-modules/corner/default.nix | 106 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 108 insertions(+) create mode 100644 pkgs/development/python-modules/corner/default.nix diff --git a/pkgs/development/python-modules/corner/default.nix b/pkgs/development/python-modules/corner/default.nix new file mode 100644 index 000000000000..c69bf902d556 --- /dev/null +++ b/pkgs/development/python-modules/corner/default.nix @@ -0,0 +1,106 @@ +{ + lib, + buildPythonPackage, + pythonOlder, + fetchFromGitHub, + + # build-system + setuptools, + setuptools-scm, + + # dependencies + matplotlib, + + # optional-dependencies + arviz, + ipython, + myst-nb, + pandoc, + sphinx, + sphinx-book-theme, + pytest, + scipy, + + # checks + pytestCheckHook, + corner, +}: + +buildPythonPackage rec { + pname = "corner"; + version = "2.2.2"; + pyproject = true; + + disable = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "dfm"; + repo = "corner.py"; + rev = "refs/tags/v${version}"; + hash = "sha256-MYos01YCSUwivymSE2hbjV7eKXfaMqG89koD2CWZjcQ="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ matplotlib ]; + + optional-dependencies = { + arviz = [ arviz ]; + docs = [ + arviz + ipython + myst-nb + pandoc + sphinx + sphinx-book-theme + ]; + test = [ + arviz + pytest + scipy + ]; + }; + + pythonImportsCheck = [ "corner" ]; + + nativeCheckInputs = [ pytestCheckHook ] ++ corner.passthru.optional-dependencies.test; + + # matplotlib.testing.exceptions.ImageComparisonFailure: images not close + disabledTests = [ + "test_arviz" + "test_basic" + "test_bins" + "test_bins_log" + "test_color" + "test_color_filled" + "test_extended_overplotting" + "test_hist_bin_factor" + "test_labels" + "test_lowNfilled" + "test_no_fill_contours" + "test_overplot_log" + "test_pandas" + "test_quantiles" + "test_range_fig_arg" + "test_reverse_overplotting" + "test_tight" + "test_title_quantiles" + "test_title_quantiles_default" + "test_title_quantiles_raises" + "test_titles1" + "test_titles2" + "test_top_ticks" + "test_truths" + ]; + + meta = { + description = "Make some beautiful corner plots"; + homepage = "https://github.com/dfm/corner.py"; + changelog = "https://github.com/dfm/corner.py/releases/tag/v${version}"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d4b56d1be53f..24f4b1736449 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2515,6 +2515,8 @@ self: super: with self; { coreschema = callPackage ../development/python-modules/coreschema { }; + corner = callPackage ../development/python-modules/corner { }; + cornice = callPackage ../development/python-modules/cornice { }; corsair-scan = callPackage ../development/python-modules/corsair-scan { };