numpy_ringbuffer icon indicating copy to clipboard operation
numpy_ringbuffer copied to clipboard

Ring-buffer implementation that thinly wraps a numpy array

Results 10 numpy_ringbuffer issues
Sort by recently updated
recently updated
newest added

Array unwrap is computationally expensive for large arrays. This PR makes sure the underlying array is not unnecessarily unwrapped if it has not changed since it was last unwrapped. All...

This adds the tests `test_raises_error_indexing_empty_buffer` and `test_negative_indices_give_recent_data_with_unfull_buffer` to ensure the class doesn't access memory unsafely. Closes #13 Closes #14

This will handle cases of `ringbuf[-]`, which were failing when `self._arr` is not full. This may address the needs of your Issue #5, but I suspect it will not handle...

In a partly-full buffer, if you take a negative index, it will refer that index to the end of the full length of the buffer as apposed to the end...

If you index a `RingBuffer` before having appended any values to it, you will unsafely get whatever was in memory at the buffer's location ```python from numpy_ringbuffer import RingBuffer r...

The Readme.md says that collections.deque operations are available, but RingBuffer inherits from collections ABC, Sequence? At any rate, I can't access the deque.clear() method. Am I missing something?

Hi @eric-wieser, simple indexing does not work as expected in combination with `pop()`. E.g., ```python r = RingBuffer(capacity=4, dtype=np.int32) r.extend((1,2,3,4)) r.pop() print(r[-1]) >>> 4 ``` One would expect to see...

bug

Maybe you should answer to this SO question http://stackoverflow.com/questions/4151320/efficient-circular-buffer

Should resolve the workflow error: ``` DEPRECATION: numpy-ringbuffer is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not...

Previous behavior: ```python >>> import numpy as np >>> from numpy_ringbuffer import RingBuffer >>> r = RingBuffer(5) >>> r.extend(np.arange(8)) >>> r ``` Expected/fixed behavior: ```python >>> import numpy as np...