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

multichartz_backup
Tyler Goodlet 2022-12-03 16:58:26 -05:00
parent 074ef078e8
commit d895684235
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 nd_stop = self.xy_nd_stop = src_stop
align_index = array[self.index_field] 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 # compute the length diffs between the first/last index entry in
# the input data and the last indexes we have on record from the # 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'] high = q['high']
low = q['low'] low = q['low']
close = q['close'] close = q['close']
index = float64(q['time']) index = float64(q['index'])
# XXX: ``numba`` issue: https://github.com/numba/numba/issues/8622 # XXX: ``numba`` issue: https://github.com/numba/numba/issues/8622
# index = float64(q[index_field]) # index = float64(q[index_field])

View File

@ -1036,17 +1036,12 @@ class ChartPlotWidget(pg.PlotWidget):
( (
abs_slc, abs_slc,
read_slc, read_slc,
mask,
) = slice_from_time( ) = slice_from_time(
array, array,
start_t=vtl, start_t=vtl,
stop_t=vtr, stop_t=vtr,
) )
iv_arr = array iv_arr = array[read_slc]
if mask is not None:
iv_arr = array[mask]
index = iv_arr['time'] index = iv_arr['time']
else: else:

View File

@ -291,13 +291,12 @@ class Viz(msgspec.Struct): # , frozen=True):
( (
abs_slc, abs_slc,
read_slc, read_slc,
mask,
) = slice_from_time( ) = slice_from_time(
arr, arr,
start_t=lbar, start_t=lbar,
stop_t=rbar, stop_t=rbar,
) )
slice_view = arr[mask] slice_view = arr[read_slc]
else: else:
ifirst = arr[0]['index'] ifirst = arr[0]['index']
@ -444,7 +443,6 @@ class Viz(msgspec.Struct): # , frozen=True):
( (
abs_slc, abs_slc,
read_slc, read_slc,
mask,
) = slice_from_time( ) = slice_from_time(
array, array,
start_t=lbar, start_t=lbar,