Skip to content

DOC: Docstring Redesign to fix the problem of unexpected keyword arg (issue10888) #11011

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

Merged
merged 1 commit into from
Sep 9, 2015
Merged

DOC: Docstring Redesign to fix the problem of unexpected keyword arg (issue10888) #11011

merged 1 commit into from
Sep 9, 2015

Conversation

terrytangyuan
Copy link
Contributor

Fixed issue #10888

@terrytangyuan
Copy link
Contributor Author

@jreback Is this one ok to merge?

@jreback
Copy link
Contributor

jreback commented Sep 9, 2015

needs tests

@terrytangyuan
Copy link
Contributor Author

So this is simply a DOC problem where users use the wrong parameters specified in Documentation but they don't belong to those methods. I've fixed the documentation so users won't get confused again. I don't think unit tests are needed for this PR.

@@ -1494,7 +1494,7 @@ def to_html(self, buf=None, columns=None, col_space=None, colSpace=None,
if buf is None:
return formatter.buf.getvalue()

@Appender(fmt.docstring_to_string, indents=1)
@Appender(fmt.common_docstring + fmt.return_docstring, indents=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you make these all be separated by \n so this is consistent.

@jreback
Copy link
Contributor

jreback commented Sep 9, 2015

can you post before-after of the doc-strings

@jreback jreback added the Docs label Sep 9, 2015
@jreback jreback added this to the 0.17.0 milestone Sep 9, 2015

Returns
-------
formatted : string (or unicode, depending on data and options)"""

docstring_to_string = common_docstring + "\n" + justify_docstring + "\n" + force_unicode_docstring + return_docstring
Copy link
Member

Choose a reason for hiding this comment

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

no \n is needed between commong_docstring and justify_docstring

Copy link
Member

Choose a reason for hiding this comment

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

btw, where is this variable used?

@jorisvandenbossche
Copy link
Member

Apart from the few comments, looks good!

@terrytangyuan
Copy link
Contributor Author

@jreback @jorisvandenbossche Thanks! They look better now!

common_docstring = """
Parameters
----------
frame : DataFrame
Copy link
Contributor

Choose a reason for hiding this comment

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

frame should come out, we don't normally document the type of the self paramater (and thus its confusing).

@terrytangyuan
Copy link
Contributor Author

@jreback Thanks. Anything else I should change before I add a new burden to Travis?

…arg (issue10888) (+1 squashed commit)

Squashed commits:
[ab61a77] DOC/BUG: Docstring Redesign to fix the problem of unexpected keyword arg (issue10888) (+1 squashed commit)
Squashed commits:
[ad08eac] DOC/BUG: Docstring Redesign to fix the problem of unexpected keyword arg (issue10888) (+1 squashed commit)
Squashed commits:
[756ca05] DOC: Docstring Redesign to fix the problem of unexpected keyword arg (issue10888)
jreback added a commit that referenced this pull request Sep 9, 2015
DOC: Docstring Redesign to fix the problem of unexpected keyword arg (issue10888)
@jreback jreback merged commit f624c0a into pandas-dev:master Sep 9, 2015
@jreback
Copy link
Contributor

jreback commented Sep 9, 2015

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants