Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the bug while renaming a study with maximize direction #571

Merged
merged 3 commits into from
Aug 25, 2023

Conversation

lucasmrdt
Copy link

@lucasmrdt lucasmrdt commented Aug 24, 2023

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code.
This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

none

What does this implement/fix? Explain your changes.

In version 0.12.0, if a study with the maximize direction is renamed, it results in a new study being created with the minimize direction. To address this, I've transferred the original study's directions to the newly created study.

Copy link
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.

@lucasmrdt Good catch! Thank you for your pull request.

I left one comment. Could you update the PR?

Comment on lines 147 to 149
dst_study = optuna.create_study(
storage=storage, study_name=dst_study_name, directions=summary.directions
)
Copy link
Member

@c-bata c-bata Aug 25, 2023

Choose a reason for hiding this comment

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

You can get directions of the source study from a src_study object. So you don't need to get study_summary object.

Could you apply the following suggestion and remove L142-L145?

Suggested change
dst_study = optuna.create_study(
storage=storage, study_name=dst_study_name, directions=summary.directions
)
dst_study = optuna.create_study(
storage=storage, study_name=dst_study_name, directions=src_study.directions
)

Copy link
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 💯 Thank you for your contribution.

@c-bata c-bata merged commit bcf1f7d into optuna:main Aug 25, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants