From ae68befe5405ba9057a74f9287e922a2f828470e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:30:22 +0000 Subject: [PATCH 01/12] chore: bump the actions group with 2 updates Bumps the actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/upload-artifact` from 5 to 6 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v5...v6) Updates `actions/download-artifact` from 6 to 7 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] --- .github/workflows/_dist.yml | 2 +- .github/workflows/_docs.yml | 2 +- .github/workflows/_release.yml | 2 +- .github/workflows/_test.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_dist.yml b/.github/workflows/_dist.yml index 6f59996..a6e9f68 100644 --- a/.github/workflows/_dist.yml +++ b/.github/workflows/_dist.yml @@ -18,7 +18,7 @@ jobs: pipx run build - name: Upload sdist and wheel as artifacts - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: dist path: dist diff --git a/.github/workflows/_docs.yml b/.github/workflows/_docs.yml index 7885921..2b83997 100644 --- a/.github/workflows/_docs.yml +++ b/.github/workflows/_docs.yml @@ -30,7 +30,7 @@ jobs: run: rm build/html/.doctrees/environment.pickle - name: Upload built docs artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: docs path: build diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 5801673..f9ca831 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Download artifacts - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: merge-multiple: true diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 1576ffb..32476d5 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -38,7 +38,7 @@ jobs: - if: inputs.python-version == 'dev' name: Upload dev-requirements.txt - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: dev-requirements path: /tmp/dev-requirements.txt From d9665d91bf56239a1ad6c9ba51b703f573925d00 Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Mon, 9 Mar 2026 16:47:28 +0000 Subject: [PATCH 02/12] Added dropdown, need tests --- src/i19serial_ui/gui/serial_gui_eh2.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/i19serial_ui/gui/serial_gui_eh2.py b/src/i19serial_ui/gui/serial_gui_eh2.py index ae8e52a..25151a4 100644 --- a/src/i19serial_ui/gui/serial_gui_eh2.py +++ b/src/i19serial_ui/gui/serial_gui_eh2.py @@ -126,9 +126,22 @@ def _setup_title(self): self.i19_label.setFont(QtGui.QFont(FONT, 13)) self.i19_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + def _create_dropdown(self): + # Add labels, do tests. + self.aperturedropdown = QtWidgets.QComboBox() + self.aperturedropdown.addItems(["20um", "40um", "100um", "3000um"]) + # self.aperturedropdown.move(10, 10) + + def read_aperture_dropdown(self): + return self.aperturedropdown.currentText() + def _create_top_group(self): # move arrows, phi step, focuse, backlight etc + self._create_dropdown() self.top_group = QtWidgets.QGroupBox() + top_layout = QtWidgets.QHBoxLayout() + top_layout.addWidget(self.aperturedropdown) + self.top_group.setLayout(top_layout) def _create_coordinate_system_group(self): self.cs_group = QtWidgets.QGroupBox("Coordinate System") From 7396826c0aa9aee00c041ecb8946611f90b0325a Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Tue, 10 Mar 2026 12:23:22 +0000 Subject: [PATCH 03/12] Added unit testing of GUI and labels to drop-down box --- src/i19serial_ui/gui/serial_gui_eh2.py | 5 ++++- tests/gui/test_eh2_ui.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/i19serial_ui/gui/serial_gui_eh2.py b/src/i19serial_ui/gui/serial_gui_eh2.py index 25151a4..e8225b1 100644 --- a/src/i19serial_ui/gui/serial_gui_eh2.py +++ b/src/i19serial_ui/gui/serial_gui_eh2.py @@ -130,7 +130,6 @@ def _create_dropdown(self): # Add labels, do tests. self.aperturedropdown = QtWidgets.QComboBox() self.aperturedropdown.addItems(["20um", "40um", "100um", "3000um"]) - # self.aperturedropdown.move(10, 10) def read_aperture_dropdown(self): return self.aperturedropdown.currentText() @@ -140,6 +139,10 @@ def _create_top_group(self): self._create_dropdown() self.top_group = QtWidgets.QGroupBox() top_layout = QtWidgets.QHBoxLayout() + self.ddb_label = QtWidgets.QLabel("Select aperture size:") + self.ddb_label.setFont(QtGui.QFont(FONT, 10)) + self.ddb_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + top_layout.addWidget(self.ddb_label) top_layout.addWidget(self.aperturedropdown) self.top_group.setLayout(top_layout) diff --git a/tests/gui/test_eh2_ui.py b/tests/gui/test_eh2_ui.py index 1c288cb..93ee4cf 100644 --- a/tests/gui/test_eh2_ui.py +++ b/tests/gui/test_eh2_ui.py @@ -29,6 +29,9 @@ def test_all_widgets_initialised(mock_eh2_gui): assert mock_eh2_gui.inputs and isinstance(mock_eh2_gui.inputs, InputPanel) assert mock_eh2_gui.wells and isinstance(mock_eh2_gui.wells, WellsSelectionPanel) assert mock_eh2_gui.grid and isinstance(mock_eh2_gui.grid, GridOptions) + assert mock_eh2_gui.aperturedropdown and isinstance( + mock_eh2_gui.aperturedropdown, QtWidgets.QComboBox + ) def test_general_layout(mock_eh2_gui): @@ -36,6 +39,17 @@ def test_general_layout(mock_eh2_gui): assert isinstance(mock_eh2_gui.general_layout, QtWidgets.QGridLayout) title = mock_eh2_gui.general_layout.children()[0] assert isinstance(title, QtWidgets.QHBoxLayout) + assert isinstance(mock_eh2_gui.top_group, QtWidgets.QGroupBox) + + +def test_dropdown_update(mock_eh2_gui): + options = ["20um", "40um", "100um", "3000um"] + for x in range(0, 3): + mock_eh2_gui.aperturedropdown.setCurrentIndex(x) + assert mock_eh2_gui.aperturedropdown.currentText() == options[x] + + +# def test_top_layout(mock_eh2_gui): def test_select_visit(mock_eh2_gui): From 9269ce219d06c2a2285be3bac90096156e82dcdf Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Tue, 10 Mar 2026 12:27:08 +0000 Subject: [PATCH 04/12] Added unit testing of GUI and labels to drop-down box, altered one unit test --- tests/gui/test_eh2_ui.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/gui/test_eh2_ui.py b/tests/gui/test_eh2_ui.py index 93ee4cf..37895f4 100644 --- a/tests/gui/test_eh2_ui.py +++ b/tests/gui/test_eh2_ui.py @@ -46,10 +46,7 @@ def test_dropdown_update(mock_eh2_gui): options = ["20um", "40um", "100um", "3000um"] for x in range(0, 3): mock_eh2_gui.aperturedropdown.setCurrentIndex(x) - assert mock_eh2_gui.aperturedropdown.currentText() == options[x] - - -# def test_top_layout(mock_eh2_gui): + assert mock_eh2_gui.read_aperture_dropdown() == options[x] def test_select_visit(mock_eh2_gui): From 6d3f266c980823719d22e14aab844dbeaeeb752b Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Tue, 10 Mar 2026 13:49:03 +0000 Subject: [PATCH 05/12] Fix flaky test --- tests/gui/test_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/gui/test_utils.py b/tests/gui/test_utils.py index c107072..72af089 100644 --- a/tests/gui/test_utils.py +++ b/tests/gui/test_utils.py @@ -1,3 +1,4 @@ +from datetime import datetime from pathlib import Path import pytest @@ -19,9 +20,10 @@ def test_create_icon(): def test_get_data_main_path(): + year = datetime.now().year res = get_data_main_path() - assert res.as_posix() == "/dls/i19-2/data/2025" + assert res.as_posix() == f"/dls/i19-2/data/{year}" def test_get_config_file_path_for_eh2(): From 5128d66a0c46700c4cdc87cc29de9c72d8d044c3 Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Mon, 9 Mar 2026 16:47:28 +0000 Subject: [PATCH 06/12] Added dropdown, need tests --- src/i19serial_ui/gui/serial_gui_eh2.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/i19serial_ui/gui/serial_gui_eh2.py b/src/i19serial_ui/gui/serial_gui_eh2.py index ae8e52a..25151a4 100644 --- a/src/i19serial_ui/gui/serial_gui_eh2.py +++ b/src/i19serial_ui/gui/serial_gui_eh2.py @@ -126,9 +126,22 @@ def _setup_title(self): self.i19_label.setFont(QtGui.QFont(FONT, 13)) self.i19_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + def _create_dropdown(self): + # Add labels, do tests. + self.aperturedropdown = QtWidgets.QComboBox() + self.aperturedropdown.addItems(["20um", "40um", "100um", "3000um"]) + # self.aperturedropdown.move(10, 10) + + def read_aperture_dropdown(self): + return self.aperturedropdown.currentText() + def _create_top_group(self): # move arrows, phi step, focuse, backlight etc + self._create_dropdown() self.top_group = QtWidgets.QGroupBox() + top_layout = QtWidgets.QHBoxLayout() + top_layout.addWidget(self.aperturedropdown) + self.top_group.setLayout(top_layout) def _create_coordinate_system_group(self): self.cs_group = QtWidgets.QGroupBox("Coordinate System") From b4ccf2c9d8d22e3b89ff6e250de21e7da2720c4f Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Tue, 10 Mar 2026 12:23:22 +0000 Subject: [PATCH 07/12] Added unit testing of GUI and labels to drop-down box --- src/i19serial_ui/gui/serial_gui_eh2.py | 5 ++++- tests/gui/test_eh2_ui.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/i19serial_ui/gui/serial_gui_eh2.py b/src/i19serial_ui/gui/serial_gui_eh2.py index 25151a4..e8225b1 100644 --- a/src/i19serial_ui/gui/serial_gui_eh2.py +++ b/src/i19serial_ui/gui/serial_gui_eh2.py @@ -130,7 +130,6 @@ def _create_dropdown(self): # Add labels, do tests. self.aperturedropdown = QtWidgets.QComboBox() self.aperturedropdown.addItems(["20um", "40um", "100um", "3000um"]) - # self.aperturedropdown.move(10, 10) def read_aperture_dropdown(self): return self.aperturedropdown.currentText() @@ -140,6 +139,10 @@ def _create_top_group(self): self._create_dropdown() self.top_group = QtWidgets.QGroupBox() top_layout = QtWidgets.QHBoxLayout() + self.ddb_label = QtWidgets.QLabel("Select aperture size:") + self.ddb_label.setFont(QtGui.QFont(FONT, 10)) + self.ddb_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + top_layout.addWidget(self.ddb_label) top_layout.addWidget(self.aperturedropdown) self.top_group.setLayout(top_layout) diff --git a/tests/gui/test_eh2_ui.py b/tests/gui/test_eh2_ui.py index 1c288cb..93ee4cf 100644 --- a/tests/gui/test_eh2_ui.py +++ b/tests/gui/test_eh2_ui.py @@ -29,6 +29,9 @@ def test_all_widgets_initialised(mock_eh2_gui): assert mock_eh2_gui.inputs and isinstance(mock_eh2_gui.inputs, InputPanel) assert mock_eh2_gui.wells and isinstance(mock_eh2_gui.wells, WellsSelectionPanel) assert mock_eh2_gui.grid and isinstance(mock_eh2_gui.grid, GridOptions) + assert mock_eh2_gui.aperturedropdown and isinstance( + mock_eh2_gui.aperturedropdown, QtWidgets.QComboBox + ) def test_general_layout(mock_eh2_gui): @@ -36,6 +39,17 @@ def test_general_layout(mock_eh2_gui): assert isinstance(mock_eh2_gui.general_layout, QtWidgets.QGridLayout) title = mock_eh2_gui.general_layout.children()[0] assert isinstance(title, QtWidgets.QHBoxLayout) + assert isinstance(mock_eh2_gui.top_group, QtWidgets.QGroupBox) + + +def test_dropdown_update(mock_eh2_gui): + options = ["20um", "40um", "100um", "3000um"] + for x in range(0, 3): + mock_eh2_gui.aperturedropdown.setCurrentIndex(x) + assert mock_eh2_gui.aperturedropdown.currentText() == options[x] + + +# def test_top_layout(mock_eh2_gui): def test_select_visit(mock_eh2_gui): From ec8d5c607140bbc2c866d5c2a9af4bb066ae2a99 Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Tue, 10 Mar 2026 12:27:08 +0000 Subject: [PATCH 08/12] Added unit testing of GUI and labels to drop-down box, altered one unit test --- tests/gui/test_eh2_ui.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/gui/test_eh2_ui.py b/tests/gui/test_eh2_ui.py index 93ee4cf..37895f4 100644 --- a/tests/gui/test_eh2_ui.py +++ b/tests/gui/test_eh2_ui.py @@ -46,10 +46,7 @@ def test_dropdown_update(mock_eh2_gui): options = ["20um", "40um", "100um", "3000um"] for x in range(0, 3): mock_eh2_gui.aperturedropdown.setCurrentIndex(x) - assert mock_eh2_gui.aperturedropdown.currentText() == options[x] - - -# def test_top_layout(mock_eh2_gui): + assert mock_eh2_gui.read_aperture_dropdown() == options[x] def test_select_visit(mock_eh2_gui): From 7fdc4f93d8fdb18c0d8cf8bd9434b4f820f1a631 Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Tue, 10 Mar 2026 16:11:55 +0000 Subject: [PATCH 09/12] Edited post pull. --- src/i19serial_ui/gui/serial_gui_eh2.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/i19serial_ui/gui/serial_gui_eh2.py b/src/i19serial_ui/gui/serial_gui_eh2.py index e8225b1..faa5ced 100644 --- a/src/i19serial_ui/gui/serial_gui_eh2.py +++ b/src/i19serial_ui/gui/serial_gui_eh2.py @@ -127,7 +127,6 @@ def _setup_title(self): self.i19_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) def _create_dropdown(self): - # Add labels, do tests. self.aperturedropdown = QtWidgets.QComboBox() self.aperturedropdown.addItems(["20um", "40um", "100um", "3000um"]) From f8333cb4b52834d8410babace5f83b45bf3fb896 Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Wed, 11 Mar 2026 15:26:18 +0000 Subject: [PATCH 10/12] changed layout of top box, saved choice as variable, moved aperture size into general_utils file --- src/i19serial_ui/gui/serial_gui_eh2.py | 11 ++++++++--- src/i19serial_ui/parameters/general_utils.py | 8 ++++++++ tests/gui/test_eh2_ui.py | 11 ++++++----- 3 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 src/i19serial_ui/parameters/general_utils.py diff --git a/src/i19serial_ui/gui/serial_gui_eh2.py b/src/i19serial_ui/gui/serial_gui_eh2.py index faa5ced..2bcb777 100644 --- a/src/i19serial_ui/gui/serial_gui_eh2.py +++ b/src/i19serial_ui/gui/serial_gui_eh2.py @@ -23,6 +23,7 @@ log_to_gui, tidy_up_logging, ) +from i19serial_ui.parameters.general_utils import ApertureOptions WINDOW_SIZE = (600, 1200) LOG_HANDLERS = [] @@ -128,7 +129,8 @@ def _setup_title(self): def _create_dropdown(self): self.aperturedropdown = QtWidgets.QComboBox() - self.aperturedropdown.addItems(["20um", "40um", "100um", "3000um"]) + self.aperturedropdown.addItems(list(ApertureOptions)) + self.selected_aperture = self.read_aperture_dropdown() def read_aperture_dropdown(self): return self.aperturedropdown.currentText() @@ -137,13 +139,15 @@ def _create_top_group(self): # move arrows, phi step, focuse, backlight etc self._create_dropdown() self.top_group = QtWidgets.QGroupBox() - top_layout = QtWidgets.QHBoxLayout() + top_layout = QtWidgets.QGridLayout() self.ddb_label = QtWidgets.QLabel("Select aperture size:") self.ddb_label.setFont(QtGui.QFont(FONT, 10)) - self.ddb_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) + self.ddb_label.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft) top_layout.addWidget(self.ddb_label) top_layout.addWidget(self.aperturedropdown) self.top_group.setLayout(top_layout) + self.aperturedropdown.setFixedWidth(150) + top_layout.setColumnStretch(2, 1) def _create_coordinate_system_group(self): self.cs_group = QtWidgets.QGroupBox("Coordinate System") @@ -248,6 +252,7 @@ def run_panda(self): num_images = float(self.inputs.num_images.text()) rotation_increment = float(self.inputs.image_width.text()) rotation_end = rotation_start + num_images + rotation_increment + params = { "phi_start": rotation_start, "phi_end": rotation_end, diff --git a/src/i19serial_ui/parameters/general_utils.py b/src/i19serial_ui/parameters/general_utils.py new file mode 100644 index 0000000..ea4b3ad --- /dev/null +++ b/src/i19serial_ui/parameters/general_utils.py @@ -0,0 +1,8 @@ +from enum import StrEnum + + +class ApertureOptions(StrEnum): + um_20 = "20um" + um_40 = "40um" + um_100 = "100um" + um_3000 = "3000um" diff --git a/tests/gui/test_eh2_ui.py b/tests/gui/test_eh2_ui.py index 37895f4..eb4f17e 100644 --- a/tests/gui/test_eh2_ui.py +++ b/tests/gui/test_eh2_ui.py @@ -42,11 +42,12 @@ def test_general_layout(mock_eh2_gui): assert isinstance(mock_eh2_gui.top_group, QtWidgets.QGroupBox) -def test_dropdown_update(mock_eh2_gui): - options = ["20um", "40um", "100um", "3000um"] - for x in range(0, 3): - mock_eh2_gui.aperturedropdown.setCurrentIndex(x) - assert mock_eh2_gui.read_aperture_dropdown() == options[x] +@pytest.mark.parametrize( + "options,index", [("20um", 0), ("40um", 1), ("100um", 2), ("3000um", 3)] +) +def test_dropdown_update(mock_eh2_gui, options, index): + mock_eh2_gui.aperturedropdown.setCurrentIndex(index) + assert mock_eh2_gui.read_aperture_dropdown() == options def test_select_visit(mock_eh2_gui): From ab31f5db77cdaf12d85fc7832c82aaf48526c9b4 Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Thu, 12 Mar 2026 14:51:09 +0000 Subject: [PATCH 11/12] Altering remaining code according to comments --- src/i19serial_ui/parameters/general_utils.py | 8 ++++---- tests/gui/test_eh2_ui.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/i19serial_ui/parameters/general_utils.py b/src/i19serial_ui/parameters/general_utils.py index ea4b3ad..ea96d92 100644 --- a/src/i19serial_ui/parameters/general_utils.py +++ b/src/i19serial_ui/parameters/general_utils.py @@ -2,7 +2,7 @@ class ApertureOptions(StrEnum): - um_20 = "20um" - um_40 = "40um" - um_100 = "100um" - um_3000 = "3000um" + UM_20 = "20um" + UM_40 = "40um" + UM_100 = "100um" + UM_3000 = "3000um" diff --git a/tests/gui/test_eh2_ui.py b/tests/gui/test_eh2_ui.py index eb4f17e..e6ce1d1 100644 --- a/tests/gui/test_eh2_ui.py +++ b/tests/gui/test_eh2_ui.py @@ -43,7 +43,7 @@ def test_general_layout(mock_eh2_gui): @pytest.mark.parametrize( - "options,index", [("20um", 0), ("40um", 1), ("100um", 2), ("3000um", 3)] + "aperture,index", [("20um", 0), ("40um", 1), ("100um", 2), ("3000um", 3)] ) def test_dropdown_update(mock_eh2_gui, options, index): mock_eh2_gui.aperturedropdown.setCurrentIndex(index) From 416abdaf255d9bfdddf7cbe0abfe05266ecbb81e Mon Sep 17 00:00:00 2001 From: Matthew Carre Date: Thu, 12 Mar 2026 14:55:49 +0000 Subject: [PATCH 12/12] Altering remaining code according to comments - remembering to alter variable names properly --- tests/gui/test_eh2_ui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/gui/test_eh2_ui.py b/tests/gui/test_eh2_ui.py index e6ce1d1..4e7574a 100644 --- a/tests/gui/test_eh2_ui.py +++ b/tests/gui/test_eh2_ui.py @@ -45,9 +45,9 @@ def test_general_layout(mock_eh2_gui): @pytest.mark.parametrize( "aperture,index", [("20um", 0), ("40um", 1), ("100um", 2), ("3000um", 3)] ) -def test_dropdown_update(mock_eh2_gui, options, index): +def test_dropdown_update(mock_eh2_gui, aperture, index): mock_eh2_gui.aperturedropdown.setCurrentIndex(index) - assert mock_eh2_gui.read_aperture_dropdown() == options + assert mock_eh2_gui.read_aperture_dropdown() == aperture def test_select_visit(mock_eh2_gui):