Ring buffer implementation for numpy
copied from cf-staging / numpy_ringbufferRing (aka circular) buffers backed by a numpy array, supporting:
collections.deque
b.append(val)
b.appendleft(val)
b.extend(val)
b.extendleft(val)
b.pop(val)
b.popleft(val)
collections.Sequence
protocol (unoptimized)np.array(b)
RingBuffer(N, dtype=(int, 3))