#NEWLINE# def test04( self ) : #NEWLINE# #INDENT# 'Modifying several rows at once, with a step (__setitem__)' #NEWLINE# table = self . table #NEWLINE# formats = table . description . _v_nested_formats #NEWLINE# r = records . array ( [ [ 456 , 'dbe' , 1.2 ] , [ 2 , 'ded' , 1.3 ] ] , formats = formats ) #NEWLINE# table . append ( r ) #NEWLINE# table . append ( [ [ 457 , 'db1' , 1.2 ] , [ 5 , 'de1' , 1.3 ] ] ) #NEWLINE# rows = records . array ( [ [ 457 , 'db1' , 1.2 ] , [ 6 , 'de2' , 1.3 ] ] , formats = formats ) #NEWLINE# table [ 1 : : 2 ] = rows #NEWLINE# r1 = records . array ( [ [ 456 , 'dbe' , 1.2 ] , [ 457 , 'db1' , 1.2 ] , [ 457 , 'db1' , 1.2 ] , [ 6 , 'de2' , 1.3 ] ] , formats = formats , names = 'col1,col2,col3' ) #NEWLINE# if self . reopen : #NEWLINE# #INDENT# self . _reopen ( ) #NEWLINE# table = self . h5file . root . recarray #NEWLINE# table . nrowsinbuf = self . buffersize #NEWLINE# #UNINDENT# r2 = table . read ( ) #NEWLINE# if common . verbose : #NEWLINE# #INDENT# print ( 'Original table-->' , repr ( r2 ) ) #NEWLINE# print ( 'Should look like-->' , repr ( r1 ) ) #NEWLINE# #UNINDENT# self . assertEqual ( r1 . tostring ( ) , r2 . tostring ( ) ) #NEWLINE# self . assertEqual ( table . nrows , 4 )