optuna icon indicating copy to clipboard operation
optuna copied to clipboard

Refactor `_tell.py`

Open not522 opened this issue 2 years ago • 3 comments

Motivation

The implementation of _tell.py is complicated, which causes bugs (#3808, #3814, #3819). This PR adds private methods and simplifies _tell_with_warning.

Description of the changes

  • Add _get_frozen_trial and _check_state_and_values methods
  • Change _check_and_convert_to_values to _check_values

not522 avatar Aug 02 '22 04:08 not522

@knshnb @contramundum53 Could you review this PR?

HideakiImamura avatar Aug 02 '22 06:08 HideakiImamura

@HideakiImamura Should this be merged before v3?

contramundum53 avatar Aug 02 '22 06:08 contramundum53

Codecov Report

Merging #3841 (6f7dc7a) into master (ae7e309) will increase coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3841      +/-   ##
==========================================
+ Coverage   90.57%   90.60%   +0.02%     
==========================================
  Files         167      167              
  Lines       13111    13109       -2     
==========================================
+ Hits        11875    11877       +2     
+ Misses       1236     1232       -4     
Impacted Files Coverage Δ
optuna/study/_optimize.py 98.44% <ø> (ø)
optuna/study/study.py 94.53% <ø> (ø)
optuna/study/_tell.py 100.00% <100.00%> (+2.00%) :arrow_up:
optuna/samplers/_qmc.py 95.14% <0.00%> (+0.04%) :arrow_up:
optuna/integration/botorch.py 98.25% <0.00%> (+0.87%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Aug 08 '22 08:08 codecov-commenter

This pull request has not seen any recent activity.

github-actions[bot] avatar Aug 15 '22 23:08 github-actions[bot]

This pull request has not seen any recent activity.

github-actions[bot] avatar Aug 30 '22 23:08 github-actions[bot]

Thank you for the detailed review. I addressed your comments. PTAL.

not522 avatar Sep 07 '22 02:09 not522

Thanks for the update! Almost LGTM, but you dropped the cast to float of each element of values by this commit?

knshnb avatar Sep 07 '22 08:09 knshnb

Thank you. Fixed.

not522 avatar Sep 08 '22 02:09 not522