From 35a16ded2d23ca34ac35a90f2e4ee0638ab886eb Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 7 Dec 2022 19:59:27 -0500 Subject: [PATCH] Block out `do_print` stuff inside `Viz.maxmin()` --- piker/ui/_render.py | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/piker/ui/_render.py b/piker/ui/_render.py index 852844f9..04a15890 100644 --- a/piker/ui/_render.py +++ b/piker/ui/_render.py @@ -289,29 +289,21 @@ class Viz(msgspec.Struct): # , frozen=True): # https://stackoverflow.com/a/29980872 rkey = (round(lbar), round(rbar)) cached_result = self._mxmns.get(rkey) - do_print = 'btc' in self.name + do_print = False if cached_result: - # if do_print: - # print( - # f'{self.name} CACHED maxmin\n' - # f'{rkey} -> {cached_result}' - # ) + if do_print: + print( + f'{self.name} CACHED maxmin\n' + f'{rkey} -> {cached_result}' + ) return cached_result shm = self.shm if shm is None: - breakpoint() return None arr = shm.array - # times = arr['time'] - # step = round(times[-1] - times[-2]) - # if ( - # do_print - # and step == 60 - # ): - # breakpoint() # get relative slice indexes into array if self.index_field == 'time': @@ -331,7 +323,6 @@ class Viz(msgspec.Struct): # , frozen=True): if not slice_view.size: log.warning(f'{self.name} no maxmin in view?') - # breakpoint() return None elif self.yrange: @@ -353,10 +344,18 @@ class Viz(msgspec.Struct): # , frozen=True): yhigh = np.max(view) mxmn = ylow, yhigh - if do_print: + if ( + do_print + # and self.index_step() > 1 + ): + s = 3 print( f'{self.name} MANUAL ohlc={self.is_ohlc} maxmin:\n' - f'{rkey} -> {mxmn}' + f'{rkey} -> {mxmn}\n' + f'read_slc: {read_slc}\n' + f'abs_slc: {slice_view["index"]}\n' + f'first {s}:\n{slice_view[:s]}\n' + f'last {s}:\n{slice_view[-s:]}\n' ) # cache result for input range