From 5738d565aac239e1141ed2e5189640da728c4c19 Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Tue, 23 Jun 2026 23:18:32 +0200 Subject: [PATCH] try to address some issues reported by Fred debian packaging --- src/fabio/GEimage.py | 2 +- src/fabio/test/test_densification.py | 4 ++-- src/fabio/test/test_flat_binary.py | 16 +++++++++------- version.py | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/fabio/GEimage.py b/src/fabio/GEimage.py index 48c1b7ea..7be8f984 100644 --- a/src/fabio/GEimage.py +++ b/src/fabio/GEimage.py @@ -33,7 +33,7 @@ """ __authors__ = ["Antonino Miceli", "Jon Wright", "Jérôme Kieffer", "Joel Bernier"] -__date__ = "03/04/2020" +__date__ = "23/06/2026" __status__ = "production" __copyright__ = "2007-2020 APS; 2010-2020 ESRF" __licence__ = "MIT" diff --git a/src/fabio/test/test_densification.py b/src/fabio/test/test_densification.py index fd20d330..cdea8330 100644 --- a/src/fabio/test/test_densification.py +++ b/src/fabio/test/test_densification.py @@ -32,7 +32,7 @@ __contact__ = "Jerome.Kieffer@esrf.fr" __license__ = "MIT" __copyright__ = "2020 ESRF" -__date__ = "27/10/2025" +__date__ = "23/06/2026" import unittest import numpy @@ -59,7 +59,7 @@ def test_rng_uniform(self): def test_rng_normal(self): shape = (100, 100) mu = 5.5 - sigma = 1.5 + sigma = 0.5 one = numpy.ones(shape) N = distribution_normal_mtc(one * mu, one * sigma) self.assertAlmostEqual(N.mean(), mu, 1) diff --git a/src/fabio/test/test_flat_binary.py b/src/fabio/test/test_flat_binary.py index 82eb6d2d..a7ce5dc9 100644 --- a/src/fabio/test/test_flat_binary.py +++ b/src/fabio/test/test_flat_binary.py @@ -56,26 +56,28 @@ def setUp(self): for filename in self.filenames: with open(filename, "wb") as f: # A 2048 by 2048 blank image - f.write("\0x0" * 2048 * 2048 * 2) + f.write(b"\x00" * (2048 * 2048 * 2 + 8192)) def test_openimage(self): """ test the opening of "junk" empty images ... - JK: I wonder if this test makes sense ! + JK: I doubt if this test makes sense ! """ nfail = 0 for filename in self.filenames: try: im = fabio.open(filename) - if im.data.tobytes() != "\0x0" * 2048 * 2048 * 2: + except Exception as err: + logger.warning("failed for: %s. \n%s: %s",filename, type(err), err) + nfail += 1 + else: + if im.data.tobytes() == b"\x00" * (2048 * 2048 * 2 + 8192): nfail += 1 else: logger.info("**** Passed: %s" % filename) - except Exception: - logger.warning("failed for: %s" % filename) - nfail += 1 + self.assertEqual( - nfail, 0, " %s failures out of %s" % (nfail, len(self.filenames)) + nfail, 0, f"{nfail} failures out of {len(self.filenames)}" ) def tearDown(self): diff --git a/version.py b/version.py index ba55c1dd..0a7bad10 100755 --- a/version.py +++ b/version.py @@ -78,8 +78,8 @@ MAJOR = 2026 MINOR = 6 -MICRO = 0 -RELEV = "final" # <16 +MICRO = 1 +RELEV = "dev" # <16 SERIAL = 0 # <16 date = __date__