Skip to content

Conversation

@msakai
Copy link
Contributor

@msakai msakai commented Nov 11, 2025

Contributor Agreements

Please read the contributor agreements and if you agree, please click the checkbox below.

  • I agree to the contributor agreements.

Tip

Please follow the Quick TODO list to smoothly merge your PR.

Motivation

Sorry, my previous PR #320 has bugs that causes the following runtime errors.

  • NameError: name 'Callable' is not defined. Did you mean: 'callable'?
    • Callable is used in cast(Callable[[gp.GPRegressor], torch.Tensor], ...), but is imported only during type checking.
  • AttributeError: module 'optuna._gp' has no attribute 'acqf'
    • optuna._gp.acqf is used in cast(optuna._gp.acqf.BaseAcquisitionFunc, acqf) and it seems we need to import optuna._gp.acqf explicitly.

Description of the changes

TODO List towards PR Merge

Please remove this section if this PR is not an addition of a new package.
Otherwise, please check the following TODO list:

  • Copy ./template/ to create your package
  • Replace <COPYRIGHT HOLDER> in LICENSE of your package with your name
  • Fill out README.md in your package
  • Add import statements of your function or class names to be used in __init__.py
  • (Optional) Add from __future__ import annotations at the head of any Python files that include typing to support older Python versions
  • Apply the formatter based on the tips in README.md
  • Check whether your module works as intended based on the tips in README.md

@msakai msakai marked this pull request as ready for review November 11, 2025 12:37
Copy link
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.

LGTM!

@not522 not522 merged commit 6818488 into optuna:main Nov 12, 2025
3 checks passed
@msakai msakai deleted the fix-value-at-risk-runtime-errors branch November 12, 2025 06:30
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.

2 participants