raiseTypeError("The value for metainfo '{}' is not of scalar nature.".format(metaName))
# Check that the metainfo should be scalar
metainfo_shape=dataManager.metaInfo.shape
ifmetainfo_shapeisnotNone:
iflen(metainfo_shape)!=0:
raiseTypeError("The metainfo '{}' does not support scalar values. Check the shape attribute of the metainfo and use the function addArrayValues() instead if the value should be an array.".format(metaName))
raiseTypeError("The given value for metainfo '{}' is of incorrrect type. The type was '{}' when it should be one of '{}'".format(metaName,actual_numpy_type,numpy_types))
raiseTypeError("The value provided for '{}' is not a valid numpy array. Please only push numpy arrays with the backend function addArrayValues().".format(metaName))
# Check that the metainfo should be an array
metainfo_shape=dataManager.metaInfo.shape
iflen(metainfo_shape)==0:
raiseTypeError("The metainfo '{}' does not support arrays. Check the shape attribute of the metainfo and use the function addValue() instead if the value should be scalar.".format(metaName))
# Check the number of dimensions
array_shape=values.shape
len_meta_dim=len(metainfo_shape)
len_array_dim=len(array_shape)
iflen_array_dim!=len_meta_dim:
raiseTypeError("Incompatible shape provided for metainfo '{}'. The shape was '{}' whereas it should be '{}'. Check the shape attribute of the metainfo".format(metaName,array_shape,metainfo_shape))
# If the shapes are given as integers in the metainfo we can also
# check the number of values in each dimension
try:
[int(x)forxinmetainfo_shape]
exceptException:
pass
else:
forindexinrange(len_meta_dim):
array_dim=array_shape[index]
metainfo_dim=metainfo_shape[index]
ifarray_dim!=metainfo_dim:
raiseTypeError("Incompatible shape provided for metainfo '{}'. The shape was '{}' whereas it should be '{}'. Check the shape attribute of the metainfo".format(metaName,array_shape,metainfo_shape))
raiseException("Cannot set array values for metadata %s to section %d (%d) of %s, as it is not open"%(valueMetaInfo.name,gI,gIndex,self.metaInfo.name))
raiseException("Cannot add array values for metadata %s to section %d (%d) of %s, as it is not open"%(valueMetaInfo.name,gI,gIndex,self.metaInfo.name))