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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move default logic of
get_trial_id_from_study_id_trial_number()
method to BaseStorage. #3910Move default logic of
get_trial_id_from_study_id_trial_number()
method to BaseStorage. #3910Changes from 2 commits
faed73c
ce674ac
55c91f4
86f7081
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this,
InMemoryStorage.get_trial_id_from_study_id_trial_number
is tested instead ofBaseStorage.get_trial_id_from_study_id_trial_number
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot think of a way to easily test
InMemoryStorage.get_trial_id_from_study_id_trial_number
(except for mocking all the abstract methods ofInMemoryStorage
), but do you come up with a good way...?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! It is a difficult problem how to test concrete methods in an abstract base class. I thought it would be better to just remove this test case since this test case should not be written in
test_study.py
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that
get_trial_id_from_study_id_trial_number()
is enough tested at:optuna/tests/storages_tests/test_storages.py
Lines 1070 to 1096 in 2c09c5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this test should not be located in
test_study.py
.Still, I feel the default logic of
BaseStorage.get_trial_id_from_study_id_trial_number
should be tested somewhere (not tested intest_get_trial_id_from_study_id_trial_number
because all the concrete class override the method). We should probably discuss how to test default implementations inBaseStorage
as another issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, let me merge this PR first. If you have any opinions, please leave a comment!