#NEWLINE# def test_bin_1D( ) : #NEWLINE# #INDENT# x = np . linspace ( 0 , 1 , 100 ) #NEWLINE# y = np . arange ( 100 ) #NEWLINE# nx = 10 #NEWLINE# ( edges , val , count ) = core . bin_1D ( x , y , nx ) #NEWLINE# assert_array_almost_equal ( edges , np . linspace ( 0 , 1 , ( nx + 1 ) , endpoint = True ) ) #NEWLINE# assert_array_almost_equal ( val , np . sum ( y . reshape ( nx , ( - 1 ) ) , axis = 1 ) ) #NEWLINE# assert_array_equal ( count , ( np . ones ( nx ) * 10 ) )