NCAR / NCAR/ccpp-framework

Convert old python strings to f-strings

Open
#501 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
25
Forks
67
Avg merge
3d 8h
Merged PRs (30d)
2

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for old .format() strings and review the context of PR #493 first. Convert applicable Python 2-era formatting to f-strings, then verify that the repository's existing checks still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.