Don't `@lru_cache` on `Viz.i_from_t()`, since view state..
parent
05aee4a311
commit
4bb580ae60
piker/ui
|
@ -1372,18 +1372,30 @@ class Viz(Struct):
|
||||||
case 'both':
|
case 'both':
|
||||||
return r_up, r_down
|
return r_up, r_down
|
||||||
|
|
||||||
@lru_cache(maxsize=6116)
|
# @lru_cache(maxsize=6116)
|
||||||
def i_from_t(
|
def i_from_t(
|
||||||
self,
|
self,
|
||||||
t: float,
|
t: float,
|
||||||
) -> int:
|
return_y: bool = False,
|
||||||
return slice_from_time(
|
|
||||||
|
) -> int | tuple[int, float]:
|
||||||
|
|
||||||
|
istart = slice_from_time(
|
||||||
self.vs.in_view,
|
self.vs.in_view,
|
||||||
start_t=t,
|
start_t=t,
|
||||||
stop_t=t,
|
stop_t=t,
|
||||||
step=self.index_step(),
|
step=self.index_step(),
|
||||||
).start
|
).start
|
||||||
|
|
||||||
|
if not return_y:
|
||||||
|
return istart
|
||||||
|
|
||||||
|
vs = self.vs
|
||||||
|
arr = vs.in_view
|
||||||
|
key = 'open' if self.is_ohlc else self.name
|
||||||
|
yref = arr[istart][key]
|
||||||
|
return istart, yref
|
||||||
|
|
||||||
def scalars_from_index(
|
def scalars_from_index(
|
||||||
self,
|
self,
|
||||||
xref: float | None = None,
|
xref: float | None = None,
|
||||||
|
|
Loading…
Reference in New Issue