Skip to content

DOC: make api docs reflect api usage (#4539) #5208

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
Oct 14, 2013

Conversation

jorisvandenbossche
Copy link
Member

Closes #4539.

This removes all use of .. currentmodule:: pandas.some.submodule (in favor of .. currentmodule:: pandas) in api.rst. Rationale is that docs should reflect the user api usage.

Only exception are pandas.io.sql.read_frame/write_frame and pandas.io.stata.StataReader methods, because they are not available in the top-level pandas namespace.

All old links will remain valid because they are still generated because I added all those in a comment at the bottom in api.rst (only not for Index, because this was only added very recently in api.rst).
The downside with this approach is that you now get warnings when building the docs (document isn't included in any toctree for these functions). I am not sure how I can prevent this while keeping the old links but not including it visually in api.rst.

@jorisvandenbossche
Copy link
Member Author

OK, solved the downside by adding a hidden toctree. So now all old links remain valid, and no warnings are generated. The only downside is that there is a big chunk of lines at the bottom in api.rst that is maybe somewhat noisy, just to keep the links.

@jtratner
Copy link
Contributor

If you can add comments, can you leave a note saying that its' there to maintain links?

@jorisvandenbossche
Copy link
Member Author

I did, quoting from the commit

HACK - see github issue #4539. To ensure old links remain valid, include
here the autosummaries with previous currentmodules as a comment and add 
them to a hidden toctree (to avoid warnings):

If it is not clear enough, please suggest something.

Travis had a failing (related to sql: test_basic (pandas.io.tests.test_sql.TestMySQL). Strange, because it is not related to the docs, and before I updated the commit (a forced push), the commit was green. Is this a problem?

@@ -1020,3 +986,226 @@ Conversion
DatetimeIndex.to_pydatetime


..
HACK - see github issue #4539. To ensure old links remain valid, include
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry missed this

jtratner added a commit that referenced this pull request Oct 14, 2013
@jtratner jtratner merged commit b76b265 into pandas-dev:master Oct 14, 2013
@jtratner
Copy link
Contributor

yep unrelated

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.

make docs reflect API usage not the fully qualified name
2 participants