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 docstring params #1790

Closed
wants to merge 12 commits into from

Commits on Jun 26, 2023

  1. Align reference

    echedey-ls committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    8964a8c View commit details
    Browse the repository at this point in the history
  2. Rework random matching

    echedey-ls committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    10812fb View commit details
    Browse the repository at this point in the history
  3. First regex

    ^(\s{8}|\s{4})(?!try|else|doi|DOI|Warning|Access|Requests|Note)(\w*): (?!.*=|.*:)(.+)$
    
    This matches strings in test_pvsystem.py wrongly
    echedey-ls committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    281dc67 View commit details
    Browse the repository at this point in the history
  4. Second regex iteration

    Deleting negative lookahead |.*:
    
    ^(\s{8}|\s{4})(?!try|else|doi|DOI|Warning|Access|Requests|Note)(\w*): (?!.*=)(.+)$
    
    Reason: too many `default: ` strings
    echedey-ls committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    f2a92b6 View commit details
    Browse the repository at this point in the history
  5. Update irradiance.py

    Exclude .*=| from negative lookahead
    
    ^(\s{8}|\s{4})(?!try|else|doi|DOI|Warning|Access|Requests|Note)(\w*): (?!.*:)(.+)$
    
    Reason: just this line 🌝
    Remaining matches are type annotations in modelchain.py and pvsystem.py
    echedey-ls committed Jun 26, 2023
    Configuration menu
    Copy the full SHA
    35fd3e7 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2023

  1. Change excessive parentheses from default syntax in parameters

    Regex: (?<spaces>\s{8}|\s{4})(?<name>\w*) : (?<type>.*) \(optional, default=(?<default>.*)\)$
    Subs pattern: $1$2 : $3, default $4
    Including: pvlib/**/*.py
    Excluding: docs
    
    No more "(optional, " found in .py files
    echedey-ls committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    d72a654 View commit details
    Browse the repository at this point in the history
  2. Remove trailing dot

    echedey-ls committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    debcc63 View commit details
    Browse the repository at this point in the history
  3. Remove colon after default

    echedey-ls committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    3497ff4 View commit details
    Browse the repository at this point in the history
  4. default None -> optional (pvlib#1574)

    (?<spaces> {8}| {4})(?<name>\w*) : (?<types>.*), default None$
    $1$2 : $3, optional
    
    (?<spaces> {8}| {4})(?<name>\w*) : None or (?<type>.*), optional$
    $1$2 : $3, optional
    
    (?<spaces> {8}| {4})(?<name>\w*) : (?<type>.*) or [nN]one, optional$
    $1$2 : $3, optional
    
    Over files: pvlib/**/*.py
    echedey-ls committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    6500add View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cdd022c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    016206c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    db36922 View commit details
    Browse the repository at this point in the history