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