#NEWLINE# def test_group_get_referenced_vars_by_compname( self ) : #NEWLINE# #INDENT# self . top . driver . add_parameter ( ( 'comp.a' , 'comp.b' ) , 0 , 1e+99 ) #NEWLINE# self . top . driver . add_parameter ( ( 'comp.c' , 'comp.d' ) , 0 , 1e+99 ) #NEWLINE# params = self . top . driver . get_parameters ( ) #NEWLINE# data = params [ ( 'comp.a' , 'comp.b' ) ] . get_referenced_vars_by_compname ( ) #NEWLINE# self . assertEqual ( [ 'comp' ] , data . keys ( ) ) #NEWLINE# self . assertEqual ( set ( [ param . target for param in data [ 'comp' ] ] ) , set ( [ 'comp.a' , 'comp.b' ] ) ) #NEWLINE# data = params [ ( 'comp.c' , 'comp.d' ) ] . get_referenced_vars_by_compname ( ) #NEWLINE# self . assertEqual ( [ 'comp' ] , data . keys ( ) ) #NEWLINE# self . assertEqual ( set ( [ param . target for param in data [ 'comp' ] ] ) , set ( ( 'comp.c' , 'comp.d' ) ) ) #NEWLINE# self . top . comp . add_trait ( 'v1' , Float ( 0.0 , low = 0.0 , high = 10.0 , iotype = 'in' ) ) #NEWLINE# self . top . comp . v1 = 5.0 #NEWLINE# self . top . driver . add_parameter ( 'comp.v1' , scaler = 0.5 , adder = ( - 2.0 ) ) #NEWLINE# params = self . top . driver . get_parameters ( ) #NEWLINE# self . assertEqual ( params [ 'comp.v1' ] . evaluate ( ) [ 0 ] , 12.0 ) #NEWLINE# self . assertEqual ( params [ 'comp.v1' ] . high , 22.0 ) #NEWLINE# self . assertEqual ( self [ 'comp.v1' ] . low , 2.0 ) #NEWLINE# self . top . comp . add_trait ( 'v2' , Float ( 0.0 , low = 0.0 , high = 10.0 , iotype = 'in' ) ) #NEWLINE# self . top . comp . v1 = 5.0 #NEWLINE# self . top . driver . clear_parameters ( ) #NEWLINE# self . top . driver . add_parameter ( 'comp.v2' , scaler = 0.5 , adder = ( - 2.0 ) , low = 4.0 , high = 18.0 ) #NEWLINE# params = self . top . driver . get_parameters ( ) #NEWLINE# self . assertEqual ( params [ 'comp.v2' ] . high , 18.0 ) #NEWLINE# self . assertEqual ( params [ 'comp.v2' ] . low , 4.0 )