Fix docstrings that name parameters the operator methods do not have - #1125
Open
VenishPaneliya wants to merge 1 commit into
Open
VenishPaneliya wants to merge 1 commit into
VenishPaneliya wants to merge 1 commit into
Conversation
Four of plotnine's `+` operator methods document a parameter name their signature does not use, so following the docs and passing that keyword raises TypeError: ggplot.__add__(rhs) documented as `other` geom.__radd__(other) documented as `plot` guides.__radd__(other) documented as `plot` stat.__radd__(other) documented as `gg` `other` is the established name: of the 24 `__radd__` methods, the two that document their parameter at all use `other` (ggplot and composition/_types). ggplot.py is the clearest case - its `__radd__` documents `other` correctly while its `__add__` documents `other` for a parameter actually called `rhs`. Docs only, no behaviour change.
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.
Four of the
+operator methods document a parameter name their signature doesn't use, so following the docs and passing that keyword raisesTypeError.ggplot.pyggplot.__add__rhsothergeoms/geom.pygeom.__radd__otherplotguides/guides.pyguides.__radd__otherplotstats/stat.pystat.__radd__otherggotheris the established name here. Of the 24__radd__methods in the package, the two that document their parameter at all —ggplot.__radd__andcomposition/_types.py— both useother; the remaining 19 have no Parameters section.ggplot.pymakes the case on its own: its__radd__documentsothercorrectly, while a few lines away__add__also saysotherfor a parameter that is actually calledrhs.I left
stat.__radd__'sout :entry alone — that's the name underReturns, which is valid numpydoc, not a mistake.Docs only, no behaviour change.
ruff checkandruff format --checkare clean on all four files.