Use `import <name> as <name>,` in `.tsp`

Thanks to oremanj in the `trio` room for this hot style tip which i much
prefer to have less LOC and places to change sub-pkg name exports!

Also drop expecting a `gaps` frame output from `dedupe()`.
distribute_dis
Tyler Goodlet 2023-12-28 10:58:22 -05:00
parent 5702e422d8
commit 59536bd284
1 changed files with 15 additions and 38 deletions

View File

@ -67,50 +67,28 @@ from ..data._sampling import (
) )
from ._anal import ( from ._anal import (
get_null_segs, get_null_segs as get_null_segs,
iter_null_segs, iter_null_segs as iter_null_segs,
Frame, Frame as Frame,
Seq, Seq as Seq,
# codec-ish # codec-ish
np2pl, np2pl as np2pl,
pl2np, pl2np as pl2np,
# `numpy` only # `numpy` only
slice_from_time, slice_from_time as slice_from_time,
# `polars` specific # `polars` specific
dedupe, dedupe as dedupe,
with_dts, with_dts as with_dts,
detect_time_gaps, detect_time_gaps as detect_time_gaps,
sort_diff, sort_diff as sort_diff,
# TODO: # TODO:
detect_price_gaps detect_price_gaps as detect_price_gaps
) )
__all__: list[str] = [
'dedupe',
'get_null_segs',
'iter_null_segs',
'sort_diff',
'slice_from_time',
'Frame',
'Seq',
'np2pl',
'pl2np',
'slice_from_time',
'with_dts',
'detect_time_gaps',
'sort_diff',
# TODO:
'detect_price_gaps'
]
# TODO: break up all this shite into submods! # TODO: break up all this shite into submods!
from ..brokers._util import ( from ..brokers._util import (
DataUnavailable, DataUnavailable,
@ -589,13 +567,12 @@ async def start_backfill(
load_from_offline=False, load_from_offline=False,
) )
( (
df, wdts,
gaps,
deduped, deduped,
diff, diff,
) = dedupe(df) ) = dedupe(df)
if diff: # if diff:
sort_diff(df) # sort_diff(df)
else: else:
# finally filled gap # finally filled gap