Ring (aka circular) buffers backed by a numpy array, supporting:
Operations from collections.deque
b.append(val)
b.appendleft(val)
b.extend(val)
b.extendleft(val)
b.pop(val)
b.popleft(val)
The collections.Sequence protocol (unoptimized)
C-side unwrapping into an array with np.array(b)
Arbitrary element dtypes, including extra dimensions like RingBuffer(N, dtype=(int, 3))
For example:
import numpy as np
from numpy_ringbuffer import RingBuffer
r = RingBuffer(capacity=4, dtype=np.bool)
r.append(True)
r.appendleft(False)
print(np.array(r)) # array([False, True])
Metadata
Release files for numpy-ringbuffer 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| numpy_ringbuffer-0.2.0.zip | 5.3 kB | Details |
Release files / numpy_ringbuffer-0.2.0.zip
| Download URL | numpy_ringbuffer-0.2.0.zip |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bffe94d6b6edd9e1e0538c8fc8b8bdf4379969e7372002b6eb3987741722fbff
|
|
BLAKE2b-256 checksum How to use checksums |
7d82eaf542a9d28624a240d5418efed28f1fe352d59205986c0a53fb5abeaf0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |