From 2dab0e2e56dc7cb4ff9d496140c390bed8ccede9 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 17 Jul 2023 01:20:52 -0400 Subject: [PATCH] Expose `.data._symcache` stuff at subpkg toplevel The list is `open_symcache()`, `get_symcache()`, `SymbologyCache`, and `Stuct` which seems more or less fine to make part of the public namespace. Also, make `._timeseries.t_unit` an instance of literal to make `ruff` happy? --- piker/data/__init__.py | 12 +++++++++++- piker/data/_timeseries.py | 2 +- piker/data/flows.py | 3 --- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/piker/data/__init__.py b/piker/data/__init__.py index 6c621248..95c47e19 100644 --- a/piker/data/__init__.py +++ b/piker/data/__init__.py @@ -39,9 +39,15 @@ from .feed import ( open_feed, ) from .flows import Flume +from ._symcache import ( + SymbologyCache, + open_symcache, + get_symcache, +) +from .types import Struct -__all__ = [ +__all__: list[str] = [ 'Flume', 'Feed', 'open_feed', @@ -53,4 +59,8 @@ __all__ = [ 'get_shm_token', 'def_iohlcv_fields', 'def_ohlcv_fields', + 'open_symcache', + 'get_symcache', + 'SymbologyCache', + 'Struct', ] diff --git a/piker/data/_timeseries.py b/piker/data/_timeseries.py index f43e0c73..c812e08a 100644 --- a/piker/data/_timeseries.py +++ b/piker/data/_timeseries.py @@ -225,7 +225,7 @@ def detect_null_time_gap( return None -t_unit: Literal[ +t_unit: Literal = Literal[ 'days', 'hours', 'minutes', diff --git a/piker/data/flows.py b/piker/data/flows.py index 7776a602..652e1e71 100644 --- a/piker/data/flows.py +++ b/piker/data/flows.py @@ -31,7 +31,6 @@ import pendulum import numpy as np from ..accounting import MktPair -from ._util import log from .types import Struct from ._sharedmem import ( attach_shm_array, @@ -233,5 +232,3 @@ class Flume(Struct): np.all(np.isin(vlm, -1)) or np.all(np.isnan(vlm)) ) - -