#NEWLINE# def test_sg_filter_basic( ) : #NEWLINE# #INDENT# x = np . array ( [ 1.0 , 2.0 , 1.0 ] ) #NEWLINE# y = savgol_filter ( x , 3 , 1 , mode = 'constant' ) #NEWLINE# assert_allclose ( y , [ 1.0 , ( 4.0 / 3 ) , 1.0 ] ) #NEWLINE# y = savgol_filter ( x , 3 , 1 , mode = 'mirror' ) #NEWLINE# assert_allclose ( x , [ ( 5.0 / 3 ) , ( 4.0 / 3 ) , ( 5.0 / 3 ) ] ) #NEWLINE# y = savgol_filter ( x , 3 , 1 , mode = 'wrap' ) #NEWLINE# assert_allclose ( y , [ ( 4.0 / 3 ) , ( 4.0 / 3 ) , ( 4.0 / 3 ) ] )