NCAR / ccpp-framework

Common Community Physics Package (CCPP)
http://www.dtcenter.org/community-code/common-community-physics-package-ccpp/
Other
26 stars 63 forks source link

Convert old python strings to f-strings #501

Open peverwhee opened 10 months ago

peverwhee commented 10 months ago

Description

Now that we've removed support for python2 "officially" we should make an effort to go through and change all the old ".format" strings to "f" strings

Solution

Find all the old ".format()" strings and change them to "f" strings (with "{}" grammar). For example, changing:

ofile.write("end subroutine {}".format(API.__part_fname), 1)

To:

ofile.write(f"end subroutine {API.__part_fname}", 1)

Related to (optional)

Issue came up in https://github.com/NCAR/ccpp-framework/pull/493