Commit 05e47082 authored by Maksym Balatsko's avatar Maksym Balatsko Committed by Yt
Browse files

python3Packages.scikit-posthocs: init at 0.7.0

parent c5855106
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
From 02266a00ce0eb6a089e7efe07816da1aa5152fc9 Mon Sep 17 00:00:00 2001
From: Maksim Terpilovskii <maximtrp@gmail.com>
Date: Sun, 31 Jul 2022 12:25:14 +0300
Subject: [PATCH] increased abs tolerance for wilcoxon test

---
 tests/test_posthocs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test_posthocs.py b/tests/test_posthocs.py
index 956d808..8cc65e4 100644
--- a/tests/test_posthocs.py
+++ b/tests/test_posthocs.py
@@ -471,7 +471,7 @@ class TestPosthocs(unittest.TestCase):
                               [2.857818e-06, 1.230888e-05, 1]])
 
         results = sp.posthoc_wilcoxon(self.df.sort_index(), val_col = 'pulse', group_col = 'kind')
-        self.assertTrue(np.allclose(results, r_results))
+        self.assertTrue(np.allclose(results, r_results, atol=1e-4))
 
 
     def test_posthoc_scheffe(self):
-- 
2.36.1
+34 −0
Original line number Diff line number Diff line
From 5416ffba3ab01aebab3909400b5a9e847022898e Mon Sep 17 00:00:00 2001
From: Maksim Terpilovskii <maximtrp@gmail.com>
Date: Thu, 16 Mar 2023 00:20:02 +0300
Subject: [PATCH] Update test_posthocs.py

---
 tests/test_posthocs.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_posthocs.py b/tests/test_posthocs.py
index 8cc65e4..42ca5f3 100644
--- a/tests/test_posthocs.py
+++ b/tests/test_posthocs.py
@@ -71,7 +71,7 @@ class TestPosthocs(unittest.TestCase):
         a = splt.sign_plot(x, flat=True, labels=False)
         with self.assertRaises(ValueError):
             splt.sign_plot(x.astype(float), flat=True, labels=False)
-        self.assertTrue(isinstance(a, ma._subplots.Axes))
+        self.assertTrue(isinstance(a, ma._axes.Axes))
 
     def test_sign_plot_nonflat(self):
 
@@ -85,7 +85,7 @@ class TestPosthocs(unittest.TestCase):
         with self.assertRaises(ValueError):
             splt.sign_plot(x.astype(np.int64), labels=False)
 
-        self.assertTrue(isinstance(a, ma._subplots.Axes) and isinstance(cbar, mpl.colorbar.ColorbarBase))
+        self.assertTrue(isinstance(a, ma._axes.Axes) and isinstance(cbar, mpl.colorbar.ColorbarBase))
 
     # Outliers tests
     def test_outliers_iqr(self):
-- 
2.36.1
+65 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools
, wheel
, matplotlib
, numpy
, pandas
, scipy
, seaborn
, statsmodels
, pytestCheckHook
, seaborn-data
}:

buildPythonPackage rec {
  pname = "scikit-posthocs";
  version = "0.7.0";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "maximtrp";
    repo = "scikit-posthocs";
    rev = "v${version}";
    hash = "sha256-IkvAc684AWEK427OGAa4qVy6leWmd3b8Dnhd5bYAt5I=";
  };

  patches = [
    # Fixed on master: https://github.com/maximtrp/scikit-posthocs/commit/02266a00ce0eb6a089e7efe07816da1aa5152fc9
    ./0001-increased-abs-tolerance-for-wilcoxon-test.patch
    # Fixed on master: https://github.com/maximtrp/scikit-posthocs/commit/5416ffba3ab01aebab3909400b5a9e847022898e
    ./0002-Update-test_posthocs.py.patch
  ];

  nativeBuildInputs = [
    setuptools
    wheel
  ];

  propagatedBuildInputs = [
    matplotlib
    numpy
    pandas
    scipy
    seaborn
    statsmodels
  ];

  preCheck = ''
    # tests require to write to home directory
    export SEABORN_DATA=${seaborn-data.exercise}
  '';
  nativeCheckInputs = [
    pytestCheckHook
  ];
  pythonImportsCheck = [ "scikit_posthocs" ];

  meta = with lib; {
    description = "Multiple Pairwise Comparisons (Post Hoc) Tests in Python";
    homepage = "https://github.com/maximtrp/scikit-posthocs";
    changelog = "https://github.com/maximtrp/scikit-posthocs/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ mbalatsko ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -11649,6 +11649,8 @@ self: super: with self; {
  scikit-optimize = callPackage ../development/python-modules/scikit-optimize { };
  scikit-posthocs = callPackage ../development/python-modules/scikit-posthocs { };
  scikit-rf = callPackage ../development/python-modules/scikit-rf { };
  scikits-odes = callPackage ../development/python-modules/scikits-odes { };