Add n_recent_trials to plot_timeline#6110
Merged
HideakiImamura merged 6 commits intooptuna:masterfrom May 31, 2025
Merged
Conversation
n_recent_trials to plot_timeline
Member
|
@msdsm Could you fill in the PR description, please? |
Member
|
Memo: "Recent trials" are defined by the trial number (not start datetime or finish datetime. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6110 +/- ##
==========================================
- Coverage 88.36% 88.35% -0.01%
==========================================
Files 207 207
Lines 14002 14010 +8
==========================================
+ Hits 12373 12379 +6
- Misses 1629 1631 +2 ☔ View full report in Codecov by Sentry. |
| ) -> None: | ||
| states = [TrialState.COMPLETE, TrialState.PRUNED, TrialState.FAIL, TrialState.RUNNING] | ||
| study = _create_study(states) | ||
| with pytest.raises(ValueError, match="n_recent_trials must be a positive integer or None"): |
Member
There was a problem hiding this comment.
Checking error messages can be fragile, so let me remove the match argument in a follow-up PR.
toshihikoyanase
added a commit
to toshihikoyanase/optuna
that referenced
this pull request
May 31, 2025
nabenabe0928
added a commit
that referenced
this pull request
Jun 4, 2025
Improve test cases for `n_recent_trials` of `plot_timeline` (follow-up #6110).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description of the changes
Added
n_recent_trialsparameter toplot_timeline()to limit the number of trials displayed.Changes
n_recent_trials: int | None = NoneparameterValueErrorifn_recent_trials <= 0Usage