From 800b0dfa219dae178a840313951a2d4722167761 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Wed, 10 Jun 2026 15:40:21 +0100 Subject: [PATCH 01/12] preview cannot be closed on macos --- Wrappers/Python/ccpi/viewer/ui/dialogs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Wrappers/Python/ccpi/viewer/ui/dialogs.py b/Wrappers/Python/ccpi/viewer/ui/dialogs.py index c5014577..6422abe7 100644 --- a/Wrappers/Python/ccpi/viewer/ui/dialogs.py +++ b/Wrappers/Python/ccpi/viewer/ui/dialogs.py @@ -263,6 +263,7 @@ def preview(self): diag = QtWidgets.QDialog(parent=self) diag.setModal(True) + if dimensionality == 3: if pars['is_fortran'] is True: slicing = 'image' @@ -273,6 +274,10 @@ def preview(self): diag.setWindowTitle(f'Preview Image') diag.setWindowFlag(QtCore.Qt.WindowContextHelpButtonHint, False) diag.setWindowFlag(QtCore.Qt.WindowMaximizeButtonHint) + diag.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, True) + + buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok) + buttonBox.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(diag.close) # add a layout verticalLayout = QtWidgets.QVBoxLayout(diag) verticalLayout.setContentsMargins(10, 10, 10, 10) @@ -283,6 +288,7 @@ def preview(self): # add it to the layout of the dialog verticalLayout.addWidget(sc) + verticalLayout.addWidget(buttonBox) # add the layout to the dialog diag.setLayout(verticalLayout) From 950996930c460c86e58a566093aa107af7227afc Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 20 Aug 2026 21:49:10 +0000 Subject: [PATCH 02/12] Automated autoyapf fixes --- Wrappers/Python/ccpi/viewer/ui/dialogs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wrappers/Python/ccpi/viewer/ui/dialogs.py b/Wrappers/Python/ccpi/viewer/ui/dialogs.py index 6422abe7..d1cad9e6 100644 --- a/Wrappers/Python/ccpi/viewer/ui/dialogs.py +++ b/Wrappers/Python/ccpi/viewer/ui/dialogs.py @@ -275,7 +275,7 @@ def preview(self): diag.setWindowFlag(QtCore.Qt.WindowContextHelpButtonHint, False) diag.setWindowFlag(QtCore.Qt.WindowMaximizeButtonHint) diag.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, True) - + buttonBox = QtWidgets.QDialogButtonBox(QtWidgets.QDialogButtonBox.Ok) buttonBox.button(QtWidgets.QDialogButtonBox.Ok).clicked.connect(diag.close) # add a layout From 63ff55cfc94d38914095e9ec4ea307c2bce2e20a Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 21 Aug 2026 09:23:18 +0100 Subject: [PATCH 03/12] added environment for osx --- .../Python/conda-recipe/environment-osx.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Wrappers/Python/conda-recipe/environment-osx.yml diff --git a/Wrappers/Python/conda-recipe/environment-osx.yml b/Wrappers/Python/conda-recipe/environment-osx.yml new file mode 100644 index 00000000..17d561ac --- /dev/null +++ b/Wrappers/Python/conda-recipe/environment-osx.yml @@ -0,0 +1,18 @@ +name: cilviewer +channels: + - ccpi + - conda-forge +dependencies: + - python + - numpy + - pyside2 + - eqt>=2.0.0 + - importlib_metadata # [py<38] + - h5py + - pillow + - pyyaml + - schema + - pip + - pip: + - --extra-index-url https://wheels.vtk.org + - vtk \ No newline at end of file From 73822666899c302b813d9d8f4451132978396857 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 23 Oct 2026 09:11:27 +0100 Subject: [PATCH 04/12] fixes #492 --- Wrappers/Python/ccpi/viewer/utils/colormaps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Wrappers/Python/ccpi/viewer/utils/colormaps.py b/Wrappers/Python/ccpi/viewer/utils/colormaps.py index 7b8c8944..9f2046c7 100644 --- a/Wrappers/Python/ccpi/viewer/utils/colormaps.py +++ b/Wrappers/Python/ccpi/viewer/utils/colormaps.py @@ -438,11 +438,11 @@ def get_color_map(cmap): if not cmap in _color_map_dict.keys(): try: - from matplotlib import cm + import matplotlib colors = [] for x in range(0, 255): - color = cm.get_cmap(cmap)(x) + color = matplotlib.colormaps[cmap](x) colors.append([color[0], color[1], color[2]]) except ImportError: print("To use colormaps other than: ", From 2896028e9ffd28f19f4ceaef96011632a8e8ff90 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 23 Oct 2026 13:46:20 +0100 Subject: [PATCH 05/12] remove hang on macos updated CHANGELOG --- CHANGELOG.md | 5 +++++ Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d9b0d3b..cfca88eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ New Functionality: - Added toolbar to control the slice and volume render in QCILViewerWidget (#458) - added methods to access the state of the viewer3D (#479) + Enhancements: - Update recipe to require eqt Version 2.0.0 #458 @@ -13,6 +14,10 @@ Enhancements: Dependencies: - removed python pinning (#482) - removed importlib_metadata, required for python <3.8 (#482) + - optional dependency on matplotlib >= 3.9 +Bugfixes: + - removes hang on macos with Qt6 (PySide6) + - bugfix for matplotlib >= 3.9 CI: - Created new action for conda build and publish - no longer uses conda-package-publish-action (#486) diff --git a/Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py b/Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py index 4832ba42..821d73a2 100644 --- a/Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py +++ b/Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py @@ -1,6 +1,7 @@ import vtk from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor from qtpy.QtCore import Qt, QEvent +import platform class QCILRenderWindowInteractor(QVTKRenderWindowInteractor): @@ -21,6 +22,10 @@ def __init__(self, parent=None, **kw): self.__saveButtons = self._QVTKRenderWindowInteractor__saveButtons self.__wheelDelta = self._QVTKRenderWindowInteractor__wheelDelta #print ("__saveModifiers should be defined", self.__saveModifiers) + + # WA_PaintOnScreen makes the first paintEvent hang with Qt6 on macOS + if platform.system() == 'Darwin' and hasattr(Qt.WidgetAttribute, 'WA_PaintOnScreen'): + self.setAttribute(Qt.WidgetAttribute.WA_PaintOnScreen, False) def _GetAlt(self, ev): '''Get ALT key modifier''' From 42aa7605e89f1fcba78de956ab78bd08cdaa7c0b Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 23 Oct 2026 13:38:56 +0000 Subject: [PATCH 06/12] Automated autoyapf fixes --- Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py b/Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py index 821d73a2..4a9b8623 100644 --- a/Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py +++ b/Wrappers/Python/ccpi/viewer/QCILRenderWindowInteractor.py @@ -22,7 +22,7 @@ def __init__(self, parent=None, **kw): self.__saveButtons = self._QVTKRenderWindowInteractor__saveButtons self.__wheelDelta = self._QVTKRenderWindowInteractor__wheelDelta #print ("__saveModifiers should be defined", self.__saveModifiers) - + # WA_PaintOnScreen makes the first paintEvent hang with Qt6 on macOS if platform.system() == 'Darwin' and hasattr(Qt.WidgetAttribute, 'WA_PaintOnScreen'): self.setAttribute(Qt.WidgetAttribute.WA_PaintOnScreen, False) From 745683f4df96986ef6ed7b889a3ccf1279a71672 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 23 Oct 2026 14:42:06 +0100 Subject: [PATCH 07/12] modified changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfca88eb..d0ab92fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,7 @@ New Functionality: - Added toolbar to control the slice and volume render in QCILViewerWidget (#458) - added methods to access the state of the viewer3D (#479) - - + - added buttons to close preview dialog on macos Enhancements: - Update recipe to require eqt Version 2.0.0 #458 - Add a toolbar and settings menus to the 3D viewer #458 From 1e2535536398338d0e7b033a85ace7cba26aebca Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 23 Oct 2026 14:47:09 +0100 Subject: [PATCH 08/12] removed conda-verify in github action --- .github/workflows/conda_build_and_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda_build_and_publish.yml b/.github/workflows/conda_build_and_publish.yml index 9985fbe5..4204a9ce 100644 --- a/.github/workflows/conda_build_and_publish.yml +++ b/.github/workflows/conda_build_and_publish.yml @@ -25,7 +25,7 @@ jobs: channels: conda-forge, ccpi conda-remove-defaults: "true" - - run: conda install conda-build conda-verify + - run: conda install conda-build - name: conda build run: > From 83da69d43f60106a48be89fa14c456396f26ab61 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 23 Oct 2026 14:48:14 +0100 Subject: [PATCH 09/12] use pyside6 in CI/conda tests --- .github/workflows/docker_build_test_publish.yml | 2 +- Wrappers/Python/conda-recipe/environment.yml | 2 +- Wrappers/Python/conda-recipe/meta.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_build_test_publish.yml b/.github/workflows/docker_build_test_publish.yml index 97e25bc1..6cacfb7b 100644 --- a/.github/workflows/docker_build_test_publish.yml +++ b/.github/workflows/docker_build_test_publish.yml @@ -33,5 +33,5 @@ jobs: - name: Run docker container with tests shell: bash -l {0} run: | - docker run --rm --entrypoint /bin/bash -v /home/runner/work/CILViewer/CILViewer:/root/source_code cil-viewer -c "source ./mambaforge/etc/profile.d/conda.sh && conda activate cilviewer_webapp && conda install cil-data pytest pyside2 eqt>=1.0.0 -c ccpi && python -m pytest /root/source_code/Wrappers/Python/test -k 'not test_version and not test_cli_resample and not test_CILViewerBase and not test_CILViewer3D and not test_viewer_main_windows and not test_ui_dialogs and not test_3dtoolbar'" + docker run --rm --entrypoint /bin/bash -v /home/runner/work/CILViewer/CILViewer:/root/source_code cil-viewer -c "source ./mambaforge/etc/profile.d/conda.sh && conda activate cilviewer_webapp && conda install cil-data pytest pyside6 eqt>=2.0.0 -c ccpi && python -m pytest /root/source_code/Wrappers/Python/test -k 'not test_version and not test_cli_resample and not test_CILViewerBase and not test_CILViewer3D and not test_viewer_main_windows and not test_ui_dialogs and not test_3dtoolbar'" # TODO: publish to come later diff --git a/Wrappers/Python/conda-recipe/environment.yml b/Wrappers/Python/conda-recipe/environment.yml index a615d129..c6c642dd 100644 --- a/Wrappers/Python/conda-recipe/environment.yml +++ b/Wrappers/Python/conda-recipe/environment.yml @@ -6,7 +6,7 @@ dependencies: - python - numpy - vtk - - pyside2 + - pyside6 - eqt>=2.0.0 - importlib_metadata # [py<38] - h5py diff --git a/Wrappers/Python/conda-recipe/meta.yaml b/Wrappers/Python/conda-recipe/meta.yaml index aa8e9684..9b2c7016 100644 --- a/Wrappers/Python/conda-recipe/meta.yaml +++ b/Wrappers/Python/conda-recipe/meta.yaml @@ -20,7 +20,7 @@ test: - ccpi::cil-data=22.0.0 - pillow - pytest - - pyside2 + - pyside6 - eqt>=2.0.0 source_files: - ./Wrappers/Python/test From 23bb3ce2f26218ca5ed28ded7843ee132835c760 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 23 Oct 2026 14:59:42 +0100 Subject: [PATCH 10/12] fix test for numpy > 2.2 --- Wrappers/Python/test/test_cropped_readers.py | 2 +- Wrappers/Python/test/test_resample_readers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Wrappers/Python/test/test_cropped_readers.py b/Wrappers/Python/test/test_cropped_readers.py index 135de68a..b7816b89 100644 --- a/Wrappers/Python/test/test_cropped_readers.py +++ b/Wrappers/Python/test/test_cropped_readers.py @@ -16,7 +16,7 @@ def setUp(self): bits = 8 self.input_3D_array = np.random.randint(10, size=shape, dtype=eval(f"np.uint{bits}")) self.input_3D_array = np.reshape(np.arange(self.input_3D_array.size), - newshape=shape).astype(dtype=eval(f"np.uint{bits}")) + shape).astype(dtype=eval(f"np.uint{bits}")) self.raw_type_code = str(self.input_3D_array.dtype) bytes_3D_array = bytes(self.input_3D_array) self.raw_filename_3D = 'test_3D_data.raw' diff --git a/Wrappers/Python/test/test_resample_readers.py b/Wrappers/Python/test/test_resample_readers.py index 52c79d3b..da833419 100644 --- a/Wrappers/Python/test/test_resample_readers.py +++ b/Wrappers/Python/test/test_resample_readers.py @@ -21,7 +21,7 @@ def setUp(self): self.size_greater_than_input_size = 10000 self.input_3D_array = np.random.randint(10, size=shape, dtype=eval(f"np.uint{bits}")) self.input_3D_array = np.reshape(np.arange(self.input_3D_array.size), - newshape=shape).astype(dtype=eval(f"np.uint{bits}")) + shape).astype(dtype=eval(f"np.uint{bits}")) bytes_3D_array = bytes(self.input_3D_array) self.raw_filename_3D = 'test_3D_data.raw' with open(self.raw_filename_3D, 'wb') as f: From 7599b1d2b72bee4fc6733fb60ea8c2f1612f7249 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Fri, 23 Oct 2026 15:35:11 +0100 Subject: [PATCH 11/12] remove environment-osx.yml --- .../Python/conda-recipe/environment-osx.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Wrappers/Python/conda-recipe/environment-osx.yml diff --git a/Wrappers/Python/conda-recipe/environment-osx.yml b/Wrappers/Python/conda-recipe/environment-osx.yml deleted file mode 100644 index 17d561ac..00000000 --- a/Wrappers/Python/conda-recipe/environment-osx.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: cilviewer -channels: - - ccpi - - conda-forge -dependencies: - - python - - numpy - - pyside2 - - eqt>=2.0.0 - - importlib_metadata # [py<38] - - h5py - - pillow - - pyyaml - - schema - - pip - - pip: - - --extra-index-url https://wheels.vtk.org - - vtk \ No newline at end of file From c16af471e890c36b9c2ef1d063633e3a2843c77b Mon Sep 17 00:00:00 2001 From: Edoardo Pasca <14138589+paskino@users.noreply.github.com> Date: Tue, 27 Oct 2026 09:40:29 +0000 Subject: [PATCH 12/12] added to changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ab92fc..09eca4bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## v25.1.0 +## v26.0.0 New Functionality: - Added toolbar to control the slice and volume render in QCILViewerWidget (#458) - added methods to access the state of the viewer3D (#479) @@ -17,6 +17,8 @@ Dependencies: Bugfixes: - removes hang on macos with Qt6 (PySide6) - bugfix for matplotlib >= 3.9 + - bugfix unittests for numpy > 2.2 + - removed conda-verify package in GHA CI: - Created new action for conda build and publish - no longer uses conda-package-publish-action (#486)