@@ -134,7 +134,7 @@ class BaseRawIO:
134
134
135
135
rawmode = None # one key from possible_raw_modes
136
136
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 ):
138
138
"""
139
139
:TODO: Why multi-file would have a single filename is confusing here - shouldn't
140
140
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]):
474
474
channel_indexes = np .array ([chan_ids .index (chan_id ) for chan_id in channel_ids ])
475
475
return channel_indexes
476
476
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 ):
478
482
"""
479
483
Select channel_indexes for a stream based on channel_indexes/channel_names/channel_ids
480
484
depending which is not None.
@@ -505,7 +509,10 @@ def get_signal_size(self, block_index: int, seg_index: int, stream_index: int |
505
509
stream_index = self ._get_stream_index_from_arg (stream_index )
506
510
return self ._get_signal_size (block_index , seg_index , stream_index )
507
511
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 ):
509
516
"""
510
517
Retrieve the t_start of a single section of the channels in a stream.
511
518
:param block_index:
@@ -529,9 +536,16 @@ def get_signal_sampling_rate(self, stream_index: int | None = None):
529
536
sr = signal_channels [0 ]['sampling_rate' ]
530
537
return float (sr )
531
538
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 ):
535
549
"""
536
550
Return a chunk of raw signal as a Numpy array. columns correspond to samples from a
537
551
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
588
602
589
603
return raw_chunk
590
604
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 ):
593
612
"""
594
613
Rescale a chunk of raw signals which are provided as a Numpy array. These are normally
595
614
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 =
631
650
def spike_count (self , block_index : int = 0 , seg_index : int = 0 , spike_channel_index : int = 0 ):
632
651
return self ._spike_count (block_index , seg_index , spike_channel_index )
633
652
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 ):
636
659
"""
637
660
The timestamp datatype is as close to the format itself. Sometimes float/int32/int64.
638
661
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
651
674
return self ._rescale_spike_timestamp (spike_timestamps , dtype )
652
675
653
676
# 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 ):
656
683
wf = self ._get_spike_raw_waveforms (block_index , seg_index ,
657
684
spike_channel_index , t_start , t_stop )
658
685
return wf
@@ -675,8 +702,12 @@ def rescale_waveforms_to_float(self, raw_waveforms: np.ndarray, dtype: np.dtype
675
702
def event_count (self , block_index : int = 0 , seg_index : int = 0 , event_channel_index : int = 0 ):
676
703
return self ._event_count (block_index , seg_index , event_channel_index )
677
704
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 ):
680
711
"""
681
712
The timestamp datatype is as close to the format itself. Sometimes float/int32/int64.
682
713
Sometimes it is the index on the signal but not always.
@@ -780,7 +811,7 @@ def _source_name(self):
780
811
def _segment_t_start (self , block_index : int , seg_index : int ):
781
812
raise (NotImplementedError )
782
813
783
- def _segment_t_stop (self , block_index : int , seg_index : int ):
814
+ def _segment_t_stop (self , block_index : int , seg_index : int ):
784
815
raise (NotImplementedError )
785
816
786
817
###
@@ -801,8 +832,13 @@ def _get_signal_t_start(self, block_index: int, seg_index: int, stream_index: in
801
832
"""
802
833
raise (NotImplementedError )
803
834
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 ):
806
842
"""
807
843
Return the samples from a set of AnalogSignals indexed
808
844
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
819
855
def _spike_count (self , block_index : int , seg_index : int , spike_channel_index : int ):
820
856
raise (NotImplementedError )
821
857
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 ):
824
864
raise (NotImplementedError )
825
865
826
866
def _rescale_spike_timestamp (self , spike_timestamps : np .ndarray , dtype : np .dtype ):
827
867
raise (NotImplementedError )
828
868
829
869
###
830
870
# 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 ):
833
877
raise (NotImplementedError )
834
878
835
879
###
836
880
# event and epoch zone
837
881
def _event_count (self , block_index : int , seg_index : int , event_channel_index : int ):
838
882
raise (NotImplementedError )
839
883
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 ):
841
890
raise (NotImplementedError )
842
891
843
892
def _rescale_event_timestamp (self , event_timestamps : np .ndarray , dtype : np .dtype ):
0 commit comments