#NEWLINE# def test_one_dim_bi_fidelity_training( self ) : #NEWLINE# #INDENT# model = set_as_top ( Assembly ( ) ) #NEWLINE# model . add ( 'meta' , MultiFiMetaModel ( params = ( 'x' , ) , responses = ( 'y' , ) , nfi = 2 ) ) #NEWLINE# model . driver . workflow . add ( 'meta' ) #NEWLINE# model . meta . params . x = [ 0.0 , 0.4 , 1.0 ] #NEWLINE# model . meta . params . x_fi2 = [ 0.1 , 0.2 , 0.3 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 0.0 , 0.4 , 1.0 ] #NEWLINE# model . meta . responses . y = [ 3.02720998 , 0.11477697 , 15.82973195 ] #NEWLINE# model . meta . responses . y_fi2 = [ ( - 9.32828839 ) , ( - 8.31986355 ) , ( - 7.00778837 ) , ( - 4.54535129 ) , ( - 4.0747189 ) , ( - 5.30287702 ) , ( - 4.47456522 ) , 1.85597517 , ( - 8.48639501 ) , ( - 5.94261151 ) , 7.91486597 ] #NEWLINE# mock_surr = MockSurrogate ( ) #NEWLINE# mock_surr . train_multifi = mock . Mock ( ) #NEWLINE# model . meta . surrogates [ 'y' ] = mock_surr #NEWLINE# model . meta . run ( ) #NEWLINE# expected_xtrain = [ [ [ 0.0 ] , [ 0.4 ] , [ 1.0 ] ] , [ [ 0.1 ] , [ 0.2 ] , [ 0.3 ] , [ 0.5 ] , [ 0.6 ] , [ 0.7 ] , [ 0.8 ] , [ 0.9 ] , [ 0.0 ] , [ 0.4 ] , [ 1.0 ] ] ] #NEWLINE# expected_ytrain = [ [ 3.02720998 , 0.11477697 , 15.82973195 ] , [ ( - 9.32828839 ) , ( - 8.31986355 ) , ( - 7.00778837 ) , ( - 4.54535129 ) , ( - 4.0747189 ) , ( - 5.30287702 ) , ( - 4.47456522 ) , 1.85597517 , ( - 8.48639501 ) , ( - 5.94261151 ) , 7.91486597 ] ] #NEWLINE# mock_surr . train_multifi . assert_called_with ( expected_xtrain , expected_ytrain )