Karsten Schöke pushed to branch master at Debian Med / pycorrfit


Commits:
208bdf78 by Karsten Schöke at 2026-05-15T12:29:14+02:00
try to fix test issue on ppc64

 Insert patch calculate-failure-rate-using-total-number-of-test-cases.patch

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/calculate-failure-rate-using-total-number-of-test-cases.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+pycorrfit (1.3.1+nopack-5) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * calculate-failure-rate-using-total-number-of-test-cases.patch: new
+    try to fix test failures on ppc64
+
+ -- Karsten Schöke <[email protected]>  Fri, 15 May 2026 11:40:54 
+0200
+
 pycorrfit (1.3.1+nopack-4) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/calculate-failure-rate-using-total-number-of-test-cases.patch
=====================================
@@ -0,0 +1,40 @@
+From: =?utf-8?q?Karsten_Sch=C3=B6ke?= <[email protected]>
+Date: Fri, 15 May 2026 11:14:51 +0200
+Subject: tests: calculate failure rate using total number of test cases
+The test `test_fit_single_parameter_with_noise_two_percent` checks that
+the fraction of failed model fits does not exceed 5%.  The previous
+implementation divided the number of failures only by the number of
+successful fits:
+
+    len(faillist) / len(succlist)
+
+This makes the threshold slightly stricter than intended.  For example,
+5 failures and 95 successes yield 5/95 = 5.26%, even though the actual
+failure rate is exactly 5%.
+
+Use the total number of test cases as the denominator instead:
+
+    len(faillist) / (len(succlist) + len(faillist))
+
+This correctly reflects the proportion of failed fits and avoids
+spurious failures on architectures with small numerical differences,
+such as ppc64el.
+
+Forwarded: https://github.com/FCS-analysis/PyCorrFit/pull/214
+---
+ tests/test_fit_models.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_fit_models.py b/tests/test_fit_models.py
+index ed7ca0c..a6ba935 100644
+--- a/tests/test_fit_models.py
++++ b/tests/test_fit_models.py
+@@ -120,7 +120,7 @@ def test_fit_single_parameter_with_noise_one_permille():
+                     reason='minor skew on mips causes test failure')
+ def test_fit_single_parameter_with_noise_two_percent():
+     succlist, faillist = fit_single_parameter_with_noise(noise=0.02)
+-    if len(faillist)/len(succlist) > .05:
++    if len(faillist) / (len(succlist) + len(faillist)) > 0.05:
+         raise ValueError("Model tests failed for:\n", faillist)
+ 
+ 


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
 skip-test_fit_single_parameter-on-mips.patch
 use-local-inventory-references-for-intersphinx.patch
 docs-extensions-simple_gallery.py-reproducible-build.patch
+calculate-failure-rate-using-total-number-of-test-cases.patch



View it on GitLab: 
https://salsa.debian.org/med-team/pycorrfit/-/commit/208bdf7897da201d04402dae2bcda2a33bde7eb4

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/pycorrfit/-/commit/208bdf7897da201d04402dae2bcda2a33bde7eb4
You're receiving this email because of your account on salsa.debian.org. Manage 
all notifications: https://salsa.debian.org/-/profile/notifications | Help: 
https://salsa.debian.org/help


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to