Skip to content

Add hypervolume computation for a zero size array#6245

Merged
c-bata merged 5 commits intooptuna:masterfrom
nabenabe0928:hotfix/add-hv-for-zero-size
Aug 14, 2025
Merged

Add hypervolume computation for a zero size array#6245
c-bata merged 5 commits intooptuna:masterfrom
nabenabe0928:hotfix/add-hv-for-zero-size

Conversation

@nabenabe0928
Copy link
Copy Markdown
Contributor

Motivation

This PR fixes a bug when there exists only one Pareto solution at n_trials=10.
By adding a handling for a zero size array, this issue goes away.

Description of the changes

  • Add a handling for a zero size array.

@nabenabe0928 nabenabe0928 added the bug Issue/PR about behavior that is broken. Not for typos/examples/CI/test but for Optuna itself. label Aug 13, 2025
@nabenabe0928 nabenabe0928 added this to the v4.5.0 milestone Aug 13, 2025
@nabenabe0928 nabenabe0928 marked this pull request as ready for review August 13, 2025 10:56
@kAIto47802
Copy link
Copy Markdown
Collaborator

Thank you for the PR. LGTM

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 14, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.15%. Comparing base (268ebc1) to head (eba34c9).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
optuna/_hypervolume/wfg.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6245      +/-   ##
==========================================
- Coverage   89.24%   89.15%   -0.09%     
==========================================
  Files         208      208              
  Lines       13816    13818       +2     
==========================================
- Hits        12330    12320      -10     
- Misses       1486     1498      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@c-bata c-bata added enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. and removed bug Issue/PR about behavior that is broken. Not for typos/examples/CI/test but for Optuna itself. labels Aug 14, 2025
@c-bata
Copy link
Copy Markdown
Member

c-bata commented Aug 14, 2025

Let me change the label to enhancement since this PR should not be listed on "Bug" section in the release note.

@c-bata c-bata self-assigned this Aug 14, 2025
Copy link
Copy Markdown
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!

@c-bata c-bata merged commit aba5302 into optuna:master Aug 14, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Change that does not break compatibility and not affect public interfaces, but improves performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants