Skip to content

Attributes initialized as None not linked in class overview #14

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

Closed
jorisvandenbossche opened this issue Feb 23, 2014 · 4 comments
Closed

Comments

@jorisvandenbossche
Copy link
Contributor

We experience this issue in the pandas docs (pandas-dev/pandas#6100).

See for example the docstring page for the Index class: http://pandas.pydata.org/pandas-docs/dev/generated/pandas.Index.html. In the list of attributes, at the end, there are some attributes that are not linked to their respective pages.
Eg Index.name, while this page does exist (http://pandas.pydata.org/pandas-docs/dev/generated/pandas.Index.name.html).

This happens for all the attributes that are initialized as None:

In [107]: pd.Index.name is None
Out[107]: True
@jnothman
Copy link
Member

Is this fixed? it seems the link is there on the live docs.

But I don't understand why you want to link to an attribute's docs if that attribute is None, and hence their docs are uninformative. Then again, I don't know why you want to autogenerate such docs.

This could be fixed, I think, by using a sentinel other than None in the code, but I'm not entirely convinced that's useful to the user of the docs...

@jnothman
Copy link
Member

jnothman commented Nov 1, 2017

@jorisvandenbossche, I'm closing this. Reopen if it's still an issue.

@jnothman jnothman closed this as completed Nov 1, 2017
@jorisvandenbossche
Copy link
Contributor Author

Sorry for the late reply. I am not sure this is fixed, but should take the time to look more in detail again.

The reason you don't see it anymore in the current docs is because I added a hack to our vendored numpydoc version to silence the warnings .. (pandas-dev/pandas@70c9d31)

But I don't understand why you want to link to an attribute's docs if that attribute is None, and hence their docs are uninformative. Then again, I don't know why you want to autogenerate such docs.

You are fully correct that the current doc page on eg Index.name (http://pandas-docs.github.io/pandas-docs-travis/generated/pandas.Index.name.html#pandas.Index.name) is completely uninformative. But the main reason I opened this issue is because the previous situation was also annoying: it raised warnings in the doc build and name was still listed in the Index page, but rather in an ugly way. See eg http://pandas.pydata.org/pandas-docs/version/0.15.0/generated/pandas.Index.html

It might also be that this 'uninformativeness' of the doc page could be solved (as the Index.name page could have some useful information listed there, I am just not sure if it is that easy to give a docstring to such an attribute). Because Index.name is not always None, as can some explanation, it is just that in the class definition, it is initialized as None already on the class itself

@jnothman
Copy link
Member

jnothman commented Nov 9, 2017 via email

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

No branches or pull requests

2 participants