[DBG] add dim check for descriptors in datasets
@@ -42,6 +42,16 @@ class DatasetBase:
self.descriptors = descriptors
self.obs_descriptors = obs_descriptors
self.channel_descriptors = channel_descriptors
+ if obs_descriptors is not None:
+ if check_dict_length(obs_descriptors,self.n_obs):
+ raise AttributeError(
+ "obs_descriptors have mismatched dimension with measurements."
+ )
+ if channel_descriptors is not None:
+ if check_dict_length(channel_descriptors,self.n_channel):
+ raise AttributeError(
+ "channel_descriptors have mismatched dimension with measurements."
+ )
def split_obs(self, by):
""" Returns a list Datasets splited by obs
