Skip to content

Replace .format with f-strings in optuna/importance/_base#6342

Merged
sawa3030 merged 3 commits intooptuna:masterfrom
VihaanMotwani:refactor-fstrings-importance-base
Nov 19, 2025
Merged

Replace .format with f-strings in optuna/importance/_base#6342
sawa3030 merged 3 commits intooptuna:masterfrom
VihaanMotwani:refactor-fstrings-importance-base

Conversation

@VihaanMotwani
Copy link
Copy Markdown
Contributor

Motivation

This pull request addresses part of #6305 by replacing usages of .format(...) with f-strings.
The goal is to improve readability and maintain consistency with modern Python practices.

Description of the changes

  • Replaced all .format() calls in optuna/importance/_base.py with f-strings.
  • Split long lines where necessary to comply with flake8's line-length limits.

Copy link
Copy Markdown
Member

@c-bata c-bata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@c-bata c-bata added the code-fix Change that does not change the behavior, such as code refactoring. label Nov 17, 2025
@c-bata c-bata added this to the v4.7.0 milestone Nov 17, 2025
@c-bata
Copy link
Copy Markdown
Member

c-bata commented Nov 18, 2025

@sawa3030 Could you review this PR?

@c-bata
Copy link
Copy Markdown
Member

c-bata commented Nov 18, 2025

@VihaanMotwani Thank you for your pull request.

Sorry for the extra work, but due to the recent update in the branch protection rule after #6339, could you please merge the latest master branch into yours? 🙏

@VihaanMotwani
Copy link
Copy Markdown
Contributor Author

VihaanMotwani commented Nov 18, 2025

hey! I merged the latest master into this branch. Github seems to be facing issues right now which might explain why CI failed: https://www.githubstatus.com/. I will try running them again once things are fixed.
CI checks are currently failing with:
fatal: unable to access 'https://github.com/optuna/optuna/': The requested URL returned error: 500 while cloning https://github.com/optuna/optuna/.

Copy link
Copy Markdown
Collaborator

@sawa3030 sawa3030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. LGTM!

@sawa3030 sawa3030 merged commit 11656bd into optuna:master Nov 19, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-fix Change that does not change the behavior, such as code refactoring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants