|
7 | 7 |
|
8 | 8 | """ |
9 | 9 |
|
10 | | -from __future__ import annotations |
11 | 10 | from pathlib import Path |
12 | | -from typing import Union, Optional |
13 | 11 | import warnings |
14 | 12 | from packaging.version import parse |
15 | 13 | import json |
@@ -114,7 +112,7 @@ def get_probe_length(probe_part_number: str) -> int: |
114 | 112 | return 10_000 |
115 | 113 |
|
116 | 114 |
|
117 | | -def make_mux_table_array(mux_information) -> np.array: |
| 115 | +def make_mux_table_array(mux_information) -> np.ndarray: |
118 | 116 | """ |
119 | 117 | Function to parse the mux_table from ProbeTable. |
120 | 118 |
|
@@ -210,7 +208,7 @@ def get_probe_contour_vertices(shank_width, tip_length, probe_length) -> list: |
210 | 208 | return polygon_vertices |
211 | 209 |
|
212 | 210 |
|
213 | | -def read_imro(file_path: Union[str, Path]) -> Probe: |
| 211 | +def read_imro(file_path: str | Path) -> Probe: |
214 | 212 | """ |
215 | 213 | Read probe position from the imro file used in input of SpikeGlx and Open-Ephys for neuropixels probes. |
216 | 214 |
|
@@ -571,7 +569,7 @@ def _annotate_probe_with_adc_sampling_info(probe: Probe, adc_sampling_table: str |
571 | 569 | _annotate_contacts_from_mux_table(probe, adc_groups_array) |
572 | 570 |
|
573 | 571 |
|
574 | | -def _read_imro_string(imro_str: str, imDatPrb_pn: Optional[str] = None) -> Probe: |
| 572 | +def _read_imro_string(imro_str: str, imDatPrb_pn: str | None = None) -> Probe: |
575 | 573 | """ |
576 | 574 | Parse the IMRO table when presented as a string and create a Probe object. |
577 | 575 |
|
@@ -1027,7 +1025,7 @@ def parse_spikeglx_snsGeomMap(meta): |
1027 | 1025 | # parse_spikeglx_snsGeomMap(meta) |
1028 | 1026 |
|
1029 | 1027 |
|
1030 | | -def get_saved_channel_indices_from_spikeglx_meta(meta_file: str | Path) -> np.array: |
| 1028 | +def get_saved_channel_indices_from_spikeglx_meta(meta_file: str | Path) -> np.ndarray: |
1031 | 1029 | """ |
1032 | 1030 | Utils function to get the saved channels. |
1033 | 1031 |
|
@@ -1067,7 +1065,7 @@ def _parse_openephys_settings( |
1067 | 1065 | settings_file: str | Path, |
1068 | 1066 | fix_x_position_for_oe_5: bool = True, |
1069 | 1067 | raise_error: bool = True, |
1070 | | -) -> Optional[list[dict]]: |
| 1068 | +) -> list[dict] | None: |
1071 | 1069 | """ |
1072 | 1070 | Parse an Open Ephys settings.xml and extract per-probe metadata. |
1073 | 1071 |
|
@@ -1396,11 +1394,11 @@ def _parse_openephys_settings( |
1396 | 1394 |
|
1397 | 1395 | def _select_openephys_probe_info( |
1398 | 1396 | probes_info: list[dict], |
1399 | | - stream_name: Optional[str] = None, |
1400 | | - probe_name: Optional[str] = None, |
1401 | | - serial_number: Optional[str] = None, |
| 1397 | + stream_name: str | None = None, |
| 1398 | + probe_name: str | None = None, |
| 1399 | + serial_number: str | None = None, |
1402 | 1400 | raise_error: bool = True, |
1403 | | -) -> Optional[dict]: |
| 1401 | +) -> dict | None: |
1404 | 1402 | """ |
1405 | 1403 | Select one probe's info dict from the list returned by `_parse_openephys_settings`. |
1406 | 1404 |
|
@@ -1587,9 +1585,9 @@ def _annotate_openephys_probe(probe: Probe, probe_info: dict) -> None: |
1587 | 1585 |
|
1588 | 1586 | def read_openephys( |
1589 | 1587 | settings_file: str | Path, |
1590 | | - stream_name: Optional[str] = None, |
1591 | | - probe_name: Optional[str] = None, |
1592 | | - serial_number: Optional[str] = None, |
| 1588 | + stream_name: str | None = None, |
| 1589 | + probe_name: str | None = None, |
| 1590 | + serial_number: str | None = None, |
1593 | 1591 | fix_x_position_for_oe_5: bool = True, |
1594 | 1592 | raise_error: bool = True, |
1595 | 1593 | ) -> Probe: |
@@ -1676,9 +1674,7 @@ def read_openephys( |
1676 | 1674 | return probe |
1677 | 1675 |
|
1678 | 1676 |
|
1679 | | -def get_saved_channel_indices_from_openephys_settings( |
1680 | | - settings_file: str | Path, stream_name: str |
1681 | | -) -> Optional[np.array]: |
| 1677 | +def get_saved_channel_indices_from_openephys_settings(settings_file: str | Path, stream_name: str) -> np.ndarray | None: |
1682 | 1678 | """ |
1683 | 1679 | Returns an array with the subset of saved channels indices (if used) |
1684 | 1680 |
|
|
0 commit comments