From b18f870a6b6aab31d6890c8d7fe9f13f2999d1d1 Mon Sep 17 00:00:00 2001 From: wendtalexander Date: Wed, 2 Oct 2024 15:55:00 +0200 Subject: [PATCH] [buffer] adding True for fixing test --- pyrelacs/dataio/circbuffer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrelacs/dataio/circbuffer.py b/pyrelacs/dataio/circbuffer.py index 03993a2..629fea4 100644 --- a/pyrelacs/dataio/circbuffer.py +++ b/pyrelacs/dataio/circbuffer.py @@ -55,7 +55,7 @@ class CircBuffer: return self._buffer[channel, : self._index[channel]] def has_value(self, index, channel): - if index < 0 and self.is_full(channel): + if index <= 0 and self.is_full(channel): return True elif index < 0 and not self.is_full(channel): return False @@ -73,6 +73,8 @@ class CircBuffer: if index == self.write_index(channel) and self._totalcount[channel] == 0: return False + return True + def valid_range(self, channel: int = 0) -> Tuple[int, int]: """ Return the start index that are valid within the buffer