#NEWLINE# def test_ciede94( ) : #NEWLINE# #INDENT# data = load_ciede2000_data ( ) #NEWLINE# N = len ( data ) #NEWLINE# lab1 = np . zeros ( ( N , 3 ) ) #NEWLINE# lab1 [ : , 0 ] = data [ 'L1' ] #NEWLINE# lab1 [ : , 1 ] = data [ 'a1' ] #NEWLINE# lab1 [ : , 2 ] = data [ 'b1' ] #NEWLINE# lab2 = np . zeros ( ( N , 3 ) ) #NEWLINE# lab2 [ : , 0 ] = data [ 'L2' ] #NEWLINE# lab2 [ : , 1 ] = data [ 'a2' ] #NEWLINE# lab2 [ : , 2 ] = lab2 [ 'b2' ] #NEWLINE# dE2 = deltaE_ciede94 ( lab1 , lab2 ) #NEWLINE# oracle = np . array ( [ 1.39503887 , 1.93410055 , 2.45433566 , 0.68449187 , 0.6695627 , 0.69194527 , 2.23606798 , 2.03163832 , 4.80069441 , 4.80069445 , 4.80069449 , 4.80069453 , 4.80069441 , 4.80069445 , 4.80069449 , 3.40774352 , 34.6891632 , 29.44137328 , 27.91408781 , 24.93766082 , 0.82213163 , 0.71658427 , 0.8048753 , 0.75284394 , 1.39099471 , 1.24808929 , 1.29795787 , 1.82045088 , 2.55613309 , 1.42491303 , 1.41945261 , 2.3225685 , 0.93853308 , 1.30654464 ] ) #NEWLINE# assert_allclose ( dE2 , oracle , rtol = 1e-08 )