Skip to content

Conversation

@nabenabe0928
Copy link
Contributor

@nabenabe0928 nabenabe0928 commented Oct 13, 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

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

multiple_study_list.append(study_list)

plot_multiple_empirical_attainment_surfaces = optunahub.load_module(
"package/visualization/plot_empirical_attainment_surface"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"package/visualization/plot_empirical_attainment_surface"
"visualization/plot_empirical_attainment_surface"

plot_multiple_empirical_attainment_surfaces = optunahub.load_module(
"package/visualization/plot_empirical_attainment_surface"
).plot_multiple_empirical_attainment_surfaces
ax = plot_multiple_empirical_attainment_surfaces(
Copy link
Member

Choose a reason for hiding this comment

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

I got the following error.

Traceback (most recent call last):
    ax = plot_multiple_empirical_attainment_surfaces(
        multiple_study_list, levels=[3, 5, 7], labels=["Random", "TPE"]
    )
TypeError: plot_multiple_empirical_attainment_surfaces() missing 1 required positional argument: 'attainment_ratios'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I renamed the argument, but forgot updating here!

@nabenabe0928
Copy link
Contributor Author

@y0z
Could you review this PR again?

@y0z
Copy link
Member

y0z commented Oct 16, 2025

@nabenabe0928 Thank you for your update.

Then, I encountered another issue.

The documentation says len(attainment_ratios) can be 1.

 `attainment_ratios`: The ratios of studies that need to dominate the surface. The length must be either 1 or 3. If the length is 1, the corresponding attainment surface will be visualized.

However, I got the following error with attainment_ratios=[0.5].

    ax = plot_multiple_empirical_attainment_surfaces(
        multiple_study_list, attainment_ratios=[0.5], labels=["Random", "TPE"]
    )
  File "/Users/yozaki/.cache/optunahub/github.com/optuna/optunahub-registry/f222e6887cc0b2651d9caa827f73a26437bcaf80/package/visualization/plot_empirical_attainment_surface/_wrapper.py", line 100, in plot_multiple_empirical_attainment_surfaces
    ax.legend()
    ^^^^^^^^^
AttributeError: 'list' object has no attribute 'legend'

@nabenabe0928
Copy link
Contributor Author

@y0z
Thank you for the catch, I fixed the issue!

Copy link
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 merged commit 330f27d into optuna:main Oct 16, 2025
3 checks passed
@y0z
Copy link
Member

y0z commented Oct 16, 2025

@nabenabe0928
Although this is optional, providing a thumbnail/generated figure example may be helpful.

@y0z y0z added the new-package New packages label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-package New packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants