Skip to content
Merged
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
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python ./tools/check_meson.py dist/silx-*.whl

build:
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.QT_API }}"
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.QT_API }} ${{ matrix.numpy_version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -43,18 +43,21 @@ jobs:
QT_API: PySide6
with_opencl: true
with_gl_test: true
numpy_version: ""

- os: macos-latest
python-version: "3.14"
QT_API: PyQt6
with_opencl: false
with_gl_test: false
numpy_version: ""

- os: windows-latest
python-version: "3.10"
QT_API: PyQt5
with_opencl: false
with_gl_test: true
numpy_version: "numpy<2"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be only a flag numpy_v1: true

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, but that's a backport here so no the place to change this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, just mentioning as I see 😉


steps:
- uses: actions/checkout@v5
Expand All @@ -79,6 +82,10 @@ jobs:
pip install -r ci/requirements-pinned.txt
pip install --pre "${{ matrix.QT_API }}"
pip install --pre "$(ls dist/silx*.whl)[full,test]"
if [ -n "${{ matrix.numpy_version }}" ]; then
pip uninstall -y h5pyd;
pip install "${{ matrix.numpy_version }}";
fi
python ./ci/info_platform.py
pip list

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
if: runner.os == 'Linux'
with:
platforms: all
- uses: pypa/cibuildwheel@v3.3.1
- uses: pypa/cibuildwheel@v4.2.1
env:
# Configure silx tests
WITH_QT_TEST: "False"
Expand All @@ -229,7 +229,7 @@ jobs:
CIBW_ENVIRONMENT_PASS_LINUX: WITH_QT_TEST WITH_GL_TEST SILX_OPENCL

CIBW_BUILD_VERBOSITY: 1
CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* cp314-*
CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* cp314-* cp315-*
CIBW_SKIP: cp310-win_arm64 *-musllinux_*
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_BUILD_FRONTEND: "build; args: -C setup-args=-Duse_openmp=disabled"
Expand All @@ -243,7 +243,8 @@ jobs:
# - ARM64 windows: Wheels missing for some dependencies
# - Windows python 3.14: PyOpencl wheel missing
# - Linux python 3.14: PySide6 wheel requires a too recent manylinux version
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *-win_arm64 cp314-win_amd64 cp314-manylinux_x86_64"
# - Python 3.15 until all dependencies are available
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *-win_arm64 cp314-win_amd64 cp314-manylinux_x86_64 cp315-*"

- uses: actions/upload-artifact@v6
with:
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Release Notes
=============


3.1.3: 2026/10/06
-----------------

* `silx.gui.plot.PlotWidget`: Fixed keep aspect ratio with matplotlib tight layout (`PR #4734 <https://github.com/silx-kit/silx/pull/4734>`_)
* `silx.gui.utils.glutils.isOpenGLAvailable`: Fixed support of `pyopengl`>=4.0.0a4 and wayland (`PR #4727 <https://github.com/silx-kit/silx/pull/4727>`_)
* Dependencies:

* Added cython>=3.3.0 support (`PR #4731 <https://github.com/silx-kit/silx/pull/4731>`_)
* Added Python3.15 support (`PR #4732 <https://github.com/silx-kit/silx/pull/4732>`_)
* Fixed support of `numpy` v1 (`PR #4725 <https://github.com/silx-kit/silx/pull/4725>`_, `PR #4728 <https://github.com/silx-kit/silx/pull/4728>`_)

3.1.2: 2026/09/03
-----------------

Expand Down
1 change: 0 additions & 1 deletion ci/requirements-pinned.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
--find-links http://www.silx.org/pub/wheelhouse/

# Placeholder for pinned packages used by CI
Cython==3.2.6
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies = [
build-backend = 'mesonpy'
requires = [
'meson-python',
'cython>=3.1,<3.3',
'cython>=3.1',
]


Expand Down Expand Up @@ -98,7 +98,7 @@ dev = [
'wheel', # To build wheels
'meson-python',
'ninja',
'cython>=3.1,<3.3',
'cython>=3.1',
"tomli>=1.0.0; python_version < '3.11'", # For bootstrap.py and build_man_page.py
'ruff', # Formatting and linting
'pyinstaller>=6.0.0; sys_platform == "win32"',
Expand Down
2 changes: 1 addition & 1 deletion src/silx/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

MAJOR = 3
MINOR = 1
MICRO = 2
MICRO = 3
RELEV = "final" # <16
SERIAL = 0 # <16

Expand Down
4 changes: 2 additions & 2 deletions src/silx/gui/plot/_utils/axis_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def apply(axisScale: AxisScaleType, value: float | ArrayLike) -> float | numpy.n
scaled[~numpy.isfinite(scaled)] = numpy.nan
return scaled
elif axisScale == "asinh":
return numpy.asinh(value)
return numpy.arcsinh(value)
else:
raise ValueError(f"Unsupported axis scale: {axisScale}")

Expand All @@ -57,7 +57,7 @@ def revert(axisScale: AxisScaleType, value: float | ArrayLike) -> float | numpy.
return value
elif axisScale == "log":
with numpy.errstate(over="ignore"):
return numpy.pow(10.0, value)
return numpy.power(10.0, value)
elif axisScale == "asinh":
with numpy.errstate(over="ignore"):
return numpy.sinh(value)
Expand Down
10 changes: 5 additions & 5 deletions src/silx/gui/plot/backends/BackendMatplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def __init__(self, plot, parent=None):
self._axesDisplayed = True

self.fig = Figure(
tight_layout=config._MPL_TIGHT_LAYOUT,
layout="tight" if config._MPL_TIGHT_LAYOUT else None,
)
self.fig.set_facecolor("w")

Expand Down Expand Up @@ -1247,13 +1247,13 @@ def _setPlotBounds(
if not self.isKeepDataAspectRatio():
newXRange, newYRange, newY2Range = xRange, yRange, y2Range
else:
bbox = self.fig.get_window_extent()
plotWidth, plotHeight = self.getPlotBoundsInPixels()[2:]
if keepDim is None:
xDataRange, yDataRange, _ = self._plot.getDataRange()
keepDim = findDimToKeep(bbox.width, bbox.height, xDataRange, yDataRange)
keepDim = findDimToKeep(plotWidth, plotHeight, xDataRange, yDataRange)
newXRange, newYRange, newY2Range = ensureAspectRatio(
bbox.width,
bbox.height,
plotWidth,
plotHeight,
xRange,
yRange,
y2Range,
Expand Down
30 changes: 18 additions & 12 deletions src/silx/gui/utils/glutils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import os
import sys
import subprocess

from packaging.version import Version
from silx.gui import qt


Expand Down Expand Up @@ -129,11 +131,12 @@ def isOpenGLAvailable(

# Check pyopengl availability
try:
from silx.gui._glutils import gl
import OpenGL
except ImportError:
return _IsOpenGLAvailableResult(
"Cannot import OpenGL wrapper: pyopengl is not installed"
"Cannot import OpenGL: pyopengl is not installed"
)
from silx.gui._glutils import gl

# Pre checks for Qt < 5.4
if not hasattr(qt, "QOpenGLWidget"):
Expand All @@ -149,15 +152,16 @@ def isOpenGLAvailable(
# so this is only checked if the QApplication is already created
return _IsOpenGLAvailableResult("Qt reports OpenGL not available")

# Check compatibility between Qt platform and pyopengl selected platform
qt_qpa_platform = qt.QGuiApplication.platformName()
pyopengl_platform = gl.getPlatform()
if (qt_qpa_platform == "wayland" and pyopengl_platform != "EGLPlatform") or (
qt_qpa_platform == "xcb" and pyopengl_platform != "GLXPlatform"
):
return _IsOpenGLAvailableResult(
f"Qt platform '{qt_qpa_platform}' is not compatible with PyOpenGL platform '{pyopengl_platform}'"
)
if Version(OpenGL.__version__) < Version("4.0.0a4"):
# Check compatibility between Qt platform and pyopengl selected platform
qt_qpa_platform = qt.QGuiApplication.platformName()
pyopengl_platform = gl.getPlatform()
if (qt_qpa_platform == "wayland" and pyopengl_platform != "EGLPlatform") or (
qt_qpa_platform == "xcb" and pyopengl_platform != "GLXPlatform"
):
return _IsOpenGLAvailableResult(
f"Qt platform '{qt_qpa_platform}' is not compatible with PyOpenGL platform '{pyopengl_platform}'"
)

keyCache = version, shareOpenGLContexts
if keyCache in _runtimeCheckCache: # Use cache
Expand Down Expand Up @@ -217,10 +221,12 @@ def paintGL(self):
qt.QCoreApplication.setAttribute(qt.Qt.AA_ShareOpenGLContexts)
app = qt.QApplication([])
window = qt.QMainWindow(
flags=qt.Qt.Popup
flags=qt.Qt.Tool
| qt.Qt.FramelessWindowHint
| qt.Qt.NoDropShadowWindowHint
| qt.Qt.WindowStaysOnTopHint
| qt.Qt.WindowTransparentForInput
| qt.Qt.WindowDoesNotAcceptFocus
)
window.setAttribute(qt.Qt.WA_ShowWithoutActivating)
window.move(0, 0)
Expand Down
4 changes: 4 additions & 0 deletions src/silx/io/test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import tempfile
import unittest

import pytest

from .. import utils
from ..._version import calc_hexversion
import silx.io.url
Expand Down Expand Up @@ -1142,6 +1144,8 @@ def test_recursive_match_commonh5():


def test_open_h5pyd(httpserver):
pytest.importorskip("h5pyd")

httpserver.check_assertions()
httpserver.expect_request("/about", query_string=None).respond_with_json({})
httpserver.expect_request("/", query_string=None).respond_with_json(
Expand Down
2 changes: 1 addition & 1 deletion src/silx/math/test/test_combo.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def np_mean_std(img, mask=None, dummy=None, delta_dummy=None):
fimg = img.astype(numpy.float64)
fimg[mask] = numpy.nan
mean = numpy.nanmean(fimg)
std = numpy.nanstd(fimg, mean=mean)
std = numpy.nanstd(fimg)
return mean, std


Expand Down
2 changes: 1 addition & 1 deletion src/silx/utils/test/test_external_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_download_all(self):
filelist = self.resources.getdir(directory)
# download file and remove it to create a json mapping file
os.remove(filename)
directory_path = os.path.commonprefix(filelist)
directory_path = os.path.commonpath(filelist)
# Make sure we will rmtree a dangerous path like "/"
self.assertIn(self.resources.data_home, directory_path)
shutil.rmtree(directory_path)
Expand Down