#NEWLINE# def test_swr_binary_qm( ipos = 2 ) : #NEWLINE# #INDENT# import flopy #NEWLINE# fpth = os . path . join ( pth , files [ kswrkstpkper ] ) #NEWLINE# sobj = flopy . utils . SwrFlow ( fpth ) #NEWLINE# assert isinstance ( sobj , flopy . utils . SwrFlow ) , 'SwrFlow object not created' #NEWLINE# nrecords = sobj . get_nrecords ( ) #NEWLINE# assert ( nrecords == ( 40 , 18 ) ) , 'SwrFlow records does not equal (40, 18)' #NEWLINE# connect = sobj . get_connectivity ( ) #NEWLINE# assert ( connect . shape == ( 40 , 3 ) ) , 'SwrFlow connectivity shape does not equal (40, 3)' #NEWLINE# ntimes = sobj . get_ntimes ( ) #NEWLINE# assert ( ntimes == 336 ) , 'SwrFlow ntimes does not equal 336' #NEWLINE# for idx in range ( ntimes ) : #NEWLINE# #INDENT# r = sobj . get_data ( idx = idx ) #NEWLINE# assert ( r is not None ) , 'SwrFlow could not read data with get_data(idx=)' #NEWLINE# assert ( r . shape == ( 40 , ) ) , 'SwrFlow qm data shape does not equal (40,)' #NEWLINE# assert ( len ( r . dtype . names ) == 3 ) , 'SwrFlow qm data dtype does not have 3 entries' #NEWLINE# #UNINDENT# kswrkstpkper = sobj . get_kswrkstpkper ( ) #NEWLINE# assert ( kswrkstpkper . shape == ( 336 , 3 ) ) , 'SwrFlow kswrkstpkper shape does not equal (336, 3)' #NEWLINE# for kkk in kswrkstpkper : #NEWLINE# #INDENT# r = sobj . get_data ( kswrkstpkper = kkk ) #NEWLINE# assert ( r is not None ) , 'SwrFlow could not read data with get_data(kswrkstpkper=)' #NEWLINE# assert ( r . shape == ( 40 , ) ) , 'SwrFlow qm data shape does not equal (40,)' #NEWLINE# assert ( len ( r . dtype . names ) == 3 ) , 'SwrFlow qm data dtype does not have 3 entries' #NEWLINE# #UNINDENT# times = sobj . get_times ( ) #NEWLINE# assert ( len ( times ) == 336 ) , 'SwrFlow times length does not equal 336' #NEWLINE# for time in times : #NEWLINE# #INDENT# r = sobj . get_data ( totim = time ) #NEWLINE# assert ( r is not None ) , 'SwrFlow could not read data with get_data(tottim=)' #NEWLINE# assert ( r . shape == ( 40 , ) ) , 'SwrFlow qm data shape does not equal (40,)' #NEWLINE# assert ( len ( r . dtype . names ) == 3 ) , 'SwrFlow qm data dtype does not have 3 entries' #NEWLINE# #UNINDENT# ts = sobj . get_ts ( irec = 17 , iconn = 16 ) #NEWLINE# assert ( ts . shape == ( 336 , ) ) , 'SwrFlow qm timeseries shape does not equal (336,)' #NEWLINE# assert ( len ( ts . dtype . names ) == 3 ) , 'SwrFlow time series qm data dtype does not have 3 entries' #NEWLINE# ts2 = sobj . get_ts ( irec = 16 , iconn = 17 ) #NEWLINE# assert ( ts2 . shape == ( 336 , ) ) , 'SwrFlow qm timeseries shape does not equal (336,)' #NEWLINE# assert ( len ( ts2 . dtype . names ) == 3 ) , 'SwrFlow time series qm data dtype does not have 3 entries' #NEWLINE# return