From 9826ddaa9ab380c348e8c6498e99cfa394fe569d Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 15 Jan 2023 23:15:11 -0500 Subject: [PATCH] Always cache `read_slc` alongside y-mnmx values --- piker/ui/_dataviz.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/piker/ui/_dataviz.py b/piker/ui/_dataviz.py index 82e60837..9786dc10 100644 --- a/piker/ui/_dataviz.py +++ b/piker/ui/_dataviz.py @@ -388,9 +388,11 @@ class Viz(msgspec.Struct): # , frozen=True): f'{self.name} CACHED maxmin\n' f'{ixrng} -> {cached_result}' ) + read_slc, mxmn = cached_result return ( ixrng, - cached_result, + read_slc, + mxmn, ) # get relative slice indexes into array @@ -451,10 +453,11 @@ class Viz(msgspec.Struct): # , frozen=True): # cache result for input range assert mxmn - self._mxmns[ixrng] = mxmn + self._mxmns[ixrng] = (read_slc, mxmn) profiler(f'yrange mxmn cacheing: {x_range} -> {mxmn}') return ( ixrng, + read_slc, mxmn, ) @@ -1026,12 +1029,10 @@ class Viz(msgspec.Struct): # , frozen=True): ) if do_ds: + # view.interaction_graphics_update_cycle() view.maybe_downsample_graphics() view._set_yrange() - # caller should do this! - # self.linked.graphics_cycle() - def incr_info( self, ds: DisplayState,