|
10 | 10 | import pkg_resources |
11 | 11 | from brainflow.exit_codes import BrainFlowExitCodes, BrainFlowError |
12 | 12 | from brainflow.utils import LogLevels |
13 | | -from nptyping import NDArray, Float64 |
| 13 | +from nptyping import NDArray, Float64, Shape |
14 | 14 | from numpy.ctypeslib import ndpointer |
15 | 15 |
|
16 | 16 |
|
@@ -1266,15 +1266,15 @@ def release_session(self) -> None: |
1266 | 1266 | if res != BrainFlowExitCodes.STATUS_OK.value: |
1267 | 1267 | raise BrainFlowError('unable to release streaming session', res) |
1268 | 1268 |
|
1269 | | - def get_current_board_data(self, num_samples: int, preset: int = BrainFlowPresets.DEFAULT_PRESET) -> NDArray[Float64]: |
| 1269 | + def get_current_board_data(self, num_samples: int, preset: int = BrainFlowPresets.DEFAULT_PRESET) -> NDArray[Shape["*, *"], Float64]: |
1270 | 1270 | """Get specified amount of data or less if there is not enough data, doesnt remove data from ringbuffer |
1271 | 1271 |
|
1272 | 1272 | :param num_samples: max number of samples |
1273 | 1273 | :type num_samples: int |
1274 | 1274 | :param preset: preset |
1275 | 1275 | :type preset: int |
1276 | 1276 | :return: latest data from a board |
1277 | | - :rtype: NDArray[Float64] |
| 1277 | + :rtype: NDArray[Shape["*, *"], Float64] |
1278 | 1278 | """ |
1279 | 1279 |
|
1280 | 1280 | package_length = BoardShim.get_num_rows(self._master_board_id, preset) |
@@ -1345,15 +1345,15 @@ def is_prepared(self) -> bool: |
1345 | 1345 | raise BrainFlowError('unable to check session status', res) |
1346 | 1346 | return bool(prepared[0]) |
1347 | 1347 |
|
1348 | | - def get_board_data(self, num_samples=None, preset: int = BrainFlowPresets.DEFAULT_PRESET) -> NDArray[Float64]: |
| 1348 | + def get_board_data(self, num_samples=None, preset: int = BrainFlowPresets.DEFAULT_PRESET) -> NDArray[Shape["*, *"], Float64]: |
1349 | 1349 | """Get board data and remove data from ringbuffer |
1350 | 1350 |
|
1351 | 1351 | :param num_samples: number of packages to get |
1352 | 1352 | :type num_samples: int |
1353 | 1353 | :param preset: preset |
1354 | 1354 | :type preset: int |
1355 | 1355 | :return: all data from a board if num_samples is None, num_samples packages or less if not None |
1356 | | - :rtype: NDArray[Float64] |
| 1356 | + :rtype: NDArray[Shape["*, *"], Float64] |
1357 | 1357 | """ |
1358 | 1358 |
|
1359 | 1359 | data_size = self.get_board_data_count(preset) |
|
0 commit comments