-
Notifications
You must be signed in to change notification settings - Fork 11
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
DM-13755: ReST-ify config doc strings #21
Conversation
This looks great, thanks for the quick fix. Two comments from me (not official reviewer):
|
Great, thanks! Looking at that output, my only suggestion would be to wrap the allowed values in monospace or italics or something, to more clearly distinguish them from the description text. But otherwise this looks pretty good. |
Exactly, for those choice fields, it might be good if the value was marked up as a code literal: ``'simplePoly'``
One Polynomial per ccd. I think you could do something like '``{0!r}``'.format(value) To let Python add the quotes around string values. |
I really like the idea of including defaults. Do you think this is do-able in this ticket @SimonKrughoff? The interesting this is that with regular class attributes, numpydoc includes the default value from the initial assignment. But these config field docstrings behave more like properties. I just noticed that our numpydoc spec doesn't spell out where to but default values. https://developer.lsst.io/docs/py_docs.html#documenting-class-properties One option is to put it next to the type info on the summary line, like this:
Do we have really complicated defaults? In that case we'd want to put it in a new paragraph of hte extended summary: """Summary sentence (). Default::
""" |
Let me spend a couple of minutes adding the ticks and defaults. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is terrific, thanks @SimonKrughoff
This changes how the default Field constructor handles the
doc
argument. It also changes howChoiceField
andRangeField
handleself.__doc__
.Example base
Field
,RangeField
andChoiceField
: