#NEWLINE# def _write_segment_data( self , i , j , f_sfr ) : #NEWLINE# #INDENT# cols = [ 'nseg' , 'icalc' , 'outseg' , 'iupseg' , 'iprior' , 'nstrpts' , 'flow' , 'runoff' , 'etsw' , 'pptsw' , 'roughch' , 'roughbk' , 'cdpth' , 'fdpth' , 'awdth' , 'bwdth' ] #NEWLINE# fmts = _fmt_string_list ( self . segment_data [ i ] [ cols ] [ j ] ) #NEWLINE# ( nseg , icalc , outseg , iupseg , iprior , nstrpts , flow , runoff , etsw , pptsw , roughch , roughbk , cdpth , fdpth , awdth , bwdth ) = [ ( 0 if ( v == self . default_value ) else v ) for v in self . segment_data [ i ] [ cols ] [ j ] ] #NEWLINE# f_sfr . write ( ( ' ' . join ( fmts [ 0 : 4 ] ) . format ( nseg , icalc , outseg , iupseg ) + ' ' ) ) #NEWLINE# if ( iupseg != 0 ) : #NEWLINE# #INDENT# f_sfr . write ( ( fmts [ 4 ] . format ( iprior ) + ' ' ) ) #NEWLINE# #UNINDENT# if ( icalc == 4 ) : #NEWLINE# #INDENT# f_sfr . write ( ( fmts [ 5 ] . format ( nstrpts ) + ' ' ) ) #NEWLINE# #UNINDENT# f_sfr . write ( ( ' ' . join ( fmts [ 6 : 10 ] ) . format ( flow , runoff , etsw , pptsw ) + ' ' ) ) #NEWLINE# if ( icalc in [ 1 , 2 ] ) : #NEWLINE# #INDENT# f_sfr . write ( ( fmts [ 10 ] . format ( roughch ) + ' ' ) ) #NEWLINE# #UNINDENT# if ( icalc == 2 ) : #NEWLINE# #INDENT# f_sfr . write ( ( fmts [ 11 ] . format ( roughbk ) + ' ' ) ) #NEWLINE# #UNINDENT# if ( icalc == 3 ) : #NEWLINE# #INDENT# f_sfr . write ( ( ' ' . join ( fmts [ 12 : 16 ] ) . format ( cdpth , fdpth , awdth , bwdth ) + ' ' ) ) #NEWLINE# #UNINDENT# f_sfr . write ( '\n' ) #NEWLINE# self . _write_6bc ( i , j , f_sfr , cols = [ 'hcond1' , 'thickm1' , 'elevup' , 'width1' , 'depth1' , 'thts1' , 'thti1' , 'eps1' , 'uhc1' ] ) #NEWLINE# self . _write_6bc ( i , j , f_sfr , cols = [ 'hcond2' , 'thickm2' , 'elevdn' , 'width2' , 'depth2' , 'thts2' , 'thti2' , 'eps2' , 'uhc2' ] )