@@ -23,7 +23,7 @@ class BaseRecording(BaseRecordingSnippets):
2323 Internally handle list of RecordingSegment
2424 """
2525
26- _main_annotations = ["is_filtered" ]
26+ _main_annotations = BaseRecordingSnippets . _main_annotations + ["is_filtered" ]
2727 _main_properties = ["group" , "location" , "gain_to_uV" , "offset_to_uV" ]
2828 _main_features = [] # recording do not handle features
2929
@@ -45,9 +45,6 @@ def __init__(self, sampling_frequency: float, channel_ids: list, dtype):
4545 self .annotate (is_filtered = False )
4646
4747 def __repr__ (self ):
48-
49- class_name = self .__class__ .__name__
50- name_to_display = class_name
5148 num_segments = self .get_num_segments ()
5249
5350 txt = self ._repr_header ()
@@ -57,7 +54,7 @@ def __repr__(self):
5754 split_index = txt .rfind ("-" , 0 , 100 ) # Find the last "-" before character 100
5855 if split_index != - 1 :
5956 first_line = txt [:split_index ]
60- recording_string_space = len (name_to_display ) + 2 # Length of name_to_display plus ": "
57+ recording_string_space = len (self . name ) + 2 # Length of self.name plus ": "
6158 white_space_to_align_with_first_line = " " * recording_string_space
6259 second_line = white_space_to_align_with_first_line + txt [split_index + 1 :].lstrip ()
6360 txt = first_line + "\n " + second_line
@@ -97,21 +94,21 @@ def list_to_string(lst, max_size=6):
9794 return txt
9895
9996 def _repr_header (self ):
100- class_name = self .__class__ .__name__
101- name_to_display = class_name
10297 num_segments = self .get_num_segments ()
10398 num_channels = self .get_num_channels ()
104- sf_khz = self .get_sampling_frequency () / 1000.0
99+ sf_hz = self .get_sampling_frequency ()
100+ sf_khz = sf_hz / 1000
105101 dtype = self .get_dtype ()
106102
107103 total_samples = self .get_total_samples ()
108104 total_duration = self .get_total_duration ()
109105 total_memory_size = self .get_total_memory_size ()
106+ sampling_frequency_repr = f"{ sf_khz :0.1f} kHz" if sf_hz > 10_000.0 else f"{ sf_hz :0.1f} Hz"
110107
111108 txt = (
112- f"{ name_to_display } : "
109+ f"{ self . name } : "
113110 f"{ num_channels } channels - "
114- f"{ sf_khz :0.1f } kHz - "
111+ f"{ sampling_frequency_repr } - "
115112 f"{ num_segments } segments - "
116113 f"{ total_samples :,} samples - "
117114 f"{ convert_seconds_to_str (total_duration )} - "
0 commit comments