@@ -134,7 +134,7 @@ class BaseRawIO:
134134
135135 rawmode = None # one key from possible_raw_modes
136136
137- def __init__ (self , use_cache : bool = False , cache_path = 'same_as_resource' , ** kargs ):
137+ def __init__ (self , use_cache : bool = False , cache_path : str = 'same_as_resource' , ** kargs ):
138138 """
139139 :TODO: Why multi-file would have a single filename is confusing here - shouldn't
140140 the name of this argument be filenames_list or filenames_base or similar?
@@ -474,7 +474,11 @@ def channel_id_to_index(self, stream_index: int, channel_ids: list[str]):
474474 channel_indexes = np .array ([chan_ids .index (chan_id ) for chan_id in channel_ids ])
475475 return channel_indexes
476476
477- def _get_channel_indexes (self , stream_index : int , channel_indexes : list [int ] | None , channel_names : list [str ] | None , channel_ids : list [str ] | None ):
477+ def _get_channel_indexes (self ,
478+ stream_index : int ,
479+ channel_indexes : list [int ] | None ,
480+ channel_names : list [str ] | None ,
481+ channel_ids : list [str ] | None ):
478482 """
479483 Select channel_indexes for a stream based on channel_indexes/channel_names/channel_ids
480484 depending which is not None.
@@ -505,7 +509,10 @@ def get_signal_size(self, block_index: int, seg_index: int, stream_index: int |
505509 stream_index = self ._get_stream_index_from_arg (stream_index )
506510 return self ._get_signal_size (block_index , seg_index , stream_index )
507511
508- def get_signal_t_start (self , block_index : int , seg_index : int , stream_index : int | None = None ):
512+ def get_signal_t_start (self ,
513+ block_index : int ,
514+ seg_index : int ,
515+ stream_index : int | None = None ):
509516 """
510517 Retrieve the t_start of a single section of the channels in a stream.
511518 :param block_index:
@@ -529,9 +536,16 @@ def get_signal_sampling_rate(self, stream_index: int | None = None):
529536 sr = signal_channels [0 ]['sampling_rate' ]
530537 return float (sr )
531538
532- def get_analogsignal_chunk (self , block_index : int = 0 , seg_index : int = 0 , i_start : int | None = None , i_stop : int | None = None ,
533- stream_index : int | None = None , channel_indexes : list [int ] | None = None , channel_names : list [str ] | None = None ,
534- channel_ids : list [str ] | None = None , prefer_slice : bool = False ):
539+ def get_analogsignal_chunk (self ,
540+ block_index : int = 0 ,
541+ seg_index : int = 0 ,
542+ i_start : int | None = None ,
543+ i_stop : int | None = None ,
544+ stream_index : int | None = None ,
545+ channel_indexes : list [int ] | None = None ,
546+ channel_names : list [str ] | None = None ,
547+ channel_ids : list [str ] | None = None ,
548+ prefer_slice : bool = False ):
535549 """
536550 Return a chunk of raw signal as a Numpy array. columns correspond to samples from a
537551 section of a single channel of recording. The channels are chosen either by channel_names,
@@ -588,8 +602,13 @@ def get_analogsignal_chunk(self, block_index: int = 0, seg_index: int = 0, i_sta
588602
589603 return raw_chunk
590604
591- def rescale_signal_raw_to_float (self , raw_signal : np .ndarray , dtype : np .dtype = 'float32' , stream_index : int | None = None ,
592- channel_indexes : list [int ] | None = None , channel_names : list [str ] | None = None , channel_ids : list [str ] | None = None ):
605+ def rescale_signal_raw_to_float (self ,
606+ raw_signal : np .ndarray ,
607+ dtype : np .dtype = 'float32' ,
608+ stream_index : int | None = None ,
609+ channel_indexes : list [int ] | None = None ,
610+ channel_names : list [str ] | None = None ,
611+ channel_ids : list [str ] | None = None ):
593612 """
594613 Rescale a chunk of raw signals which are provided as a Numpy array. These are normally
595614 returned by a call to get_analogsignal_chunk. The channels are specified either by
@@ -631,8 +650,12 @@ def rescale_signal_raw_to_float(self, raw_signal: np.ndarray, dtype: np.dtype =
631650 def spike_count (self , block_index : int = 0 , seg_index : int = 0 , spike_channel_index : int = 0 ):
632651 return self ._spike_count (block_index , seg_index , spike_channel_index )
633652
634- def get_spike_timestamps (self , block_index :int = 0 , seg_index : int = 0 , spike_channel_index : int = 0 ,
635- t_start : float | None = None , t_stop : float | None = None ):
653+ def get_spike_timestamps (self ,
654+ block_index : int = 0 ,
655+ seg_index : int = 0 ,
656+ spike_channel_index : int = 0 ,
657+ t_start : float | None = None ,
658+ t_stop : float | None = None ):
636659 """
637660 The timestamp datatype is as close to the format itself. Sometimes float/int32/int64.
638661 Sometimes it is the index on the signal but not always.
@@ -651,8 +674,12 @@ def rescale_spike_timestamp(self, spike_timestamps: np.ndarray, dtype: np.dtype
651674 return self ._rescale_spike_timestamp (spike_timestamps , dtype )
652675
653676 # spiketrain waveform zone
654- def get_spike_raw_waveforms (self , block_index : int = 0 , seg_index : int = 0 , spike_channel_index : int = 0 ,
655- t_start : float | None = None , t_stop : float | None = None ):
677+ def get_spike_raw_waveforms (self ,
678+ block_index : int = 0 ,
679+ seg_index : int = 0 ,
680+ spike_channel_index : int = 0 ,
681+ t_start : float | None = None ,
682+ t_stop : float | None = None ):
656683 wf = self ._get_spike_raw_waveforms (block_index , seg_index ,
657684 spike_channel_index , t_start , t_stop )
658685 return wf
@@ -675,8 +702,12 @@ def rescale_waveforms_to_float(self, raw_waveforms: np.ndarray, dtype: np.dtype
675702 def event_count (self , block_index : int = 0 , seg_index : int = 0 , event_channel_index : int = 0 ):
676703 return self ._event_count (block_index , seg_index , event_channel_index )
677704
678- def get_event_timestamps (self , block_index : int = 0 , seg_index : int = 0 , event_channel_index : int = 0 ,
679- t_start : float | None = None , t_stop : float | None = None ):
705+ def get_event_timestamps (self ,
706+ block_index : int = 0 ,
707+ seg_index : int = 0 ,
708+ event_channel_index : int = 0 ,
709+ t_start : float | None = None ,
710+ t_stop : float | None = None ):
680711 """
681712 The timestamp datatype is as close to the format itself. Sometimes float/int32/int64.
682713 Sometimes it is the index on the signal but not always.
@@ -780,7 +811,7 @@ def _source_name(self):
780811 def _segment_t_start (self , block_index : int , seg_index : int ):
781812 raise (NotImplementedError )
782813
783- def _segment_t_stop (self , block_index : int , seg_index : int ):
814+ def _segment_t_stop (self , block_index : int , seg_index : int ):
784815 raise (NotImplementedError )
785816
786817 ###
@@ -801,8 +832,13 @@ def _get_signal_t_start(self, block_index: int, seg_index: int, stream_index: in
801832 """
802833 raise (NotImplementedError )
803834
804- def _get_analogsignal_chunk (self , block_index : int , seg_index : int , i_start : int | None , i_stop : int | None ,
805- stream_index : int , channel_indexes : list [int ] | None ):
835+ def _get_analogsignal_chunk (self ,
836+ block_index : int ,
837+ seg_index : int ,
838+ i_start : int | None ,
839+ i_stop : int | None ,
840+ stream_index : int ,
841+ channel_indexes : list [int ] | None ):
806842 """
807843 Return the samples from a set of AnalogSignals indexed
808844 by stream_index and channel_indexes (local index inner stream).
@@ -819,25 +855,38 @@ def _get_analogsignal_chunk(self, block_index: int, seg_index: int, i_start: int
819855 def _spike_count (self , block_index : int , seg_index : int , spike_channel_index : int ):
820856 raise (NotImplementedError )
821857
822- def _get_spike_timestamps (self , block_index : int , seg_index : int ,
823- spike_channel_index : int , t_start : float | None , t_stop : float | None ):
858+ def _get_spike_timestamps (self ,
859+ block_index : int ,
860+ seg_index : int ,
861+ spike_channel_index : int ,
862+ t_start : float | None ,
863+ t_stop : float | None ):
824864 raise (NotImplementedError )
825865
826866 def _rescale_spike_timestamp (self , spike_timestamps : np .ndarray , dtype : np .dtype ):
827867 raise (NotImplementedError )
828868
829869 ###
830870 # spike waveforms zone
831- def _get_spike_raw_waveforms (self , block_index : int , seg_index : int ,
832- spike_channel_index : int , t_start : float | None , t_stop : float | None ):
871+ def _get_spike_raw_waveforms (self ,
872+ block_index : int ,
873+ seg_index : int ,
874+ spike_channel_index : int ,
875+ t_start : float | None ,
876+ t_stop : float | None ):
833877 raise (NotImplementedError )
834878
835879 ###
836880 # event and epoch zone
837881 def _event_count (self , block_index : int , seg_index : int , event_channel_index : int ):
838882 raise (NotImplementedError )
839883
840- def _get_event_timestamps (self , block_index : int , seg_index : int , event_channel_index : int , t_start : float | None , t_stop : float | None ):
884+ def _get_event_timestamps (self ,
885+ block_index : int ,
886+ seg_index : int ,
887+ event_channel_index : int ,
888+ t_start : float | None ,
889+ t_stop : float | None ):
841890 raise (NotImplementedError )
842891
843892 def _rescale_event_timestamp (self , event_timestamps : np .ndarray , dtype : np .dtype ):
0 commit comments