[project] adding buffer class
This commit is contained in:
parent
9327d1bac9
commit
c2285f3750
15
pyrelacs/dataio/buffer.py
Normal file
15
pyrelacs/dataio/buffer.py
Normal file
@ -0,0 +1,15 @@
|
||||
from collections import deque
|
||||
|
||||
from pyrelacs.util.logging import config_logging
|
||||
|
||||
log = config_logging()
|
||||
|
||||
|
||||
class DataBuffer:
|
||||
def __init__(self, channels, samples):
|
||||
self.channels = channels
|
||||
self.samples = samples
|
||||
|
||||
def create_buffer(self):
|
||||
max_len_buffer = self.channels * self.samples
|
||||
self.buffer = deque(maxlen=max_len_buffer)
|
Loading…
Reference in New Issue
Block a user