#NEWLINE# def test_init( self ) : #NEWLINE# #INDENT# '\n        Test the creation of binomial nodes.\n        ' #NEWLINE# X = Binomial ( 10 , 0.5 ) #NEWLINE# X = Binomial ( 10 , Beta ( [ 2 , 3 ] ) ) #NEWLINE# X = Binomial ( 10 , 0.7 , plates = ( 4 , 3 ) ) #NEWLINE# self . assertEqual ( X . plates , ( 4 , 3 ) ) #NEWLINE# X = Binomial ( 10 , ( 0.7 * np . ones ( ( 4 , 3 ) ) ) ) #NEWLINE# self . assertEqual ( X . plates , ( 4 , 3 ) ) #NEWLINE# n = np . ones ( ( 4 , 3 ) , dtype = np . int ) #NEWLINE# X = Binomial ( n , 0.7 ) #NEWLINE# self . assertEqual ( X . plates , ( 4 , 3 ) ) #NEWLINE# X = Binomial ( 10 , Beta ( [ 4 , 3 ] , plates = ( 4 , 3 ) ) ) #NEWLINE# self . assertEqual ( X . plates , ( 4 , 3 ) ) #NEWLINE# self . assertRaises ( ValueError , Binomial , 10 , ( - 0.5 ) ) #NEWLINE# self . assertRaises ( ValueError , Binomial , 10 , 1.5 ) #NEWLINE# self . assertRaises ( ValueError , Binomial , ( - 1 ) , 0.5 ) #NEWLINE# self . assertRaises ( ValueError , Binomial , 8.5 , 0.5 ) #NEWLINE# self . assertRaises ( ValueError , Binomial , 10 , ( 0.5 * np . ones ( 4 ) ) , plates = ( 3 , ) ) #NEWLINE# self . assertRaises ( ValueError , Binomial , 10 , ( 0.5 * np . ones ( 4 ) ) , plates = ( 1 , ) ) #NEWLINE# pass