#NEWLINE# def _raiseDimError( self , dims , badArr , key = None ) : #NEWLINE# #INDENT# ' Raise ValueError when expected dimensions for array are not met.\n    ' #NEWLINE# expectShape = self . _getExpectedShape ( dims = dims ) #NEWLINE# if ( msg is None ) : #NEWLINE# #INDENT# msg = ( 'Bad Dims. Expected %s, got %s' % ( expectShape , badArr . shape ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# msg = ( 'Bad Dims for field %s. Expected %s, got %s' % ( key , expectShape , badArr . shape ) ) #NEWLINE# #UNINDENT# raise ValueError ( msg )