question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOC: inconsistent docs-string signatures for shared functions

See original GitHub issue

xref #15580

related to this is our inconsistent treatment of the actual args in shared doc strings, e.g.

so the following have exactly the same arguments to the doc-string (except for the first 1-2 which are the axes: index, or index & columns).

The doc-strings themselves are correct, but the signature are hidden. I think easiest is simply to actually list out the args where they are defined (e.g in core/series.py for example).

Signature: pd.Series.reindex(self, index=None, **kwargs)
Docstring:
Conform Series to new index with optional filling logic, placing
NA/NaN in locations having no value in the previous index. A new object
is produced unless the new index is equivalent to the current one and
copy=False
Signature: pd.SparseSeries.reindex(self, index=None, method=None, copy=True, limit=None, **kwargs)
Docstring:
Conform SparseSeries to new index with optional filling logic, placing
NA/NaN in locations having no value in the previous index. A new object
is produced unless the new index is equivalent to the current one and
copy=False
Signature: pd.DataFrame.reindex(self, index=None, columns=None, **kwargs)
Docstring:
Conform DataFrame to new index with optional filling logic, placing
NA/NaN in locations having no value in the previous index. A new object
is produced unless the new index is equivalent to the current one and
copy=False

There are a bunch of functions like this.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gfyoungcommented, Mar 28, 2017

Yes, that is correct. Annoying? Yes. Necessary? Debatable, but there was enough push early on from users for this to be implemented.

0reactions
VijayantSonicommented, Oct 12, 2019

Hi @jreback , does this still need to be done ? I would like to take this on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manipulating function docstring and signature in base class
1. run and _run are two different functions. · I want to manually manipulate the docstring, as I currently do in Base.__init__ (see...
Read more >
[v2.12 Regression] Asterisk argument `mising-param-doc` vs ...
Just another thought, if the goal of the docstring is to document the function and its signature you would need the asterisks to...
Read more >
Common issues and solutions - mypy 0.991 documentation
Incompatible overrides​​ The signature of a method in a subclass should accept all valid calls to the base class method. Mypy treats a...
Read more >
Support for Google Style Python docstrings : PY-9795
PY-16987 In functions with Google and Numpy style docstrings parameter ... warn when the parameter naming in the comment doesn't match the method...
Read more >
pybind11 Documentation - Read the Docs
Function signatures are precomputed at compile time (using constexpr), ... m.doc() = "pybind11 example plugin"; // optional module docstring.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found