Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 9 additions & 5 deletions ci/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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(),
)
Expand Down
8 changes: 6 additions & 2 deletions src/fabio/ext/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ py.extension_module('cf_io',
include_directories : ['include'],
install: true,
subdir: 'fabio/ext',
limited_api: '3.11'
)

py.extension_module('byte_offset',
'byte_offset.pyx',
dependencies : py_dep,
install: true,
subdir: 'fabio/ext',
limited_api: '3.11'
)

py.extension_module('mar345_IO',
Expand All @@ -25,27 +27,29 @@ py.extension_module('mar345_IO',
install: true,
subdir: 'fabio/ext',
include_directories : ['include'],
limited_api: '3.11'
)

py.extension_module('_cif',
'_cif.pyx',
dependencies : py_dep,
install: true,
subdir: 'fabio/ext',
limited_api: '3.11'
)

py.extension_module( '_agi_bitfield',
'_agi_bitfield.pyx',
dependencies : py_dep,
install: true,
subdir: 'fabio/ext',
limited_api: '3.11'
)

py.extension_module( 'dense',
'dense.pyx',
dependencies : py_dep,
install: true,
subdir: 'fabio/ext',
limited_api: '3.11'
)


11 changes: 7 additions & 4 deletions src/fabio/jpeg2kimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/fabio/test/codecs/test_jpeg2kimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 5 additions & 2 deletions src/fabio/test/test_densification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions version.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"beta": "b",
"candidate": "rc"}

MAJOR = 2024
MINOR = 10
MAJOR = 2025
MINOR = 9
MICRO = 0
RELEV = "dev" # <16
SERIAL = 0 # <16
Expand Down