#NEWLINE# def test_overlap_exception( self ) : #NEWLINE# #INDENT# size = 20 #NEWLINE# top = set_as_top ( Assembly ( ) ) #NEWLINE# top . add ( 'C1' , ABCDArrayComp ( size ) ) #NEWLINE# top . add ( 'C2' , ABCDArrayComp ( size ) ) #NEWLINE# top . add ( 'C3' , ABCDArrayComp ( size ) ) #NEWLINE# top . add ( 'C4' , ABCDArrayComp ( size ) ) #NEWLINE# top . driver . workflow . add ( [ 'C1' , 'C2' , 'C3' , 'C4' ] ) #NEWLINE# top . connect ( 'C1.c[:5]' , 'C2.a' ) #NEWLINE# top . connect ( 'C1.c[3:]' , 'C3.b' ) #NEWLINE# top . connect ( 'C2.c' , 'C4.a' ) #NEWLINE# top . connect ( 'C3.d' , 'C4.b' ) #NEWLINE# top . C1 . a = ( np . ones ( size , float ) * 3.0 ) #NEWLINE# top . C1 . b = ( np . ones ( size , float ) * 7.0 ) #NEWLINE# try : #NEWLINE# #INDENT# top . run ( ) #NEWLINE# #UNINDENT# except Exception as err : #NEWLINE# #INDENT# self . assertEqual ( str ( err ) , "Subvars ['C1.c[3::]', 'C1.c[:5:]'] share overlapping indices. Try reformulating the problem to prevent this." ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( 'Exception expected' )