@@ -25,7 +25,7 @@ def info_cmd():
2525 sdat = stagyydata .StagyyData ()
2626 lsnap = sdat .snaps [- 1 ]
2727 lstep = sdat .steps [- 1 ]
28- print ('StagYY run in {}' . format ( sdat .path ) )
28+ print (f 'StagYY run in { sdat .path } ' )
2929 if lsnap .geom .threed :
3030 dimension = '{} x {} x {}' .format (lsnap .geom .nxtot ,
3131 lsnap .geom .nytot ,
@@ -45,9 +45,9 @@ def info_cmd():
4545 print ()
4646 for step in sdat .walk :
4747 is_snap = step .isnap is not None
48- print ('Step {}/{}' . format ( step .istep , lstep .istep ) , end = '' )
48+ print (f 'Step { step .istep } / { lstep .istep } ' , end = '' )
4949 if is_snap :
50- print (', snapshot {}/{}' . format ( step .isnap , lsnap .isnap ) )
50+ print (f ', snapshot { step .isnap } / { lsnap .isnap } ' )
5151 else :
5252 print ()
5353 series = step .timeinfo .loc [varlist ]
@@ -95,7 +95,7 @@ def _pretty_print(key_val, sep=': ', min_col_width=39, text_width=None):
9595 wrapper .subsequent_indent = ' '
9696 else :
9797 wrapper .subsequent_indent = ' ' * (len (key ) + len (sep ))
98- lines .extend (wrapper .wrap ('{}{}{}' . format ( key , sep , val ) ))
98+ lines .extend (wrapper .wrap (f' { key } { sep } { val } ' ))
9999
100100 chunks = []
101101 for rem_col in range (ncols , 1 , - 1 ):
@@ -107,7 +107,7 @@ def _pretty_print(key_val, sep=': ', min_col_width=39, text_width=None):
107107 chunks .append (lines )
108108 lines = zip_longest (* chunks , fillvalue = '' )
109109
110- fmt = '|' .join (['{{:{}}}' . format ( colw ) ] * (ncols - 1 ))
110+ fmt = '|' .join ([f '{{:{ colw } }}' ] * (ncols - 1 ))
111111 fmt += '|{}' if ncols > 1 else '{}'
112112 print (* (fmt .format (* line ) for line in lines ), sep = '\n ' )
113113
@@ -157,7 +157,7 @@ def version_cmd():
157157
158158 Use :data:`stagpy.__version__` to obtain the version in a script.
159159 """
160- print ('stagpy version: {}' . format ( __version__ ) )
160+ print (f 'stagpy version: { __version__ } ' )
161161
162162
163163def report_parsing_problems (parsing_out ):
@@ -191,7 +191,7 @@ def config_pp(subs):
191191 opt += ' (c)' if meta .cmd_arg else ' (f)'
192192 hlp_lst .append ((opt , meta .help ))
193193 if hlp_lst :
194- print ('{ }:'. format ( sub ) )
194+ print (f' { sub } :' )
195195 _pretty_print (hlp_lst , sep = ' -- ' ,
196196 text_width = min (get_terminal_size ().columns , 100 ))
197197 print ()
0 commit comments