File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515
1616class DataInlet :
17- """Handles data acquisition from LSL streams.
17+ """Stores metadata and buffered samples for a single LSL stream.
18+
19+ The DataInlet validates stream configuration, normalizes channel metadata,
20+ and keeps a buffer of recent samples for downstream consumers.
1821
1922 Attributes:
2023 inlet: The LSL stream inlet for acquiring data.
Original file line number Diff line number Diff line change 11"""Module providing the main entry point for the MoBI_View application.
22
33This module discovers all available LSL streams, creates DataInlet objects for each,
4- and prints stream information. The Qt-based desktop UI has been removed.
4+ and prints stream information.
55Usage:
66 python -m MoBI_View.main
77"""
Original file line number Diff line number Diff line change @@ -90,11 +90,8 @@ def test_data_inlet_with_real_streams(
9090 discovered_streams = resolve_streams ()
9191 data_inlets = []
9292 for info in discovered_streams :
93- try :
94- inlet = DataInlet (info )
95- data_inlets .append (inlet )
96- except Exception as err :
97- pytest .fail (f"Failed to create DataInlet: { err } " )
93+ inlet = DataInlet (info )
94+ data_inlets .append (inlet )
9895 stream_names = {inlet .stream_name for inlet in data_inlets }
9996 eeg_inlet = next (i for i in data_inlets if i .stream_name == "TestEEG" )
10097 accel_inlet = next (i for i in data_inlets if i .stream_name == "TestAccel" )
@@ -121,10 +118,7 @@ def test_no_streams() -> None:
121118 if len (test_streams ) == 0 :
122119 data_inlets = []
123120 for info in discovered_streams :
124- try :
125- inlet = DataInlet (info )
126- data_inlets .append (inlet )
127- except Exception :
128- pass
121+ inlet = DataInlet (info )
122+ data_inlets .append (inlet )
129123
130124 assert isinstance (data_inlets , list )
Original file line number Diff line number Diff line change @@ -129,14 +129,14 @@ def test_on_data_updated_empty_sample(mock_inlet: MagicMock) -> None:
129129 presenter = main_app_presenter .MainAppPresenter (data_inlets = [mock_inlet ])
130130 sample = np .array ([])
131131 channel_labels : list [Any ] = []
132-
133- result = presenter .on_data_updated ("Stream1" , sample , channel_labels )
134-
135132 expected_plot_data = {
136133 "stream_name" : "Stream1" ,
137134 "data" : [],
138135 "channel_labels" : [],
139136 }
137+
138+ result = presenter .on_data_updated ("Stream1" , sample , channel_labels )
139+
140140 assert result == expected_plot_data
141141
142142
You can’t perform that action at this time.
0 commit comments