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

Deprecate optuna study optimize command. #1384

Merged
merged 3 commits into from Jun 17, 2020

Conversation

toshihikoyanase
Copy link
Member

Motivation

Optuna provides the CLI to invoke optimization from the shell, but it does not support some features like the pruning and the callback. This PR proposes to remove it in the future instead of adding the new feature support because of the following reasons:

  • the command-line options will be complicated to manage the pruning and callback, and
  • most of the users directly execute their Python scripts.

Description of the changes

This PR adds a deprecation warning to optuna study optimize command.

We need to update the code comment in the example files, but I leave them as they are to keep the diff small.

@toshihikoyanase toshihikoyanase added the compatibility Change that breaks compatibility. label Jun 17, 2020
@toshihikoyanase toshihikoyanase added this to the v2.0.0 milestone Jun 17, 2020
@hvy hvy self-assigned this Jun 17, 2020
Copy link
Member

@hvy hvy left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, the description and changes seem reasonable. I just left a smaller comment on the error message.

optuna/cli.py Outdated Show resolved Hide resolved
toshihikoyanase and others added 2 commits June 17, 2020 16:28
Co-authored-by: Hiroyuki Vincent Yamazaki <hiroyuki.vincent.yamazaki@gmail.com>
@@ -253,7 +253,7 @@ def take_action(self, parsed_args):


class _StudyOptimize(_BaseCommand):
"""Start optimization of a study."""
"""Start optimization of a study. Deprecated since version 2.0.0."""
Copy link
Member

Choose a reason for hiding this comment

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

This message might be a bit difficult to notice blending in, but it's not a strong opinion.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. This message is only shown in the list of commands. Do we remove it?

$ optuna
...
Commands:
  complete       print bash completion command (cliff)
  create-study   Create a new study.
  dashboard      Launch web dashboard (beta).
  delete-study   Delete a specified study.
  help           print detailed help for another command (cliff)
  storage upgrade  Upgrade the schema of a storage.
  studies        Show a list of studies.
  study optimize  Start optimization of a study. Deprecated since version 2.0.0.
  study set-user-attr  Set a user attribute to a study.

Copy link
Member

Choose a reason for hiding this comment

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

I think we don't have to remove it. It's helpful for users.

Copy link
Member

@hvy hvy left a comment

Choose a reason for hiding this comment

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

LGTM!

@HideakiImamura HideakiImamura self-assigned this Jun 17, 2020
Copy link
Member

@HideakiImamura HideakiImamura left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! LGTM!

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.

None yet

3 participants