ezmsg.lsl.inlet#

Classes

class LSLInfo(name: str = '', type: str = '', host: str = '', channel_count: int | None = None, nominal_srate: float = 0.0, channel_format: str | None = None)[source]#

Bases: object

Parameters:
  • name (str)

  • type (str)

  • host (str)

  • channel_count (int | None)

  • nominal_srate (float)

  • channel_format (str | None)

name: str = ''#
type: str = ''#
host: str = ''#
channel_count: int | None = None#
nominal_srate: float = 0.0#
channel_format: str | None = None#
__init__(name='', type='', host='', channel_count=None, nominal_srate=0.0, channel_format=None)#
Parameters:
  • name (str)

  • type (str)

  • host (str)

  • channel_count (int | None)

  • nominal_srate (float)

  • channel_format (str | None)

Return type:

None

class LSLInletGenerator(*args, settings=None, **kwargs)[source]#

Bases: object

Parameters:

settings (LSLInletSettings | None)

__init__(*args, settings=None, **kwargs)[source]#
Parameters:

settings (LSLInletSettings | None)

property state: LSLInletState#
shutdown(shutdown_resolver=True)[source]#
Parameters:

shutdown_resolver (bool)

update_settings(new_settings)[source]#
Parameters:

new_settings (LSLInletSettings)

Return type:

None

class LSLInletSettings(info: ezmsg.lsl.inlet.LSLInfo = <factory>, local_buffer_dur: float = 1.0, use_arrival_time: bool = False, use_lsl_clock: bool = False, processing_flags: int = 15)[source]#

Bases: Settings

Parameters:
info: LSLInfo#
local_buffer_dur: float = 1.0#
use_arrival_time: bool = False#

Whether to ignore the LSL timestamps and use the time.time of the pull (True). If False (default), the LSL (send) timestamps are used. Send times may be converted from LSL clock to time.time clock. See use_lsl_clock.

use_lsl_clock: bool = False#

Whether the AxisArray.Axis.offset should use LSL’s clock (True) or time.time’s clock (False – default).

processing_flags: int = 15#

The processing flags option passed to pylsl.StreamInlet. Default is proc_ALL which includes all flags. Many users will want to set this to pylsl.proc_clocksync to disable dejittering.

__init__(info=<factory>, local_buffer_dur=1.0, use_arrival_time=False, use_lsl_clock=False, processing_flags=15)#
Parameters:
Return type:

None

class LSLInletState[source]#

Bases: State

resolver: ContinuousResolver | None = None#
inlet: StreamInlet | None = None#
clock_sync: ClockSync = <ezmsg.lsl.util.ClockSync object>#
msg_template: AxisArray | None = None#
fetch_buffer: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#
class LSLInletUnit(*args, settings=None, **kwargs)[source]#

Bases: Unit

Represents a node in a graph that creates an LSL inlet and forwards the pulled data to the unit’s output.

Parameters:
  • stream_name – The name of the created LSL outlet.

  • stream_type – The type of the created LSL outlet.

  • settings (Settings | None)

SETTINGS#

alias of LSLInletSettings

STATE#

alias of LSLInletUnitState

INPUT_SETTINGS = InputStream:unlocated[<class 'ezmsg.lsl.inlet.LSLInletSettings'>]()#
OUTPUT_SIGNAL = OutputStream:unlocated[<class 'ezmsg.util.messages.axisarray.AxisArray'>](self.num_buffers=32, self.force_tcp=False)#
async initialize()[source]#

Runs when the Unit is instantiated. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

shutdown()[source]#

Runs when the Unit terminates. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

async update_clock()[source]#
Return type:

None

async on_settings(msg)[source]#
Parameters:

msg (LSLInletSettings)

Return type:

None

async lsl_pull()[source]#
Return type:

AsyncGenerator

class LSLInletUnitState[source]#

Bases: State

generator: LSLInletGenerator | None = None#
class LSLInfo(name: str = '', type: str = '', host: str = '', channel_count: int | None = None, nominal_srate: float = 0.0, channel_format: str | None = None)[source]#

Bases: object

Parameters:
  • name (str)

  • type (str)

  • host (str)

  • channel_count (int | None)

  • nominal_srate (float)

  • channel_format (str | None)

name: str = ''#
type: str = ''#
host: str = ''#
channel_count: int | None = None#
nominal_srate: float = 0.0#
channel_format: str | None = None#
__init__(name='', type='', host='', channel_count=None, nominal_srate=0.0, channel_format=None)#
Parameters:
  • name (str)

  • type (str)

  • host (str)

  • channel_count (int | None)

  • nominal_srate (float)

  • channel_format (str | None)

Return type:

None

class LSLInletSettings(info: ezmsg.lsl.inlet.LSLInfo = <factory>, local_buffer_dur: float = 1.0, use_arrival_time: bool = False, use_lsl_clock: bool = False, processing_flags: int = 15)[source]#

Bases: Settings

Parameters:
info: LSLInfo#
local_buffer_dur: float = 1.0#
use_arrival_time: bool = False#

Whether to ignore the LSL timestamps and use the time.time of the pull (True). If False (default), the LSL (send) timestamps are used. Send times may be converted from LSL clock to time.time clock. See use_lsl_clock.

use_lsl_clock: bool = False#

Whether the AxisArray.Axis.offset should use LSL’s clock (True) or time.time’s clock (False – default).

processing_flags: int = 15#

The processing flags option passed to pylsl.StreamInlet. Default is proc_ALL which includes all flags. Many users will want to set this to pylsl.proc_clocksync to disable dejittering.

__init__(info=<factory>, local_buffer_dur=1.0, use_arrival_time=False, use_lsl_clock=False, processing_flags=15)#
Parameters:
Return type:

None

class LSLInletState[source]#

Bases: State

resolver: ContinuousResolver | None = None#
inlet: StreamInlet | None = None#
clock_sync: ClockSync = <ezmsg.lsl.util.ClockSync object>#
msg_template: AxisArray | None = None#
fetch_buffer: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#
class LSLInletGenerator(*args, settings=None, **kwargs)[source]#

Bases: object

Parameters:

settings (LSLInletSettings | None)

__init__(*args, settings=None, **kwargs)[source]#
Parameters:

settings (LSLInletSettings | None)

property state: LSLInletState#
shutdown(shutdown_resolver=True)[source]#
Parameters:

shutdown_resolver (bool)

update_settings(new_settings)[source]#
Parameters:

new_settings (LSLInletSettings)

Return type:

None

class LSLInletUnitState[source]#

Bases: State

generator: LSLInletGenerator | None = None#
class LSLInletUnit(*args, settings=None, **kwargs)[source]#

Bases: Unit

Represents a node in a graph that creates an LSL inlet and forwards the pulled data to the unit’s output.

Parameters:
  • stream_name – The name of the created LSL outlet.

  • stream_type – The type of the created LSL outlet.

  • settings (Settings | None)

SETTINGS#

alias of LSLInletSettings

STATE#

alias of LSLInletUnitState

INPUT_SETTINGS = InputStream:unlocated[<class 'ezmsg.lsl.inlet.LSLInletSettings'>]()#
OUTPUT_SIGNAL = OutputStream:unlocated[<class 'ezmsg.util.messages.axisarray.AxisArray'>](self.num_buffers=32, self.force_tcp=False)#
async initialize()[source]#

Runs when the Unit is instantiated. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

shutdown()[source]#

Runs when the Unit terminates. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

async update_clock()[source]#
Return type:

None

async on_settings(msg)[source]#
Parameters:

msg (LSLInletSettings)

Return type:

None

async lsl_pull()[source]#
Return type:

AsyncGenerator