Skip to content
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

Refactor docstrings to Google standard format #16

Closed
roedoejet opened this issue Oct 31, 2019 · 8 comments
Closed

Refactor docstrings to Google standard format #16

roedoejet opened this issue Oct 31, 2019 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@roedoejet
Copy link
Collaborator

This was brought up in PR https://github.com/dhdaines/ReadAlong-Studio/pull/8 - I think we should adopt some kind of standard for docstrings, for the sake of documentation and integration with Sphinx as well as just general consistency. The numpy standard was proposed.

@roedoejet roedoejet added the question Further information is requested label Oct 31, 2019
@roedoejet roedoejet mentioned this issue Oct 31, 2019
Merged
@dhdaines
Copy link
Collaborator

dhdaines commented Nov 7, 2019

This seems reasonable. I've usually used the Google standard which is a bit more compact but I think the numpy one might be a little easier to write.

One thing I would like is that instead of a big comment block at the top of the file we should use module-level docstrings, as these are actually accessible to code, etc, rather than only readable by humans.

@roedoejet
Copy link
Collaborator Author

I'm happy to use the Google standard too. @littell @joanise any preferences?

Google:

def func(arg1, arg2):
    """Summary line.

    Extended description of function.

    Args:
        arg1 (int): Description of arg1
        arg2 (str): Description of arg2

    Returns:
        bool: Description of return value

    """
    return True

Numpy

def func(arg1, arg2):
    """Summary line.

    Extended description of function.

    Parameters
    ----------
    arg1 : int
        Description of arg1
    arg2 : str
        Description of arg2

    Returns
    -------
    bool
        Description of return value

    """
    return True

@joanise
Copy link
Member

joanise commented Nov 8, 2019

My top concern would be consistency throughout. Either is fine, although Google requires less typing and is a bit easier to read when looked at in the plain text source. So my vote is a slight preference for Google style.

@roedoejet roedoejet changed the title Adopt standard docstring format Refactor docstrings to Google standard format Nov 8, 2019
@roedoejet
Copy link
Collaborator Author

I'm happy with Google then too. I changed the title of this issue.

@roedoejet roedoejet added enhancement New feature or request help wanted Extra attention is needed and removed question Further information is requested labels Feb 11, 2020
@joanise
Copy link
Member

joanise commented Apr 22, 2020

I just added missing documentation for the bare option to align_audio() and I notice that despite this ticket here, we're still using Numpy style. Is it still on the agenda to convert all to Google style? I'm assuming there's just not been enough time to do it.

joanise added a commit to joanise/ReadAlong-Studio that referenced this issue Jul 16, 2021
Following decision made in ReadAlongs#16,
convert the existing Numpy standard doc in audio_utils.py to Google standard.
joanise added a commit that referenced this issue Jul 16, 2021
Following decision made in #16,
convert the existing Numpy standard doc in audio_utils.py to Google standard.
joanise added a commit that referenced this issue Aug 26, 2021
Following decision made in #16,
convert the existing Numpy standard doc in audio_utils.py to Google standard.
joanise added a commit that referenced this issue Aug 31, 2021
Following decision made in #16,
convert the existing Numpy standard doc in audio_utils.py to Google standard.
@joanise
Copy link
Member

joanise commented Sep 10, 2021

Useful link to the Google python doc standard, embedded in their Python style guide: https://google.github.io/styleguide/pyguide.html See section 3.8 Comments and Docstrings.

@joanise
Copy link
Member

joanise commented Nov 25, 2021

Much progress has been done is this docstring conversion, but I guess it's not fully complete yet. I do it as a "drive-by" task, when I touch files for other reasons, it's less painful this way.

@joanise
Copy link
Member

joanise commented Nov 7, 2022

But now it's time to close this issue. There's more drive-by fixing to do, but the bulk is done.

@joanise joanise closed this as completed Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants