Skip to content

Make all arguments of TPESampler keyword-only#6041

Merged
y0z merged 3 commits intooptuna:masterfrom
sawa3030:set-positional-args
May 7, 2025
Merged

Make all arguments of TPESampler keyword-only#6041
y0z merged 3 commits intooptuna:masterfrom
sawa3030:set-positional-args

Conversation

@sawa3030
Copy link
Copy Markdown
Collaborator

@sawa3030 sawa3030 commented Apr 14, 2025

Motivation

The consider_prior argument in TPESampler will be deprecated, as outlined in #6007. To prepare for this removal, all arguments of TPESampler are now defined as keyword-only.

Description of the Changes

  • Updated the TPESampler constructor to make all arguments keyword-only.
  • Maintained backward compatibility by using the @convert_positional_args decorator.

@c-bata
Copy link
Copy Markdown
Member

c-bata commented Apr 14, 2025

@y0z @kAIto47802 Could you review this PR?

@c-bata c-bata added the compatibility Change that breaks compatibility. label Apr 14, 2025
@nabenabe0928 nabenabe0928 added this to the v4.4.0 milestone Apr 16, 2025
@sawa3030
Copy link
Copy Markdown
Collaborator Author

@y0z @kAIto47802 I'd appreciate it if you could take a look at this PR. Thank you in advance!

y0z
y0z previously approved these changes Apr 23, 2025
@y0z y0z removed their assignment Apr 23, 2025
Copy link
Copy Markdown
Member

@not522 not522 left a comment

Choose a reason for hiding this comment

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

Since the arguments after consider_prior will be shifted, isn't it necessary to make all positional arguments keyword-only?

@y0z y0z self-assigned this Apr 25, 2025
@y0z y0z dismissed their stale review April 25, 2025 04:03

I have some concerns, so please review again.

@sawa3030 sawa3030 changed the title Deprecate positional usage of consider_prior in TPESampler Make all arguments of TPESampler keyword-only Apr 25, 2025
@sawa3030
Copy link
Copy Markdown
Collaborator Author

I have made the updates! I have also confirmed that all usages of TPESampler within Optuna use keyword arguments only.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 4, 2025

This pull request has not seen any recent activity.

@github-actions github-actions bot added the stale Exempt from stale bot labeling. label May 4, 2025
Copy link
Copy Markdown
Member

@y0z y0z left a comment

Choose a reason for hiding this comment

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

LGTM

@y0z y0z removed their assignment May 7, 2025
Copy link
Copy Markdown
Collaborator

@kAIto47802 kAIto47802 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 PR! LGTM.

@kAIto47802 kAIto47802 removed their assignment May 7, 2025
@y0z y0z merged commit 10344d9 into optuna:master May 7, 2025
14 checks passed
@c-bata c-bata removed the stale Exempt from stale bot labeling. label Jun 12, 2025
@sawa3030 sawa3030 deleted the set-positional-args branch November 14, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility Change that breaks compatibility.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants