#NEWLINE# def test_roots( self ) : #NEWLINE# #INDENT# x = ( np . linspace ( 0 , 1 , 31 ) ** 2 ) #NEWLINE# y = np . sin ( ( 30 * x ) ) #NEWLINE# spl = splrep ( x , y , s = 0 , k = 3 ) #NEWLINE# pp = PPoly . from_spline ( spl ) #NEWLINE# r = pp . roots ( ) #NEWLINE# r = r [ ( ( r >= ( 0 - 1e-15 ) ) & ( r <= ( 1 + 1e-15 ) ) ) ] #NEWLINE# assert_allclose ( x , sproot ( spl ) , atol = 1e-15 )