diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a4e00bb8..08e2b3f5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53ff5486..ee9a611d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,7 +111,7 @@ jobs: # Use silx wheelhouse: needed for ppc64le CIBW_ENVIRONMENT_LINUX: "PIP_FIND_LINKS=https://www.silx.org/pub/wheelhouse/ PIP_TRUSTED_HOST=www.silx.org" CIBW_BUILD_VERBOSITY: 1 - CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* + CIBW_BUILD: cp311-* cp312-* cp313-* # Do not build for pypy and muslinux CIBW_SKIP: pp* *-musllinux_* CIBW_ARCHS: ${{ matrix.cibw_archs }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e4249010..68e074a4 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.10" + python: "3.12" # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/ci/appveyor.yml b/ci/appveyor.yml index 0aebbdfd..aa0238d9 100644 --- a/ci/appveyor.yml +++ b/ci/appveyor.yml @@ -34,12 +34,12 @@ environment: # PYTHON_ARCH: "64" # Python 3.9 - - PYTHON_DIR: "C:\\Python39-x64" - PYTHON_ARCH: "64" + # - PYTHON_DIR: "C:\\Python39-x64" + # PYTHON_ARCH: "64" - # Python 3.10 - - PYTHON_DIR: "C:\\Python310-x64" - PYTHON_ARCH: "64" + # # Python 3.10 + # - PYTHON_DIR: "C:\\Python310-x64" + # PYTHON_ARCH: "64" # Python 3.11 - PYTHON_DIR: "C:\\Python311-x64" @@ -49,6 +49,10 @@ environment: - PYTHON_DIR: "C:\\Python312-x64" PYTHON_ARCH: "64" + # Python 3.13 + - PYTHON_DIR: "C:\\Python313-x64" + PYTHON_ARCH: "64" + install: # Add Python to PATH diff --git a/meson.build b/meson.build index f813632d..12cfa04b 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('FabIO', 'c', 'cython', license: 'MIT', - meson_version: '>= 0.60', + meson_version: '>= 1.3', version: run_command(['version.py', '--wheel'], check:true).stdout().strip(), ) diff --git a/src/fabio/ext/meson.build b/src/fabio/ext/meson.build index 27ec793c..fcb2859f 100644 --- a/src/fabio/ext/meson.build +++ b/src/fabio/ext/meson.build @@ -9,6 +9,7 @@ py.extension_module('cf_io', include_directories : ['include'], install: true, subdir: 'fabio/ext', + limited_api: '3.11' ) py.extension_module('byte_offset', @@ -16,6 +17,7 @@ py.extension_module('byte_offset', dependencies : py_dep, install: true, subdir: 'fabio/ext', + limited_api: '3.11' ) py.extension_module('mar345_IO', @@ -25,6 +27,7 @@ py.extension_module('mar345_IO', install: true, subdir: 'fabio/ext', include_directories : ['include'], + limited_api: '3.11' ) py.extension_module('_cif', @@ -32,6 +35,7 @@ py.extension_module('_cif', dependencies : py_dep, install: true, subdir: 'fabio/ext', + limited_api: '3.11' ) py.extension_module( '_agi_bitfield', @@ -39,6 +43,7 @@ py.extension_module( '_agi_bitfield', dependencies : py_dep, install: true, subdir: 'fabio/ext', + limited_api: '3.11' ) py.extension_module( 'dense', @@ -46,6 +51,5 @@ py.extension_module( 'dense', dependencies : py_dep, install: true, subdir: 'fabio/ext', + limited_api: '3.11' ) - - diff --git a/src/fabio/jpeg2kimage.py b/src/fabio/jpeg2kimage.py index 32414d3a..fbfde5ee 100644 --- a/src/fabio/jpeg2kimage.py +++ b/src/fabio/jpeg2kimage.py @@ -2,7 +2,7 @@ # # Project: FabIO X-ray image reader # -# Copyright (C) 2010-2016 European Synchrotron Radiation Facility +# Copyright (C) 2010-2025 European Synchrotron Radiation Facility # Grenoble, France # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -29,7 +29,7 @@ """ __authors__ = ["Valentin Valls"] -__date__ = "06/04/2020" +__date__ = "05/09/2025" __license__ = "MIT" __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" __status__ = "stable" @@ -129,8 +129,11 @@ def _loadGlymurImage(self, filename, infile): def _readWithGlymur(self, filename, infile): """Read data using Glymur""" image = self._loadGlymurImage(filename, infile) - self.data = image.read() - + if "_read" in dir(image): + self.data = image._read() + else: + self.data = image.read() + def read(self, filename, frame=None): infile = self._open(filename, "rb") self.data = None diff --git a/src/fabio/test/codecs/test_jpeg2kimage.py b/src/fabio/test/codecs/test_jpeg2kimage.py index fa84954b..89553ad0 100644 --- a/src/fabio/test/codecs/test_jpeg2kimage.py +++ b/src/fabio/test/codecs/test_jpeg2kimage.py @@ -102,10 +102,11 @@ def test_open_wrong_format(self): filename = "MultiFrame.edf" filename = UtilsTest.getimage(filename + ".bz2")[:-4] image_format = jpeg2kimage.Jpeg2KImage() + try: _image = image_format.read(filename) self.fail() - except IOError: + except (IOError, RuntimeError): pass def test_open_missing_file(self): diff --git a/src/fabio/test/test_densification.py b/src/fabio/test/test_densification.py index af262ef2..54c14f60 100644 --- a/src/fabio/test/test_densification.py +++ b/src/fabio/test/test_densification.py @@ -66,13 +66,13 @@ def test_rng_normal(self): self.assertAlmostEqual(N.std(), sigma, 1) def test_cython(self): - seed = 0 + seed = 0 shape = 256, 256 nframes = 8 vsize = 181 # This is cheated to avoid interpolation issues with rounding 128*sqrt(2) y, x = numpy.ogrid[-shape[0] // 2:-shape[0] // 2 + shape[0], -shape[1] // 2:-shape[1] // 2 + shape[1]] - # To make this test "robust", those two radial position arrays needs to be in float64 ... in production float32 is more common + # To make this test "robust", those two radial position arrays needs to be in float64 ... in production float32 is more common r2d = numpy.sqrt(x * x + y * y).astype(numpy.float64) radius = numpy.linspace(0, r2d.max(), vsize).astype(numpy.float64) npeak = numpy.random.randint(90, 110, size=nframes) @@ -94,6 +94,9 @@ def test_cython(self): f.ravel()[index[indptr[i]:indptr[i + 1]]] = intensity[indptr[i]:indptr[i + 1]] python = densify(r2d, radius, index[indptr[i]:indptr[i + 1]], intensity[indptr[i]:indptr[i + 1]], 0, background[i]) cython = cython_densify.densify(r2d, radius, index[indptr[i]:indptr[i + 1]], intensity[indptr[i]:indptr[i + 1]], 0, intensity.dtype, background[i]) + if not numpy.all(python == cython): + print(python) + print(cython) self.assertTrue(numpy.all(python == cython), "python == cython #" + str(i)) # Rounding errors: delta = (python.astype(int) - f) diff --git a/version.py b/version.py index 49d65ffe..e1152d32 100755 --- a/version.py +++ b/version.py @@ -75,8 +75,8 @@ "beta": "b", "candidate": "rc"} -MAJOR = 2024 -MINOR = 10 +MAJOR = 2025 +MINOR = 9 MICRO = 0 RELEV = "dev" # <16 SERIAL = 0 # <16