Skip to content

Use f-strings in _intermediate_values.py#6316

Merged
nabenabe0928 merged 1 commit intooptuna:masterfrom
nihalsiddiqui7:refractor/fstrings-_intermediate_values
Oct 26, 2025
Merged

Use f-strings in _intermediate_values.py#6316
nabenabe0928 merged 1 commit intooptuna:masterfrom
nihalsiddiqui7:refractor/fstrings-_intermediate_values

Conversation

@nihalsiddiqui7
Copy link
Copy Markdown
Contributor

@nihalsiddiqui7 nihalsiddiqui7 commented Oct 25, 2025

Motivation

This PR partially satisfies:

Description of the Changes

Updates visualization/matplotlib/_intermediate_values.py to use f-strings, meeting recent Python standards.

This PR refactors _intermediate_values.py to replace .format() calls with
f-strings for improved readability and consistency.

Example:

label="Trial{}".format(tinfo.trial_number)

label=f"Trial{tinfo.trial_number}"

@nihalsiddiqui7
Copy link
Copy Markdown
Contributor Author

Hi! This PR replaces .format() with f-strings in _intermediate_values.py as part of issue #6305.
All style checks passed, and this is a small one-line change.

@nabenabe0928 nabenabe0928 changed the title refractor: use f-strings in '_intermediate_values.py' Use f-strings in _intermediate_values.py Oct 26, 2025
@nabenabe0928 nabenabe0928 merged commit 3a7d08e into optuna:master Oct 26, 2025
14 checks passed
@nabenabe0928 nabenabe0928 added the code-fix Change that does not change the behavior, such as code refactoring. label Oct 26, 2025
@nabenabe0928 nabenabe0928 added this to the v4.6.0 milestone Oct 26, 2025
@nihalsiddiqui7
Copy link
Copy Markdown
Contributor Author

nihalsiddiqui7 commented Oct 26, 2025

Thanks a lot @nabenabe0928 for the review and merge!

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.

2 participants