Drop some bps and style logic to multiline
parent
0cb1183904
commit
eaedaa96df
|
@ -305,8 +305,8 @@ class MktPair(Struct, frozen=True):
|
||||||
# config right?
|
# config right?
|
||||||
# src_type: AssetTypeName
|
# src_type: AssetTypeName
|
||||||
|
|
||||||
# for derivs, info describing contract, egs.
|
# for derivs, info describing contract, egs. strike price, call
|
||||||
# strike price, call or put, swap type, exercise model, etc.
|
# or put, swap type, exercise model, etc.
|
||||||
contract_info: list[str] | None = None
|
contract_info: list[str] | None = None
|
||||||
|
|
||||||
# TODO: rename to sectype since all of these can
|
# TODO: rename to sectype since all of these can
|
||||||
|
|
|
@ -251,10 +251,16 @@ def iter_by_dt(
|
||||||
for k in parsers:
|
for k in parsers:
|
||||||
if (
|
if (
|
||||||
isdict and k in tx
|
isdict and k in tx
|
||||||
or getattr(tx, k, None)
|
or
|
||||||
|
getattr(tx, k, None)
|
||||||
):
|
):
|
||||||
v = tx[k] if isdict else tx.dt
|
v = (
|
||||||
assert v is not None, f'No valid value for `{k}`!?'
|
tx[k] if isdict
|
||||||
|
else tx.dt
|
||||||
|
)
|
||||||
|
assert v is not None, (
|
||||||
|
f'No valid value for `{k}`!?'
|
||||||
|
)
|
||||||
|
|
||||||
# only call parser on the value if not None from
|
# only call parser on the value if not None from
|
||||||
# the `parsers` table above (when NOT using
|
# the `parsers` table above (when NOT using
|
||||||
|
@ -269,8 +275,21 @@ def iter_by_dt(
|
||||||
return v
|
return v
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# XXX: should never get here..
|
# TODO: move to top?
|
||||||
breakpoint()
|
from piker.log import get_logger
|
||||||
|
log = get_logger(__name__)
|
||||||
|
|
||||||
|
# XXX: we should really never get here..
|
||||||
|
# only if a ledger record has no expected sort(able)
|
||||||
|
# field will we likely hit this.. like with ze IB.
|
||||||
|
# if no sortable field just deliver epoch?
|
||||||
|
log.warning(
|
||||||
|
'No (time) sortable field for TXN:\n'
|
||||||
|
f'{tx}\n'
|
||||||
|
)
|
||||||
|
return from_timestamp(0)
|
||||||
|
# breakpoint()
|
||||||
|
|
||||||
|
|
||||||
entry: tuple[str, dict] | Transaction
|
entry: tuple[str, dict] | Transaction
|
||||||
for entry in sorted(
|
for entry in sorted(
|
||||||
|
|
|
@ -300,7 +300,8 @@ def disect(
|
||||||
assert not df.is_empty()
|
assert not df.is_empty()
|
||||||
|
|
||||||
# muck around in pdbp REPL
|
# muck around in pdbp REPL
|
||||||
breakpoint()
|
# tractor.devx.mk_pdb().set_trace()
|
||||||
|
# breakpoint()
|
||||||
|
|
||||||
# TODO: we REALLY need a better console REPL for this
|
# TODO: we REALLY need a better console REPL for this
|
||||||
# kinda thing..
|
# kinda thing..
|
||||||
|
|
Loading…
Reference in New Issue