-
-
Notifications
You must be signed in to change notification settings - Fork 166
Render numpydoc strings from a template #77
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
Conversation
Ping @amueller |
bddf80d
to
9c232e4
Compare
Wow that's much better than what I had in mind. |
Btw, I'm not entirely happy with how the |
Related to gh-78, which was about having the section order fixed or not. Having a fixed default ordering which is enforced by default but can be overridden/customized if you really want or need to would make sense to me. |
can you add |
Very clean and simple implementation, I'd be fine with adding this. |
sphinx requires jinja2...?
…On 29 November 2016 at 19:41, Ralf Gommers ***@***.***> wrote:
Very clean and simple implementation, I'd be fine with adding this.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#77 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEz61jDgHqsKeGWvf4xOov0VLOZ8bhuks5rC-UogaJpZM4K3jJf>
.
|
I like the template implementation, but also: shouldn't attributes be rendered in the position suggested by default? This is the order in which is appears in the docstring and according to the standard. |
I know, but explicit > implicit and all that. You normally put all your direct dependencies in |
Of course. |
I run as far away from dependencies as I can :) |
I've added the jinja2 dependency, specifying the same version as current sphinx, though I assume an earlier version would work fine. |
Without checking: IIRC there's a long standing mismatch between docs and implementation for at least |
Looks OK to me. @pv Do you have any thoughts on the section ordering? |
I'd really like to finally get scikit-learn using numpydoc directly. @amueller and I consider not having Attributes in its incumbent position a blocker. Can we please do something about it? |
No objections, so in it goes. Thanks @jnothman, all! |
BUG: fix installing numpydoc, broken with missing templates after gh-77.
In scikit-learn, we would like to start tracking the upstream numpydoc (scikit-learn/scikit-learn#7355). However, we currently render Attributes closely after Parameters, due to their significance, etc. Numpydoc renders Attributes after examples, notes, references, etc. which we find unideal.
This patch allows us to add
templates/numpydoc_doscstring.rst
containing:to achieve the sought reordering. It is clearly also much more flexible than that, but I do not have (many) grand designs as yet.