Repository navigation
Fix docstring parameters that are not in the signature - #2556
Open
VenishPaneliya wants to merge 1 commit into
Open
VenishPaneliya wants to merge 1 commit into
VenishPaneliya wants to merge 1 commit into
Conversation
VisualRepresentation documents image_square, but the constructor takes image_squares, so following the docs raises TypeError. Four visualize_* methods still document topic_model, which is a parameter of the underlying function in bertopic.plotting, not of the method. _c_tf_idf documents m and KeyBERTInspired._extract_top_words documents labels; both are local names, not parameters.
Author
|
Heads-up on the red CI here: the three failures ( They look like dependency drift on |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
griffereports seven docstring parameters inbertopicthat do not exist in the signature they document. They render in the API reference, so the docs advertise arguments that cannot be passed.The one with a real consequence is
VisualRepresentation: the class docstring documentsimage_square, but the constructor parameter isimage_squares, so following the documentation givesThat one is a rename; the other six are entries that no longer match anything and are removed:
VisualRepresentationimage_squareimage_squaresvisualize_documents,visualize_document_datamap,visualize_approximate_distribution,visualize_hierarchytopic_modelbertopic.plotting, not of the methodBERTopic._c_tf_idfmKeyBERTInspired._extract_top_wordslabelstopicsThe eight other
visualize_*methods already omittopic_model, andTopicMapper.add_mappingsdocuments it because it really does take it, so this is drift rather than house style.image_squarehas been wrong since #1232.Docstrings only, no behaviour change.
ruff checkandruff format --checkpass. Loading the package with griffe goes from seven "does not appear in the function signature" warnings to zero. Filed directly rather than via an issue first, since CONTRIBUTING lists docstrings as an exception to that flow.