Skip to content

Two small independent fixes - #123

Merged
pecomyint merged 2 commits into
mainfrom
dev-peco
Jul 27, 2026
Merged

Two small independent fixes#123
pecomyint merged 2 commits into
mainfrom
dev-peco

Conversation

@pecomyint

Copy link
Copy Markdown
Collaborator

Primary-objective combo doesn't refresh on role changes

The Bayesian viewer's Primary-objective combo refreshed on add/remove/rename but
not when a row's Role changed (the role is a QComboBox cell-widget whose
changes were never wired up). Flipping an objective maximize→observe wrongly left
it in the Primary list.

  • _ObjectiveTable now has an objectives_changed signal, emitted on any change
    to the optimized set (cell edits, add, remove, role/protocol combo changes).
    Rows are built under blockSignals so a half-built row can't fire a refresh.
  • The viewer replaces its three ad-hoc connects with a single
    objectives_changed → _refresh_primary_combo.
  • New headless regression test (tests/unit/test_bayesian_primary_combo.py).

Mask load: lossless transpose instead of downsampling resize

Loading a mask whose dimensions are simply swapped vs the detector (e.g. 100×400
on a 400×100 detector) only warned, then resampled it through skimage resize,
arriving badly downsampled.

  • load_mask_clicked now detects the pure axes-swap case
    (mask.shape == img_shape[::-1]) and offers a lossless transpose that matches
    the detector at native resolution. Any other mismatch keeps the original
    warn + resize behavior.

@pecomyint
pecomyint requested a review from Osayi-ANL July 24, 2026 19:56

@Osayi-ANL Osayi-ANL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice

@pecomyint
pecomyint merged commit 2118c83 into main Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants