From 100be54641970e1f3a6b8d38cd87fb79978fb971 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 31 Jul 2023 17:21:11 -0400 Subject: [PATCH] data.history: add TODO for non-zero epochs and some typing --- piker/data/history.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/piker/data/history.py b/piker/data/history.py index 0b4f3bf9..997a902c 100644 --- a/piker/data/history.py +++ b/piker/data/history.py @@ -644,6 +644,10 @@ async def tsdb_backfill( task_status.started() return + # TODO: fill in non-zero epoch time values ALWAYS! + # hist_shm._array['time'] = np.arange( + # start= + # NOTE: removed for now since it'll always break # on the first 60s of the venue open.. # times: np.ndarray = array['time'] @@ -755,7 +759,6 @@ async def tsdb_backfill( ) ) - # if len(hist_shm.array) < 2: # TODO: there's an edge case here to solve where if the last # frame before market close (at least on ib) was pushed and @@ -774,7 +777,7 @@ async def tsdb_backfill( finally: return - # IF we need to continue backloading incrementall from the + # IF we need to continue backloading incrementally from the # tsdb client.. tn.start_soon( back_load_from_tsdb, @@ -836,10 +839,9 @@ async def manage_history( # from tractor._state import _runtime_vars # port = _runtime_vars['_root_mailbox'][1] - uid = tractor.current_actor().uid + uid: tuple = tractor.current_actor().uid name, uuid = uid - service = name.rstrip(f'.{mod.name}') - + service: str = name.rstrip(f'.{mod.name}') fqme: str = mkt.get_fqme(delim_char='') # (maybe) allocate shm array for this broker/symbol which will @@ -878,8 +880,8 @@ async def manage_history( # (for now) set the rt (hft) shm array with space to prepend # only a few days worth of 1s history. - days = 2 - start_index = days*_secs_in_day + days: int = 2 + start_index: int = days*_secs_in_day rt_shm._first.value = start_index rt_shm._last.value = start_index rt_zero_index = rt_shm.index - 1 @@ -892,7 +894,6 @@ async def manage_history( open_history_client = getattr( mod, 'open_history_client', - None, ) assert open_history_client