#NEWLINE# def test_hash_redis_storage_pcabp( self ) : #NEWLINE# #INDENT# train_vectors = numpy . random . randn ( 10 , 100 ) #NEWLINE# hash1 = PCABinaryProjections ( 'testPCABPHash' , 4 , train_vectors ) #NEWLINE# self . redis_storage . store_hash_configuration ( hash1 ) #NEWLINE# hash2 = PCABinaryProjections ( None , None , None ) #NEWLINE# hash2 . apply_config ( self . redis_storage . load_hash_configuration ( 'testPCABPHash' ) ) #NEWLINE# self . assertEqual ( hash1 . dim , hash2 . dim ) #NEWLINE# self . assertEqual ( hash1 . hash_name , hash2 . hash_name ) #NEWLINE# self . assertEqual ( train_vectors . projection_count , hash2 . projection_count ) #NEWLINE# for i in range ( hash1 . components . shape [ 0 ] ) : #NEWLINE# #INDENT# for j in range ( hash1 . components . shape [ 1 ] ) : #NEWLINE# #INDENT# self . assertEqual ( hash1 . components [ ( i , j ) ] , hash2 . components [ ( i , j ) ] )