#NEWLINE# def test_concat_constant_index( self ) : #NEWLINE# #INDENT# ds1 = Dataset ( { #NEWLINE# #INDENT# 'foo' : 1.5 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'y' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# ds2 = Dataset ( { #NEWLINE# #INDENT# 'foo' : 2.5 , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'y' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# expected = Dataset ( { #NEWLINE# #INDENT# 'foo' : ( 'y' , [ 1.5 , 2.5 ] ) , #NEWLINE# 'y' : [ 1 , 1 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# for mode in [ 'different' , 'all' , [ 'foo' ] ] : #NEWLINE# #INDENT# actual = concat ( [ ds1 , ds2 ] , 'y' , data_vars = mode ) #NEWLINE# self . assertDatasetIdentical ( expected , actual ) #NEWLINE# #UNINDENT# with self . assertRaisesRegexp ( ValueError , 'not equal across datasets' ) : #NEWLINE# #INDENT# concat ( [ ds1 , ds1 ] , 'y' , data_vars = 'minimal' )