-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Need Attributes displayable like param list #102
Comments
I don't know why this change was introduced, but I agree that it doesn't convey the information we intended in the rendered documentation. |
If you consider it altogether a bug, I'd be very happy with a solution
that's not about customisation.
…On 21 Jul 2017 3:49 am, "Stefan van der Walt" ***@***.***> wrote:
I don't know why this change was introduced, but I agree that it doesn't
convey the information we intended in the rendered documentation.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#102 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEz68bVAnbu4anFKWPQd12eSRlqhDPBks5sP5M1gaJpZM4Odaiw>
.
|
I would; thoughts @pv? |
The attributes list renders attributes that have docstrings as an
autosummary list, including links etc for them. So formatting it as a
class member list was on purpose, not accidental.
|
that's along the lines of what I'd presumed, @pv. But we don't have links
to further docs and type specs are unreadable.
…On 21 Jul 2017 8:34 am, "Pauli Virtanen" ***@***.***> wrote:
The attributes list renders attributes that have docstrings as an
autosummary list, including links etc for them. So formatting it as a
class member list was on purpose.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#102 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6yoDkVzHC_6oCxxvWNcCsvxw2Vdaks5sP9XfgaJpZM4Odaiw>
.
|
Don't we use them exactly like we do parameter lists?
|
One of the problems is that descriptors like property are attributes with
docstrings of their own
On 21 Jul 2017 8:42 am, "Stefan van der Walt" <notifications@github.com> wrote:
Don't we use them exactly like we do parameter lists?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#102 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6xm9clWY8UCi1MXbqwFc1GGGnSyYks5sP9fegaJpZM4Odaiw>
.
|
@pv sorry, I didn't understand the explanation. |
@amueller: for an example, look here https://scipy.github.io/devdocs/generated/scipy.spatial.Delaunay.html --- some of the attributes are properties and have docstrings of their own. |
@stefanv: no, not necessarily --- in some cases it's just a list of the attributes without any explanations, similar to the Methods section. I'm not saying that it cannot be changed, but that how these sections have been used can vary. |
The SciPy docs look pretty awful too :/
|
Well, I'm not going to argue against that :) |
So basically there's a hack to make documented attributes and autosummaried
attributes look sort of similar, but the autosummary ones would frankly be
better displayed like parameters too, were that possible.
…On 22 July 2017 at 05:10, Pauli Virtanen ***@***.***> wrote:
Well, I'm not going to argue against that :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#102 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6_kfNejHwGLSTWNEpv95du7o2-IZks5sQPeMgaJpZM4Odaiw>
.
|
I think the ideal functionality, ensuring backwards compatibility, would:
This is like extending autosummary to support:
The latter point could be achieved by patching upstream in sphinx perhaps to have a Also, extending/reimplementing autosummary will break sphinx-autogen. The best I can come up with in terms of keeping all of this functionality (without touching sphinx upstream) is:
I assume this is unmaintainable madness, but I'm not sure where to find the right compromise. From scikit-learn's perspective, changing the member list for attributes back to a parameter listing would suffice most/all of the time. |
So how about a switch to on how to parse? I don't like to get involved with autosummary tbh. |
Do you mean a switch on how to display? Yes, this is fine as long as we
don't need things autosummarised
…On 1 Aug 2017 6:19 am, "Andreas Mueller" ***@***.***> wrote:
So how about a switch to on how to parse? I don't like to get involved
with autosummary tbh.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#102 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6_1elAcy88QhPaIzrDkaeauJGcpUks5sTjbRgaJpZM4Odaiw>
.
|
sorry, yes, how to display, I guess. And we haven't needed autosummaries yet... so global config would be the easiest work-around. |
I've not investigated when/whether there was a change in numpydoc, but scikit-learn has long relied on Attributes (as per docstring, rather than than descriptors on the class) being listed like Parameters. See old docs at http://scikit-learn.org/0.18/modules/generated/sklearn.linear_model.LogisticRegression.html for instance.
We've merged a recent numpydoc into scikit-learn master, which uses
_str_member_list
to render Attributes, rather than_str_param_list
. See new docs at http://scikit-learn.org/dev/modules/generated/sklearn.linear_model.LogisticRegression.html. The listing looks more like methods, and hence like what you get out of autosummary for descriptors, but it altogether (and particularly the type spec) looks wrong. I'm not sure how those type specs work well for any users of Attributes.To fix scikit-learn's needs, I propose that we extend the Jinja templating of numpy_docstring.rst such that instead of just rendering strings with e.g.
{{ attributes }}
, we have Jinja statements like:or perhaps Jinja filters like:
but unless we want to compose filters, I'm not sure the benefit of this.
Would this be acceptable?
The text was updated successfully, but these errors were encountered: