From 1f346483a07c0b56ee7c2ef20f50ce443cc245cd Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 22 Dec 2023 12:06:55 -0500 Subject: [PATCH] Always pass full `ShmArray._array` buf to `ContentsLables` updates so the label can be used outside the "backfilled-valid" range --- piker/ui/_cursor.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/piker/ui/_cursor.py b/piker/ui/_cursor.py index c8480524..c14387e0 100644 --- a/piker/ui/_cursor.py +++ b/piker/ui/_cursor.py @@ -272,10 +272,15 @@ class ContentsLabels: x_in: int, ) -> None: - for chart, name, label, update in self._labels: + for ( + chart, + name, + label, + update, + )in self._labels: viz = chart.get_viz(name) - array = viz.shm.array + array: np.ndarray = viz.shm._array index = array[viz.index_field] start = index[0] stop = index[-1] @@ -286,7 +291,7 @@ class ContentsLabels: ): # out of range print('WTF out of range?') - continue + # continue # call provided update func with data point try: @@ -294,6 +299,7 @@ class ContentsLabels: ix = np.searchsorted(index, x_in) if ix > len(array): breakpoint() + update(ix, array) except IndexError: