#NEWLINE# def test_out_of_bounds_fill( self ) : #NEWLINE# #INDENT# ( points , values ) = self . _get_sample_4d ( ) #NEWLINE# interp = RegularGridInterpolator ( self , values , bounds_error = False , fill_value = np . nan ) #NEWLINE# sample = np . asarray ( [ [ ( - 0.1 ) , ( - 0.1 ) , ( - 0.1 ) , ( - 0.1 ) ] , [ 1.1 , 1.1 , 1.1 , 1.1 ] , [ 2.1 , 2.1 , ( - 1.1 ) , ( - 1.1 ) ] ] ) #NEWLINE# wanted = np . asarray ( [ np . nan , np . nan , np . nan ] ) #NEWLINE# assert_array_almost_equal ( interp ( sample , method = 'nearest' ) , wanted ) #NEWLINE# assert_array_almost_equal ( interp ( sample , method = 'linear' ) , wanted ) #NEWLINE# sample = np . asarray ( [ [ 0.1 , 0.1 , 1.0 , 0.9 ] , [ 0.2 , 0.1 , 0.45 , 0.8 ] , [ 0.5 , 0.5 , 0.5 , 0.5 ] ] ) #NEWLINE# wanted = np . asarray ( [ 1001.1 , 846.2 , 555.5 ] ) #NEWLINE# assert_array_almost_equal ( interp ( sample ) , wanted )