-
Notifications
You must be signed in to change notification settings - Fork 224
Updating API docs #1787
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
base: main
Are you sure you want to change the base?
Updating API docs #1787
Conversation
👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review. Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed. |
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.
Summary of Changes
Hello @aireilly, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on significantly improving the project's API documentation. It achieves this by updating the documentation generation configuration to use a more detailed and standardized docstring style, and by adding descriptive summaries to core Python modules. The aim is to make the API reference more informative and easier to navigate for developers.
Highlights
- Documentation Configuration Update: The MkDocs configuration file (mkdocs.yml) has been updated to refine how API documentation is generated. This includes excluding the 'llmcompressor.version' module from automatic navigation and switching the docstring style to 'numpy' for better readability and detail.
- Enhanced API Docstring Rendering: Numerous options have been enabled within the mkdocstrings plugin in mkdocs.yml to provide a more comprehensive and structured display of API elements, such as showing symbol types, separate signatures, and detailed parameter headings.
- Module-Level Docstrings Added: Descriptive module-level docstrings have been added to several key init.py files and the typing.py file across the 'llmcompressor' package. These docstrings provide high-level summaries for each module, improving the overall clarity and completeness of the generated API documentation.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request aims to improve the API documentation by adding module-level docstrings and updating the mkdocs.yml
configuration. The added docstrings are clear and descriptive. However, there is a critical issue in the mkdocs.yml
configuration where the docstring_style
is set to numpy
, while the codebase predominantly uses the sphinx
style. This mismatch will lead to incorrectly rendered documentation. I've provided a suggestion to correct this.
50cf834
to
e889ef1
Compare
Hi @aireilly Thanks for doing this, I have a ask though, since we don't have Module level docstrings for most of our modules, would it be possible to ignore them for the time being? ![]() |
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.
few comments, but otherwise lgtm
fc1a122
to
4212cf1
Compare
I tried with this in the the filters:
- "!docstring"
- "!^_" edit: hmm. maybe we can use https://mkdocstrings.github.io/python/usage/configuration/docstrings/#show_if_no_docstring |
826cf9f
to
5fb6b75
Compare
OK. Not going to add more docstrings than are already reviewed. I do have a git stash of more maybe can add them in later PR. I did add |
Signed-off-by: Aidan Reilly <[email protected]>
5fb6b75
to
9931386
Compare
@@ -85,6 +86,9 @@ markdown_extensions: | |||
plugins: | |||
- api-autonav: | |||
modules: ['src/llmcompressor'] | |||
exclude: |
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.
@rahul-tuli We can exclude more modules like this.
Updated
mkdocs.yml
with the following changes:Added
pymdownx.magiclink
extension - automatic URL linkingExcluded utility modules (
llmcompressor.version
,llmcompressor.typing
) from auto-generated docsUpdated mkdocstrings config with new options:
docstring_section_style
: list - Added list section formattingfilters
: ["!^_"] - Hide private/internal methods from docsmerge_init_into_class
: true - Merge class documentationseparate_signature
: true - Function signature displayshow_root_heading
: true - Clear module headersshow_signature_annotations
: true - Type hint visibilityshow_symbol_type_heading
: true - Clear type indicatorssummary
: true - Include summary sectionshttps://mkdocstrings.github.io/python/reference/api/
Added high level doc strings to most modules.
Note: Used Claude to summarize and create new docstrings.
Preview:
https://vllm--1787.org.readthedocs.build/projects/llm-compressor/en/1787/