Skip to main content

Ring buffer implementation for numpy

Project description

Build Status codecov

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

Files for numpy_ringbuffer, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size numpy_ringbuffer-0.2.1-py2.py3-none-any.whl (3.8 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size numpy_ringbuffer-0.2.1.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page