Adjust all `slice_from_time()` calls to not expect mask

multichartz
Tyler Goodlet 2022-12-03 16:58:26 -05:00
parent 12307e5757
commit 02cef3ed6d
4 changed files with 8 additions and 11 deletions

View File

@ -182,7 +182,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

View File

@ -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])

View File

@ -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:

View File

@ -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,