Skip to content

Check coords are identical in slicing dimension in instrument view#704

Merged
nvaytet merged 4 commits into
mainfrom
check-coords-instrument-view
May 22, 2026
Merged

Check coords are identical in slicing dimension in instrument view#704
nvaytet merged 4 commits into
mainfrom
check-coords-instrument-view

Conversation

@nvaytet
Copy link
Copy Markdown
Member

@nvaytet nvaytet commented May 22, 2026

If you passed dg.hist(tof=100) to the instrument_view, the different data arrays would have different tof coords, and the view would fail with a very strange error:

File ~/development/venv4essdiffraction/.venv_scipp_may26a/lib/python3.14/site-packages/plopp/widgets/slicing.py:155, in <genexpr>(.0)
    153 new = [min(max(x, self.min), self.max) for x in change["new"]]
    154 self._lock = True
--> 155 self._widget.value = " : ".join(f"{self._coord[x]:{self._fmt}}" for x in new)
    156 self._lock = False

TypeError: unsupported format string passed to numpy.ndarray.__format__

We add a safety net to catch this before we attempt to make the plot.

@celinedurniak

@nvaytet nvaytet merged commit 4d0b8a6 into main May 22, 2026
5 checks passed
@nvaytet nvaytet deleted the check-coords-instrument-view branch May 22, 2026 12:21
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