Rename `reset` -> `reset_cache`

epoch_indexing_and_dataviz_layer
Tyler Goodlet 2022-12-19 09:24:14 -05:00
parent ed1f64cf43
commit ffb57f0256
1 changed files with 7 additions and 5 deletions

View File

@ -305,9 +305,8 @@ class Viz(msgspec.Struct): # , frozen=True):
# https://stackoverflow.com/a/29980872 # https://stackoverflow.com/a/29980872
rkey = (round(lbar), round(rbar)) rkey = (round(lbar), round(rbar))
cached_result = self._mxmns.get(rkey) cached_result = self._mxmns.get(rkey)
do_print = False do_print = False # (self.index_step() == 60)
if cached_result: if cached_result:
if do_print: if do_print:
print( print(
f'{self.name} CACHED maxmin\n' f'{self.name} CACHED maxmin\n'
@ -327,6 +326,7 @@ class Viz(msgspec.Struct): # , frozen=True):
arr, arr,
start_t=lbar, start_t=lbar,
stop_t=rbar, stop_t=rbar,
step=self.index_step(),
) )
slice_view = arr[read_slc] slice_view = arr[read_slc]
@ -717,12 +717,14 @@ class Viz(msgspec.Struct): # , frozen=True):
log.warning(f'{self.name} failed to render!?') log.warning(f'{self.name} failed to render!?')
return graphics return graphics
path, reset = out path, reset_cache = out
# XXX: SUPER UGGGHHH... without this we get stale cache # XXX: SUPER UGGGHHH... without this we get stale cache
# graphics that "smear" across the view horizontally # graphics that "smear" across the view horizontally
# when panning and the first datum is out of view.. # when panning and the first datum is out of view..
if reset: if (
reset_cache
):
# assign output paths to graphicis obj but # assign output paths to graphicis obj but
# after a coords-cache reset. # after a coords-cache reset.
with graphics.reset_cache(): with graphics.reset_cache():
@ -736,7 +738,7 @@ class Viz(msgspec.Struct): # , frozen=True):
graphics.draw_last_datum( graphics.draw_last_datum(
path, path,
src_array, src_array,
reset, reset_cache,
array_key, array_key,
index_field=self.index_field, index_field=self.index_field,
) )