Skip to content
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

docs: Add support for class methods in API reference #7841

Merged

Conversation

AkeemMcLennon
Copy link
Contributor

Context

This pull request adds support for class methods in the api documentation by replacing calls to inspect.isfunction() with the more inclusive inspect.isroutine(). In particular, the Image, Prediction and Signature primitives have several relevant functions that were not being captured by the previous method.

It also excludes functions defined by external modules (e.g. Pydantic), but it seems there is some other mechanism that also filters them out somewhere, since they do not appear in the existing documentation despite being present in the generated markdown.

Before

image

After

image

Copy link
Collaborator

@chenmoneygithub chenmoneygithub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, this is pretty good!

@chenmoneygithub chenmoneygithub merged commit a24856c into stanfordnlp:main Feb 23, 2025
6 checks passed
@AkeemMcLennon AkeemMcLennon deleted the fix-api-references-in-docs branch February 23, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants