main.MockupStream

mockup_streamer.main.MockupStream(name, cfg, files=[])

A mockup streamer class to represent data from one source (file or random). Each such stream can have up to one markers stream associated which will be streamed in parallel with a separate name

Attributes

Name Type Description
name str Name of the stream
sfreq float Target sampling frequency
outlet pylsl.StreamOutlet pylsl StreamOutlet object data is pushed to
outlet_mrk pylsl.StreamOutlet | None pylsl StreamOutlet object markers are pushed to
buffer np.ndarray The pre buffered data to be streamed from
buffer_i int index of the current position in the data buffer
n_pushed int number of samples pushed
t_start_s float timestamp of the start of the stream, required samples will be calculated relative to this

Methods

Name Description
load_next_data Load the next data chunk into the buffer.
push_markers Check if there is a marker within the index range and push if yes

load_next_data

mockup_streamer.main.MockupStream.load_next_data()

Load the next data chunk into the buffer.

This method handles loading data from files or generating random data based on the configuration. It initializes the buffer with the new data and resets the buffer index. If the configuration specifies markers, it also generates markers accordingly.

If no files are provided, random data is generated. If files are provided, the next file in the list is loaded. If the end of the file list is reached and the mode is set to ‘repeat’, the file index is reset to the beginning.

push_markers

mockup_streamer.main.MockupStream.push_markers(idx_from, idx_to)

Check if there is a marker within the index range and push if yes