From 360643b32f7770ba5c6927269c45bb45e1b51b23 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 30 May 2022 09:37:33 -0400 Subject: [PATCH] Fix optional input `bars_range` type to match `Flow.datums_range()` --- piker/ui/_chart.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/piker/ui/_chart.py b/piker/ui/_chart.py index 31ca0604..329f15f5 100644 --- a/piker/ui/_chart.py +++ b/piker/ui/_chart.py @@ -1251,7 +1251,9 @@ class ChartPlotWidget(pg.PlotWidget): def maxmin( self, name: Optional[str] = None, - bars_range: Optional[tuple[int, int, int, int]] = None, + bars_range: Optional[tuple[ + int, int, int, int, int, int + ]] = None, ) -> tuple[float, float]: ''' @@ -1260,6 +1262,7 @@ class ChartPlotWidget(pg.PlotWidget): If ``bars_range`` is provided use that range. ''' + # print(f'Chart[{self.name}].maxmin()') profiler = pg.debug.Profiler( msg=f'`{str(self)}.maxmin(name={name})`: `{self.name}`', disabled=not pg_profile_enabled(), @@ -1279,7 +1282,14 @@ class ChartPlotWidget(pg.PlotWidget): key = res = 0, 0 else: - first, l, lbar, rbar, r, last = bars_range or flow.datums_range() + ( + first, + l, + lbar, + rbar, + r, + last, + ) = bars_range or flow.datums_range() profiler(f'{self.name} got bars range') key = round(lbar), round(rbar)