@@ -23,7 +23,7 @@ class BaseRecording(BaseRecordingSnippets):
23
23
Internally handle list of RecordingSegment
24
24
"""
25
25
26
- _main_annotations = ["is_filtered" ]
26
+ _main_annotations = BaseRecordingSnippets . _main_annotations + ["is_filtered" ]
27
27
_main_properties = ["group" , "location" , "gain_to_uV" , "offset_to_uV" ]
28
28
_main_features = [] # recording do not handle features
29
29
@@ -45,9 +45,6 @@ def __init__(self, sampling_frequency: float, channel_ids: list, dtype):
45
45
self .annotate (is_filtered = False )
46
46
47
47
def __repr__ (self ):
48
-
49
- class_name = self .__class__ .__name__
50
- name_to_display = class_name
51
48
num_segments = self .get_num_segments ()
52
49
53
50
txt = self ._repr_header ()
@@ -57,7 +54,7 @@ def __repr__(self):
57
54
split_index = txt .rfind ("-" , 0 , 100 ) # Find the last "-" before character 100
58
55
if split_index != - 1 :
59
56
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 ": "
61
58
white_space_to_align_with_first_line = " " * recording_string_space
62
59
second_line = white_space_to_align_with_first_line + txt [split_index + 1 :].lstrip ()
63
60
txt = first_line + "\n " + second_line
@@ -97,21 +94,21 @@ def list_to_string(lst, max_size=6):
97
94
return txt
98
95
99
96
def _repr_header (self ):
100
- class_name = self .__class__ .__name__
101
- name_to_display = class_name
102
97
num_segments = self .get_num_segments ()
103
98
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
105
101
dtype = self .get_dtype ()
106
102
107
103
total_samples = self .get_total_samples ()
108
104
total_duration = self .get_total_duration ()
109
105
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"
110
107
111
108
txt = (
112
- f"{ name_to_display } : "
109
+ f"{ self . name } : "
113
110
f"{ num_channels } channels - "
114
- f"{ sf_khz :0.1f } kHz - "
111
+ f"{ sampling_frequency_repr } - "
115
112
f"{ num_segments } segments - "
116
113
f"{ total_samples :,} samples - "
117
114
f"{ convert_seconds_to_str (total_duration )} - "
0 commit comments