Add docstring to BaseStorage method interfaces.#1175
Conversation
| # type: (int, TrialState) -> bool | ||
| def set_trial_state(self, trial_id: int, state: TrialState) -> bool: | ||
|
|
||
| """Update a state of a specified trial. |
There was a problem hiding this comment.
I don't think we should allow the "RUNNING → WAITING" state change. (Both this doc and current implementation allows it now.)
There was a problem hiding this comment.
This PR won't address this issue.
Co-authored-by: Takeru Ohta <phjgt308@gmail.com>
Co-authored-by: Takeru Ohta <phjgt308@gmail.com>
hvy
left a comment
There was a problem hiding this comment.
Thanks for making this clearly documented once for all. The documented behavior LGTM. I left comments on the style and minor things. I'd personally like to change some English phrases but those are minor and sort of repeat themselves so I could follow it up in a different PR if that's fine with you.
| Returns: | ||
| Study ID, which is an unique id among studies, of the created study. | ||
|
|
||
| Raises: |
There was a problem hiding this comment.
We (or at least I) haven't really paid much attention to documenting exceptions, but we definitely should.
|
@hvy Thank you for your review. I appreciate your follow-up PR suggestion, and I'd like to see it. |
Co-authored-by: Hiroyuki Vincent Yamazaki <hiroyuki.vincent.yamazaki@gmail.com>
There was a problem hiding this comment.
Some tiny details.
Edit: Not sure why my review comments were separated to before and after this comment, but please also see #1175 (review)
Co-authored-by: Hiroyuki Vincent Yamazaki <hiroyuki.vincent.yamazaki@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1175 +/- ##
==========================================
+ Coverage 91.04% 91.80% +0.76%
==========================================
Files 142 149 +7
Lines 12255 13072 +817
==========================================
+ Hits 11157 12001 +844
+ Misses 1098 1071 -27
Continue to review full report at Codecov.
|
Motivation
Storage class implementations for each backend handles error in a different manner. Additionally, undocumented return values force users to read implementations of each method. This PR addresses these issues as a step in #1170. Any inconsistent behaviors with this docstring will be fixed in subsequent PRs.
Description of the changes
Add docstrings to methods in
BaseStorageclass.