datasnakes / OrthoEvolution

An easy to use and comprehensive python package which aids in the analysis and visualization of orthologous genes. 🐵
https://orthoevolution.readthedocs.io/en/master/
29 stars 4 forks source link

Deciding on DocString style #122

Closed sdhutchins closed 6 years ago

sdhutchins commented 6 years ago

I think pycharm is using rest? docstring (for restructured text). @grabear

def function():
  """This function does something.

    :param name: The name to use.
    :type name: str.
    :param state: Current state to be in.
    :type state: bool.
    :returns:  int -- the return code.
    :raises: AttributeError, KeyError

    """

Are you okay with this format since you're already using similar? I'm going to work on adding to all the docstrings I've written. Won't be hard.

Also, there's an example here. Since we're already using sphinx for documentation, I think it'd be great to use it.

grabear commented 6 years ago

Yea PyCharm uses Restructured text by default. However, you can use the other ones as well: image

But i do like restructured text. So yea... I'm unfamiliar with sphinx, but I'll look into when I do my next docstring patch.

grabear commented 6 years ago

Also PyCharm has some sphinx stuff built in: image

sdhutchins commented 6 years ago

Awesome. Yeah, Sphinx uses restructured text so it's a perfect fit. When I get ready to change those docstrings, I'll be sure to do in PyCharm. That seems significantly easier. I'll close out this issue now unless you have any more thoughts about code style.

grabear commented 6 years ago

Well you can check this box in PyCharm: image

And whenever you autogenerate the docstrings (trible-double quotes + ENTER), it will auto add the type.

But thats all I've got.

sdhutchins commented 6 years ago

That's very helpful. I'll have to make note of this when I start out.