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

[DOC] Fix Linting issue and update docstring to Numpy Style By Module #1749

Open
13 tasks
fnhirwa opened this issue Jan 6, 2025 · 2 comments
Open
13 tasks
Assignees
Labels
documentation Improvements or additions to documentation maintenance Continuous integration, unit testing & package distribution

Comments

@fnhirwa
Copy link
Member

fnhirwa commented Jan 6, 2025

Describe the issue linked to the documentation

This is an issue for tracking the fixation of linting errors in the codebase and updating the docstring to the proper numpy style:

From

def add(a, b):
    """
    Add two numbers together

    Args:
        a (int): The first number
        b (int): The second number

    Returns:
        int: The sum of the two numbers
    """
    pass

To

def add(a, b):
    """
    Add two numbers together

    Parameters
    ----------
    a : int
        The first number
    b : int
        The second number

    Returns
    -------
    int
        The sum of the two numbers
    """
    pass

Suggest a potential alternative/fix

Subsetting the issue as the changes are expected to be huge for review.

  • data
  • metrics
  • models
  • map
  • deeper
  • beats
  • nhits
  • nn
  • rnn
  • tft
  • tide
  • utils
  • tests
@fnhirwa fnhirwa added the documentation Improvements or additions to documentation label Jan 6, 2025
@fnhirwa fnhirwa self-assigned this Jan 6, 2025
@fnhirwa fnhirwa added the maintenance Continuous integration, unit testing & package distribution label Jan 7, 2025
@yarnabrina
Copy link
Member

If existing codebase followsgoogle style, can we not continue that? It can be configured easily I think.

https://docs.astral.sh/ruff/settings/#lint_pydocstyle_convention

@fnhirwa
Copy link
Member Author

fnhirwa commented Jan 11, 2025

If existing codebase followsgoogle style, can we not continue that? It can be configured easily I think.

https://docs.astral.sh/ruff/settings/#lint_pydocstyle_convention

I would prefer the numpy style, as the implementations seem to be more detailed, and the numpy style works well for the case.

https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html

Otherwise, we would need to increase the length of the line in our linter because the google style uses indentation whereas numpy uses underlines.

Google would be the best choice for short docstring, but for docstring where we need Examples Numpy style is the best choice. And I am sure that most of our contributors work with scientific libraries, which will make it easy for them to write the docstrings. An Example here in this commit @fkiraly already used the numpy style #1746

fnhirwa added a commit that referenced this issue Jan 13, 2025
…in linting rules see #1749 (#1748)

### Description

This PR fixes the linting errors after the lint rules were updated
recently.

Initially added a lot of `noqa` to have a baseline that passes the lint
check going to work on removing all `noqa` to the minimal value. This is
still a work in progress.

This temporary fix is for allowing PRs to be in mergeable states given
that they pass code quality checks.
The exhaustive refactoring is being done in #1749 to ensure the code
quality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation maintenance Continuous integration, unit testing & package distribution
Projects
None yet
Development

No branches or pull requests

2 participants