Skip to main content

Ring buffer implementation for numpy

Project description

Build Status

codecov

Circular buffers (aka ring buffers) backed by a numpy array, supporting the operations:

  • b.append(val)

  • b.appendleft(val)

  • b.pop(val)

  • b.popleft(val)

  • np.array(b) - fast unwrapping into a numpy array, for vectorization

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])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numpy_ringbuffer-0.1.1.zip (3.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page