Skip to content

Docstring for pvsystem.calcparams_xxx are inconsistent with function code #716

Closed

Description

@cwhanse

Docstrings for pvsystem.calcparams_desoto, pvsystem.calcparams_cec and pvsystem.calcparams_pvsyst list outputs as photocurrent etc. but code uses different terms, e.g., IL. Using the long variable names inside the functions would clarify the code.

Might want to consider returning dict rather than tuple.

Activity

  1. wholmgren commented on May 9, 2019

    @wholmgren
    Member

    Ok with me to change the code to use long names. But I don't think the long/short inconsistency between the docstring/API and internal variable names is necessarily a problem. Our Contributing docs say:

    pvlib python uses a mix of full and abbreviated variable names. See Variables and Symbols. We could be better about consistency. Prefer full names for new contributions. This is especially important for the API. Abbreviations can be used within a function to improve the readability of formulae.

  2. cwhanse commented on May 9, 2019

    @cwhanse
    MemberAuthor

    Maybe adding a comment line with the return statement will close the bit of gap between the docstring and the variables used in the code. I think it is helpful to use the common symbols as variable names. I don't think including the symbols in the docstring would improve matters; seems like step back from the Contributing goal of full names.

  3. added this to the 0.6.4 milestone on Jun 11, 2019
  4. modified the milestones: 0.6.4, 0.7.0 on Jun 25, 2019
  5. modified the milestones: 0.7.0, 0.7.1 on Nov 26, 2019
  6. modified the milestones: 0.7.1, 0.7.2 on Jan 10, 2020
  7. modified the milestones: 0.7.2, 0.8.0 on Mar 1, 2020
  8. modified the milestones: 0.8.0, Someday on Aug 28, 2020
  9. pratham15541 commented on Feb 18, 2025

    @pratham15541

    Can i do like
    Updating the docstrings for the mentioned functions to match the variable names used in the code.
    Modifying the functions to use long variable names for clarity.
    Consider changing the return type of the functions from a tuple to a dictionary to improve readability.

  10. cwhanse commented on Feb 18, 2025

    @cwhanse
    MemberAuthor

    The agreement here was to add some comments, e.g. for calcparams_desoto at this line, explaining how the internal variables map to the named outputs.

    Changing the output type would require a much longer discussion that we had in this issue.

  11. cwhanse commented on Mar 31, 2025

    @cwhanse
    MemberAuthor

    Closed by #2405

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions