From 12857a258bbd855a30ed51c6414ca435ad82ed8c Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 3 Dec 2022 16:58:26 -0500 Subject: [PATCH] Adjust all `slice_from_time()` calls to not expect mask --- piker/data/_formatters.py | 6 +++++- piker/data/_pathops.py | 2 +- piker/ui/_chart.py | 7 +------ piker/ui/_render.py | 4 +--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/piker/data/_formatters.py b/piker/data/_formatters.py index 5d1d436b..7ffe8872 100644 --- a/piker/data/_formatters.py +++ b/piker/data/_formatters.py @@ -183,7 +183,11 @@ class IncrementalFormatter(msgspec.Struct): nd_stop = self.xy_nd_stop = src_stop align_index = array[self.index_field] - self._index_step_size = align_index[-1] - align_index[-2] + self._index_step_size = ( + align_index[-1] + - + align_index[-2] + ) # compute the length diffs between the first/last index entry in # the input data and the last indexes we have on record from the diff --git a/piker/data/_pathops.py b/piker/data/_pathops.py index 3e4c7834..a489dcc3 100644 --- a/piker/data/_pathops.py +++ b/piker/data/_pathops.py @@ -126,7 +126,7 @@ def path_arrays_from_ohlc( high = q['high'] low = q['low'] close = q['close'] - index = float64(q['time']) + index = float64(q['index']) # XXX: ``numba`` issue: https://github.com/numba/numba/issues/8622 # index = float64(q[index_field]) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index 3e661e51..b7be583f 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -1036,17 +1036,12 @@ class ChartPlotWidget(pg.PlotWidget): ( abs_slc, read_slc, - mask, - ) = slice_from_time( array, start_t=vtl, stop_t=vtr, ) - iv_arr = array - if mask is not None: - iv_arr = array[mask] - + iv_arr = array[read_slc] index = iv_arr['time'] else: diff --git a/piker/ui/_render.py b/piker/ui/_render.py index 9fb1592e..4383cd00 100644 --- a/piker/ui/_render.py +++ b/piker/ui/_render.py @@ -291,13 +291,12 @@ class Viz(msgspec.Struct): # , frozen=True): ( abs_slc, read_slc, - mask, ) = slice_from_time( arr, start_t=lbar, stop_t=rbar, ) - slice_view = arr[mask] + slice_view = arr[read_slc] else: ifirst = arr[0]['index'] @@ -444,7 +443,6 @@ class Viz(msgspec.Struct): # , frozen=True): ( abs_slc, read_slc, - mask, ) = slice_from_time( array, start_t=lbar,