piker/piker/brokers
Gud Boi de82df727d Add `is_expired()` and harden `.ib.venues` helpers
Add an expiry-date predicate and guard venue session
lookups against expired contracts and empty session
lists in `.ib.venues`; use in `api.py` to skip gap
detection for expired tracts.

Deats,
- add `is_expired()` predicate using
  `pendulum.parse()` on `realExpirationDate`.
- `sesh_times()`: raise `ValueError` if contract is
  expired or has no session intervals (instead of
  `StopIteration` from `next(iter(...))`).
- `is_venue_closure()`: handle `None` return from
  `sesh_times()` with guard + `breakpoint()`.

Also in `api.py`,
- import and call `is_expired()` from `.venues`.
- gate gap-detection on `not _is_expired`.
- default `timeZoneId` to `'EST'` when IB returns
  empty/`None`.

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-24 20:21:29 -04:00
..
binance Exclude crypto futes from `without_src` sym key 2026-03-17 21:15:31 -04:00
deribit Use `tractor.ipc._shm` types directly across codebase 2026-03-17 18:00:29 -04:00
ib Add `is_expired()` and harden `.ib.venues` helpers 2026-03-24 20:21:29 -04:00
kraken Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00
__init__.py Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00
_daemon.py Drop info-level `.pause()`-es used while devving 2026-02-23 13:26:46 -05:00
_util.py Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00
cli.py Pass `loglevel` down through `.data` callstack 2026-02-23 12:22:48 -05:00
core.py Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00
data.py Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00
kucoin.py Update to latest `KucoinMktPair` spec 2025-02-12 18:08:40 -05:00
questrade.py Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00
robinhood.py Use `__name__` for loggers across most sub-mods 2026-02-23 12:22:48 -05:00