From 6f8a361e8024ded3100598067adb35d0b6f594f2 Mon Sep 17 00:00:00 2001 From: goodboy Date: Sun, 1 Feb 2026 19:28:14 -0500 Subject: [PATCH] Cleanups and doc tweaks to `.ui._fsp` Expand read-race warning log for clarity, add TODO for reading `tractor` transport config from `conf.toml`, and reflow docstring in `open_vlm_displays()`. Also, - whitespace cleanup: `Type | None` -> `Type|None` - clarify "Volume" -> "Vlm (volume)" in docstr (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- piker/ui/_fsp.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/piker/ui/_fsp.py b/piker/ui/_fsp.py index ca43ed77..3a1a80a5 100644 --- a/piker/ui/_fsp.py +++ b/piker/ui/_fsp.py @@ -73,7 +73,7 @@ log = get_logger(__name__) def update_fsp_chart( viz, graphics_name: str, - array_key: str | None, + array_key: str|None, **kwargs, ) -> None: @@ -87,7 +87,11 @@ def update_fsp_chart( # guard against unreadable case if not last_row: - log.warning(f'Read-race on shm array: {graphics_name}@{shm.token}') + log.warning( + f'Read-race on shm array,\n' + f'graphics_name: {graphics_name!r}\n' + f'shm.token: {shm.token}\n' + ) return # update graphics @@ -203,7 +207,6 @@ async def open_fsp_actor_cluster( async def run_fsp_ui( - linkedsplits: LinkedSplits, flume: Flume, started: trio.Event, @@ -471,7 +474,7 @@ class FspAdmin: target: Fsp, conf: dict[str, dict[str, Any]], - worker_name: str | None = None, + worker_name: str|None = None, loglevel: str = 'info', ) -> (Flume, trio.Event): @@ -623,8 +626,10 @@ async def open_fsp_admin( event.set() +# TODO, passing in `pikerd` related settings here! +# [ ] read in the `tractor` setting for `enable_transports: list` +# from the root `conf.toml`! async def open_vlm_displays( - linked: LinkedSplits, flume: Flume, dvlm: bool = True, @@ -634,12 +639,12 @@ async def open_vlm_displays( ) -> None: ''' - Volume subchart displays. + Vlm (volume) subchart displays. Since "volume" is often included directly alongside OHLCV price - data, we don't really need a separate FSP-actor + shm array for it - since it's likely already directly adjacent to OHLC samples from the - data provider. + data, we don't really need a separate FSP-actor + shm array for + it since it's likely already directly adjacent to OHLC samples + from the data provider. Further only if volume data is detected (it sometimes isn't provided eg. forex, certain commodities markets) will volume dependent FSPs