Skip to content

Commit

Permalink
use f-strings instead of .format()
Browse files Browse the repository at this point in the history
  • Loading branch information
pesekon2 committed Jul 28, 2023
1 parent f72df2f commit 961aa5b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/raster/r.sun.daily/r.sun.daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,7 @@ def maps_sum(out_, basename, suffixes):
Sum up multiple raster maps
"""
maps = "+".join([basename + suf for suf in suffixes])
grass.mapcalc(
"{out_} = {new}".format(out_=out_, new=maps), overwrite=True, quiet=True
)
grass.mapcalc(f"{out_} = {maps}", overwrite=True, quiet=True)


def maps_avg(out_, basename, suffixes):
Expand All @@ -457,9 +455,7 @@ def maps_avg(out_, basename, suffixes):
"""
maps = "+".join([basename + suf for suf in suffixes])
grass.mapcalc(
"{out_} = ({new}) / {maps_count}".format(
out_=out_, new=maps, maps_count=len(suffixes)
),
f"{out_} = ({maps}) / {len(suffixes)}",
overwrite=True,
quiet=True,
)
Expand Down

0 comments on commit 961aa5b

Please sign in to comment.