#NEWLINE# def test_quantiles_uneven_buckets( self ) : #NEWLINE# #INDENT# permute = partial ( permute_rows , 5 ) #NEWLINE# shape = ( 5 , 5 ) #NEWLINE# factor_data = permute ( log1p ( arange ( 25 , dtype = float ) . reshape ( shape ) ) ) #NEWLINE# mask_data = permute ( self . eye_mask ( shape = shape ) ) #NEWLINE# f = F ( ) #NEWLINE# m = Mask ( ) #NEWLINE# permuted_array = compose ( permute , partial ( array , dtype = int64_dtype ) ) #NEWLINE# self . check_terms ( terms = { #NEWLINE# #INDENT# '3_masked' : f . quantiles ( bins = 3 , mask = m ) , #NEWLINE# '7_masked' : f . quantiles ( bins = 7 , mask = m ) , #NEWLINE# #UNINDENT# } , initial_workspace = { #NEWLINE# #INDENT# f : factor_data , #NEWLINE# m : mask_data , #NEWLINE# #UNINDENT# } , expected = { #NEWLINE# #INDENT# '3_masked' : permuted_array ( [ [ ( - 1 ) , 0 , 0 , 1 , 2 ] , [ 0 , ( - 1 ) , 0 , 1 , 2 ] , [ 0 , 0 , ( - 1 ) , 1 , 2 ] , [ 0 , 0 , 1 , ( - 1 ) , 2 ] , [ 0 , 0 , 1 , 2 , ( - 1 ) ] ] ) , #NEWLINE# '7_masked' : permuted_array ( [ [ ( - 1 ) , 0 , 2 , 4 , 6 ] , [ 0 , ( - 1 ) , 2 , 4 , 6 ] , [ 0 , 2 , ( - 1 ) , 4 , 6 ] , [ 0 , 2 , 4 , ( - 1 ) , 6 ] , [ 0 , 2 , 4 , 6 , ( - 1 ) ] ] ) , #NEWLINE# #UNINDENT# } , mask = self . build_mask ( self . ones_mask ( shape = shape ) ) )