-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Add support for class methods documentation #9751
Add support for class methods documentation #9751
Conversation
This appears to have been overlooked in the recent changes to the In order to achieve a mechanism where we automatically document a class by printing 1) the main docstring, 2) individual methods, under a "methods" header, we could reuse much of the same code. |
@fchollet Thank you for your feedback. As regards the code reuse, yes, I totally agree. However let me explain:
A possible solution would be to avoid pages mixing methods and functions. Let me know what you think and if there is something I am still missing... |
We can definitely go with your PR. Please first edit it with these 3 things in mind:
|
@fchollet PTAL.
Let me know what you think, thanks. |
New commit: now it is possible to document class methods:
Probably the second is easy to use during refactoring. |
Please note that the Keras docs (online) are already using a custom theme. The changes are reasonable, but please handle this feature without changes to the theme/markup, just by generating markdown (in particular, no need for |
@fchollet Ok it should be ok now. PTAL again, thanks |
… string or a fully qualified name
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.
LGTM, thanks
…ack-embeddings-from-layer-outputs * upstream/master: (68 commits) fit/evaluate_generator supporting native tensors (keras-team#9816) keras-team#9642 Add kwarg and documentation for dilation_rate to SeparableConvs (keras-team#9844) Document that "same" is inconsistent across backends with strides!=1 (keras-team#9629) Improve tests by designating dtype of sample data (keras-team#9834) Add documentation for 'subset' and interpolation' arguments (ImageDataGenerator) (keras-team#9817) Revert default theme to readthedocs Various docs fixes. Fix conflict Add support for class methods documentation (keras-team#9751) Add missing verbose opt for evaluate_generator (keras-team#9811) Added `data_format` to flatten layer. (keras-team#9696) Allow saving models directly to binary stream (keras-team#9789) Fix ctc_batch_cost() error when batch_size = 1 (keras-team#9775) Fix keras-team#9802 (keras-team#9803) Fix error in ImageDataGenerator documentation (keras-team#9798) fix typo (keras-team#9792) keras-team#9733: Extend RemoteMonitor to send data as application/json (keras-team#9734) Fixed inconsistencies regarding ReduceLROnPlateau (keras-team#9723) Fix doc issue. General stateful metrics fixes (keras-team#9446) ...
Hi @fchollet , I took a look to the 1e82a71 commit and I think that it re-introduces the problems we had before:
I have already a pull request ready, I just wanted to know if this was intentional, in order to avoid useless PR. |
* Add support for class methods documentation * Documentation: remove the need of external CNN and JS files, using plain markdown * Documentation: allow to decide which class method to document using a string or a fully qualified name * Documentation: remove the need of a custom theme
I noticed that the recent commits related to the doc (the ones that try to automate the doc generation, for example #9656 ) break the old doc style. For example, the new ImageDataGenerator page does not document the ImageDataGenerator methods (fit, flow, ...) anymore, we only have some examples.
This PR adds:
I tried to follow a style similar to the one already adopted by the TensorFlow's docs.
In particular:
All these decisions can obviously be changed and improved but I think PR could serve as a good base for future improvements. I have tested the docs on a mac and it is rendered wonderfully.