added __str__ function to TemporalDataset
@@ -360,6 +360,26 @@ class TemporalDataset(Dataset):
self.channel_descriptors = parse_input_descriptor(channel_descriptors)
self.time_descriptors = parse_input_descriptor(time_descriptors)
+ def __str__(self):
+ """
+ defines the output of print
+ """
+ string_desc = format_descriptor(self.descriptors)
+ string_obs_desc = format_descriptor(self.obs_descriptors)
+ string_channel_desc = format_descriptor(self.channel_descriptors)
+ string_time_desc = format_descriptor(self.time_descriptors)
+ if self.measurements.shape[0] > 5:
+ measurements = self.measurements[:5, :, :]
+ else:
+ measurements = self.measurements
+ return (f'pyrsa.data.{self.__class__.__name__}\n'
+ f'measurements = \n{measurements}\n...\n\n'
+ f'descriptors: \n{string_desc}\n\n'
+ f'obs_descriptors: \n{string_obs_desc}\n\n'
+ f'channel_descriptors: \n{string_channel_desc}\n'
+ f'time_descriptors: \n{string_time_desc}\n'
+ )
+
def split_obs(self, by):
""" Returns a list TemporalDataset splited by obs
