Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Python NumPy implementation of ring buffer (aka circular buffer)

License

NotificationsYou must be signed in to change notification settings

s-celles/numpy-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Numpy Buffer

APythonNumPy implementation of buffer.

Install

$ pip install git+https://github.com/scls19fr/numpy-buffer/

Ring Buffer

Description

Seedescription of a ring buffer (or circular buffer).

Usage

In [1]:fromnumpy_bufferimportRingBufferIn [2]:N=10In [3]:ring=RingBuffer(size_max=10,default_value=0.0,dtype=float)In [4]:ringOut[4]:<RingBufferall:array([0.,0.,0.,0.,0.,0.,0.,0.,0.,0.])partial:array([],dtype=float64)size/size_max:0/10>In [5]:ring.append(1.2)In [6]:ringOut[6]:<RingBufferall:array([1.2 ,0. ,0. ,0. ,0. ,0. ,0. ,0. ,0. ,0.])partial:array([1.2])size/size_max:1/10>In [7]:ring.append(2.1)In [8]:ringOut[8]:<RingBufferall:array([2.1 ,1.2 ,0. ,0. ,0. ,0. ,0. ,0. ,0.,0.])partial:array([2.1 ,1.2])size/size_max:2/10>In [9]:ring.allOut[9]:array([2.1,1.2,0. ,0. ,0. ,0. ,0. ,0. ,0. ,0. ])In [10]:ring.partialOut[10]:array([2.1,1.2])In [11]:ring.partial[::-1]Out[11]:array([1.2,2.1])

Development

You can help to develop this library.

Issues

You can submit issues usinghttps://github.com/scls19fr/numpy-buffer/issues

Clone

You can clone repository to try to fix issues yourself using:

$ git clone https://github.com/scls19fr/numpy-buffer

Run unit tests

Run all unit tests

$ nosetests -s -v

Run a given test

$ nosetests tests/test_ring.py:test_ring -s -v

Install development version

$ python setup.py install

or

$ sudo pip install git+https://github.com/scls19fr/numpy-buffer

Collaborating

  • Fork repository
  • Create a branch which fix a given issue
  • Submit pull requests

https://help.github.com/categories/collaborating/

Examples

seesamples directory

http://img.youtube.com/vi/MjuWUF0ibYk/0.jpg

About

A Python NumPy implementation of ring buffer (aka circular buffer)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp