Fix signature of functions and methods in generated docs #10743
Merged
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.
Summary
This PR resolves two issues:
The
get_function_signature
inautogen.py
duplicates module name for non-method functions. For example, it returnskeras.preprocessing.sequence.keras.preprocessing.sequence.pad_sequences
instead ofkeras.preprocessing.sequence.pad_sequences
.Method functions and non-method functions should be distinguished from each other. Since, the module name of non-method functions should be included in the signature in the docs (like
keras.preprocessing.sequence.pad_sequences(...)
) whereas for the methods of classes it should not be included (likecompile(...)
forSequential
class). Therefore, a new'methods'
key is introduced to make this distinction.Note that I temporary resolved the first issue by a merged PR (#10664); however that PR did not address the underlying problem.
Related Issues
#10658
#10662
PR Overview