From 0c5b5a5aeaa9af287922f4b8cfd823ab46a06395 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 5 Jan 2023 19:20:01 -0500 Subject: [PATCH] Take outer-interval values in `Viz.datums_range()` --- piker/ui/_dataviz.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/piker/ui/_dataviz.py b/piker/ui/_dataviz.py index d43377b9..bc50f04c 100644 --- a/piker/ui/_dataviz.py +++ b/piker/ui/_dataviz.py @@ -19,6 +19,10 @@ Data vizualization APIs ''' from __future__ import annotations +from math import ( + ceil, + floor, +) from typing import ( Optional, Literal, @@ -456,13 +460,13 @@ class Viz(msgspec.Struct): # , frozen=True): array = self.shm.array index = array[index_field] - first = round(index[0]) - last = round(index[-1]) + first = floor(index[0]) + last = ceil(index[-1]) # first and last datums in view determined by # l / r view range. - leftmost = round(l) - rightmost = round(r) + leftmost = floor(l) + rightmost = ceil(r) # invalid view state if (