Compare commits
No commits in common. "88353ffef816c6a38364df1d288f1e3be70b719b" and "3a515afccde730c44f95be1ee12dc80ad61edf1f" have entirely different histories.
88353ffef8
...
3a515afccd
|
|
@ -333,14 +333,7 @@ def i3ipc_xdotool_manual_click_hack() -> None:
|
||||||
|
|
||||||
'''
|
'''
|
||||||
focussed, matches = i3ipc_fin_wins_titled()
|
focussed, matches = i3ipc_fin_wins_titled()
|
||||||
try:
|
orig_win_id = focussed.window
|
||||||
orig_win_id = focussed.window
|
|
||||||
except AttributeError:
|
|
||||||
# XXX if .window cucks we prolly aren't intending to
|
|
||||||
# use this and/or just woke up from suspend..
|
|
||||||
log.exception('xdotool invalid usage ya ??\n')
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for name, con in matches:
|
for name, con in matches:
|
||||||
print(f'Resetting data feed for {name}')
|
print(f'Resetting data feed for {name}')
|
||||||
|
|
|
||||||
|
|
@ -1246,12 +1246,54 @@ async def stream_quotes(
|
||||||
tn.start_soon(reset_on_feed)
|
tn.start_soon(reset_on_feed)
|
||||||
|
|
||||||
async with aclosing(iter_quotes):
|
async with aclosing(iter_quotes):
|
||||||
|
# if syminfo.get('no_vlm', False):
|
||||||
|
if not init_msg.shm_write_opts['has_vlm']:
|
||||||
|
|
||||||
|
# generally speaking these feeds don't
|
||||||
|
# include vlm data.
|
||||||
|
atype: str = mkt.dst.atype
|
||||||
|
log.info(
|
||||||
|
f'No-vlm {mkt.fqme}@{atype}, skipping quote poll'
|
||||||
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
# wait for real volume on feed (trading might be
|
||||||
|
# closed)
|
||||||
|
while True:
|
||||||
|
ticker = await iter_quotes.receive()
|
||||||
|
|
||||||
|
# for a real volume contract we rait for
|
||||||
|
# the first "real" trade to take place
|
||||||
|
if (
|
||||||
|
# not calc_price
|
||||||
|
# and not ticker.rtTime
|
||||||
|
False
|
||||||
|
# not ticker.rtTime
|
||||||
|
):
|
||||||
|
# spin consuming tickers until we
|
||||||
|
# get a real market datum
|
||||||
|
log.debug(f"New unsent ticker: {ticker}")
|
||||||
|
continue
|
||||||
|
|
||||||
|
else:
|
||||||
|
log.debug("Received first volume tick")
|
||||||
|
# ugh, clear ticks since we've
|
||||||
|
# consumed them (ahem, ib_insync is
|
||||||
|
# truly stateful trash)
|
||||||
|
# ticker.ticks = []
|
||||||
|
|
||||||
|
# XXX: this works because we don't use
|
||||||
|
# ``aclosing()`` above?
|
||||||
|
break
|
||||||
|
|
||||||
|
quote = normalize(ticker)
|
||||||
|
log.debug(f"First ticker received {quote}")
|
||||||
|
|
||||||
# tell data-layer spawner-caller that live
|
# tell data-layer spawner-caller that live
|
||||||
# quotes are now active desptie not having
|
# quotes are now active desptie not having
|
||||||
# necessarily received a first vlm/clearing
|
# necessarily received a first vlm/clearing
|
||||||
# tick.
|
# tick.
|
||||||
ticker = await iter_quotes.receive()
|
ticker = await iter_quotes.receive()
|
||||||
quote = normalize(ticker)
|
|
||||||
feed_is_live.set()
|
feed_is_live.set()
|
||||||
fqme: str = quote['fqme']
|
fqme: str = quote['fqme']
|
||||||
await send_chan.send({fqme: quote})
|
await send_chan.send({fqme: quote})
|
||||||
|
|
|
||||||
|
|
@ -520,12 +520,9 @@ def open_shm_array(
|
||||||
|
|
||||||
# "unlink" created shm on process teardown by
|
# "unlink" created shm on process teardown by
|
||||||
# pushing teardown calls onto actor context stack
|
# pushing teardown calls onto actor context stack
|
||||||
stack = tractor.current_actor(
|
stack = tractor.current_actor().lifetime_stack
|
||||||
err_on_no_runtime=False,
|
stack.callback(shmarr.close)
|
||||||
).lifetime_stack
|
stack.callback(shmarr.destroy)
|
||||||
if stack:
|
|
||||||
stack.callback(shmarr.close)
|
|
||||||
stack.callback(shmarr.destroy)
|
|
||||||
|
|
||||||
return shmarr
|
return shmarr
|
||||||
|
|
||||||
|
|
@ -610,10 +607,7 @@ def attach_shm_array(
|
||||||
_known_tokens[key] = token
|
_known_tokens[key] = token
|
||||||
|
|
||||||
# "close" attached shm on actor teardown
|
# "close" attached shm on actor teardown
|
||||||
if (actor := tractor.current_actor(
|
tractor.current_actor().lifetime_stack.callback(sha.close)
|
||||||
err_on_no_runtime=False,
|
|
||||||
)):
|
|
||||||
actor.lifetime_stack.callback(sha.close)
|
|
||||||
|
|
||||||
return sha
|
return sha
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -276,15 +276,7 @@ def get_null_segs(
|
||||||
absi_zdiff: np.ndarray = np.diff(absi_zeros)
|
absi_zdiff: np.ndarray = np.diff(absi_zeros)
|
||||||
|
|
||||||
if zero_t.size < 2:
|
if zero_t.size < 2:
|
||||||
try:
|
breakpoint()
|
||||||
breakpoint()
|
|
||||||
except RuntimeError:
|
|
||||||
# XXX, if greenback not active from
|
|
||||||
# piker store ldshm cmd..
|
|
||||||
log.exception(
|
|
||||||
"Can't debug single-sample null!\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# scan for all frame-indices where the
|
# scan for all frame-indices where the
|
||||||
|
|
|
||||||
|
|
@ -708,16 +708,8 @@ async def start_backfill(
|
||||||
deduped,
|
deduped,
|
||||||
diff,
|
diff,
|
||||||
) = dedupe(df)
|
) = dedupe(df)
|
||||||
if diff:
|
# if diff:
|
||||||
log.warning(
|
# sort_diff(df)
|
||||||
f'Found {diff} duplicates in tsdb, '
|
|
||||||
f'overwriting with deduped data\n'
|
|
||||||
)
|
|
||||||
await storage.write_ohlcv(
|
|
||||||
col_sym_key,
|
|
||||||
deduped,
|
|
||||||
timeframe,
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# finally filled gap
|
# finally filled gap
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue