#NEWLINE# def __sub__( self , PB ) : #NEWLINE# #INDENT# ' Subtract. Returns new ParamBag object with fields equal to self - PB.\n    ' #NEWLINE# if ( ( self . K != PB . K ) or ( self . D != PB . D ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Dimension mismatch' ) #NEWLINE# #UNINDENT# PBdiff = ParamBag ( K = self . K , D = self . D , doCollapseK1 = self . doCollapseK1 ) #NEWLINE# for key in self . _FieldDims : #NEWLINE# #INDENT# arrA = getattr ( self , key ) #NEWLINE# arrB = getattr ( PB , key ) #NEWLINE# PBdiff . setField ( key , ( arrA - arrB ) , dims = self . _FieldDims [ key ] ) #NEWLINE# #UNINDENT# return PBdiff