-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Clarify style of attribute comments in the Design Guide. #600
Conversation
And update the core attributes to match the style.
By the way, we could use this extension for Sphinx: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/ |
Would you want to switch to google style docstrings then @deshipu ? |
docs/design_guide.rst
Outdated
@property | ||
def temperature(self): | ||
""" | ||
The current temperature in degrees Celcius. (read-only) |
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.
Celsius
docs/design_guide.rst
Outdated
.. py:attribute:: temperature | ||
:noindex: | ||
|
||
The current temperature in degrees Celcius. (read-only) |
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.
Celsius
docs/design_guide.rst
Outdated
Regardless of how the attribute is implemented, it should have a short | ||
description of what state it represents including the type, possible values and/or | ||
units. It should be marked as ``(read-only)`` or ``(write-only)`` at the end of | ||
the first line for attributes that are not both readable and writeable. |
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.
writable
Napoleon looks really nice. I don't know how it would be in practice but it looks a lot less finicky than RST. It might really encourage folks to write more documentation. |
Here's my feedback on the whole file (it's easier to put this all in one spot):
Some stuff to add:
|
And yeah totally agree +1 on napoleon or NumPy / Google Python Style / etc. doc strings vs. RST. The RST ones are hard to read in the raw form once you get more than a few parameters. Not the end of the world to live with them, but maybe explicit advice to move to napoleon style for new docs would be good to think about and put in. |
Personally I don't have a preference — I'm used to all three styles of docs, and they are more or less equivalent in my eyes. I also don't really have time to go over our documentation and fix it in all the places. I just thought that I will point out that we have some choice in this matter. |
@arturo182 and @dhalbert Done. Regarding Napoleon and Google style comments: I've opened #607 to discuss it. The core APIs have to be rST because they aren't pull from docstrings. @tdicola Great feedback! Here is a bullet-for-bullet reply:
Please take another look everyone. Thanks! |
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.
OK by me.
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.
Misspelled word, question about same line.
docs/design_guide.rst
Outdated
Data descriptor description | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Comment is after even though its weird:: |
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 should be it's
.
However, is there a reason to include "even though it's weird?" Seems like it should be enough to state "Comment is after".
Tweaked the data descriptor description. Please take another look @kattni |
Looks great! Thanks for the update! |
Look good to you @tdicola? |
Not directly relate to this pr, but is it intentional that all other properties are lowercase except |
TVOC and eCO2 are not words but acronyms ... is my thinking. anyone want it lowercased? I could shim existing libraries if people feel strongly! |
I'd probably write out what they stand for in lowercase if we were to change it. They'd then be long but explanatory. @tuupola its a good idea. Mind opening an issue for it? |
In code I find consistency a good thing. If everything is lowercased there is no need to remember whether one should use capital letters or not. For example lux might be confusing. Is it acronym or word? Should it be I do not have strong feelings about this, but my choice would be lowercased acronyms |
ill defer to @tannewt on this one, i don't care too much, we'll just have to update our existing libraries :) |
Thanks for the great work! |
@tdicola oked the merge at lunch this week. |
And update the core attributes to match the style.
@adafruit/circuitpythonlibrarians Please check this out too.