From 03a7940f831061076db3164add156d51ef5db3d9 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 27 Jun 2022 18:24:09 -0400 Subject: [PATCH] Rewrite per-pi group mxmn sorter to always expect output --- piker/ui/_fsp.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/piker/ui/_fsp.py b/piker/ui/_fsp.py index 52f394ee..2259a612 100644 --- a/piker/ui/_fsp.py +++ b/piker/ui/_fsp.py @@ -639,18 +639,24 @@ async def open_vlm_displays( names: list[str], ) -> tuple[float, float]: + ''' + Flows "group" maxmin loop; assumes all named flows + are in the same co-domain and thus can be sorted + as one set. + Iterates all the named flows and calls the chart + api to find their range values and return. + + TODO: really we should probably have a more built-in API + for this? + + ''' mx = 0 for name in names: - - mxmn = chart.maxmin(name=name) - if mxmn: - ymax = mxmn[1] - if ymax > mx: - mx = ymax + ymn, ymx = chart.maxmin(name=name) + mx = max(mx, ymx) return 0, mx - # chart.view.maxmin = partial(multi_maxmin, names=['volume']) # TODO: fix the x-axis label issue where if you put # the axis on the left it's totally not lined up...