From affa5b916e5dc0f00f8e1b2c6e46e935d8e5633b Mon Sep 17 00:00:00 2001 From: Boyd Peters Date: Wed, 8 Apr 2026 11:41:58 +0200 Subject: [PATCH 1/2] fix: always insert "p" at the front of the axis order when no position is provided --- src/pymmcore_widgets/mda/_core_mda.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pymmcore_widgets/mda/_core_mda.py b/src/pymmcore_widgets/mda/_core_mda.py index 885ba4ec7..f0dd15699 100644 --- a/src/pymmcore_widgets/mda/_core_mda.py +++ b/src/pymmcore_widgets/mda/_core_mda.py @@ -199,11 +199,8 @@ def value(self) -> MDASequence: # not be in the event if "p" not in val.axis_order: axis_order = list(val.axis_order) - # add the "p" axis at the beginning or after the "t" as the default - if "t" in axis_order: - axis_order.insert(axis_order.index("t") + 1, "p") - else: - axis_order.insert(0, "p") + # Always insert "p" at the front + axis_order.insert(0, "p") replace["axis_order"] = tuple(axis_order) if replace: From bcbdad5f8dad5721d2b1e831caf474524679b78a Mon Sep 17 00:00:00 2001 From: Boyd Peters Date: Wed, 8 Apr 2026 11:42:33 +0200 Subject: [PATCH 2/2] test: update test to check whether "p" is the first if no position is provided --- tests/test_useq_core_widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_useq_core_widgets.py b/tests/test_useq_core_widgets.py index f14f3a467..8829762d7 100644 --- a/tests/test_useq_core_widgets.py +++ b/tests/test_useq_core_widgets.py @@ -570,7 +570,7 @@ def test_mda_no_pos_set(global_mmcore: CMMCorePlus, qtbot: QtBot): assert round(wdg.value().stage_positions[0].y) == 20 assert round(wdg.value().stage_positions[0].z) == 30 - assert "p" in wdg.value().axis_order + assert wdg.value().axis_order[0] == "p" @pytest.mark.parametrize("ext", ["json", "yaml"])