Skip to content

Improve docstring or behavior for irradiance.get_total_irradiance and irradiance.get_sky_diffuse #949

Closed

Description

@cwhanse

pvlib.irradiance.get_total_irradiance accepts kwargs dni_extra and airmass, both default to None. However, values for these kwargs are required for several of the irradiance transposition models.

See discussion here

Docstring should specify when dni_extra and airmass are required, and which airmass is appropriate for each model.

Could also test for kwarg values if e.g. model=='perez'

Activity

  1. changed the title [-]Improve docstring for `irradiance.get_total_irradiance`[/-] [+]Improve docstring for irradiance.get_total_irradiance and irradiance.get_sky_diffuse[/+] on Apr 2, 2020
  2. kandersolar commented on Apr 3, 2020

    @kandersolar
    Member

    Consider also specifying it is relative airmass.

  3. added this to the 0.7.3 milestone on Apr 3, 2020
  4. modified the milestones: 0.7.3, 0.8.0 on May 19, 2020
  5. wholmgren commented on Sep 5, 2020

    @wholmgren
    Member

    This came up again in @mikofski's thread here.

    @mikofski proposed calculating values if needed and not provided.

    @kanderso-nrel proposed a couple of solutions to provide more informative error messages: 1. hard coding the failure modes in get_sky_diffuse and 2. using a decorator to communicate the failure modes.

    And repeating my take from the thread:

    I'd rather not introduce the complexity of decorators to the lower level pvlib functions to solve this problem.

    Ideas that I support:

    • calculate if not provided (Mark's original idea)
    • reraising a more informative message.
    • require all of the arguments in get_sky_diffuse and get_total_irradiance regardless of whether or not they're used.
    • remove the arguments from get_sky_diffuse and get_total_irradiance and do the calculation if it's needed
    • remove get_sky_diffuse and get_total_irradiance. I'm not convinced they're a net positive for the library. (let's try to fix it before throwing up our hands)

    Does someone want to tackle this in 0.8.0 or should we kick it down the road?

  6. mikofski commented on Sep 5, 2020

    @mikofski
    Member

    I think it's tempting to add it in v0.8, but I'm in favor of freezing features now and pushing out the release sooner with the features we already have queued. It's been a while, and I think we should deploy more often with less features per release. I believe this will make it easier to blame issues and get more testing done on new features and fixes faster.

  7. mikofski commented on Sep 5, 2020

    @mikofski
    Member

    I'll volunteer to take this up for v0.8.1, since I was the complainer.

  8. modified the milestones: 0.8.0, 0.8.1 on Sep 5, 2020
  9. changed the title [-]Improve docstring for irradiance.get_total_irradiance and irradiance.get_sky_diffuse[/-] [+]Improve docstring or behavior for irradiance.get_total_irradiance and irradiance.get_sky_diffuse[/+] on Sep 6, 2020
  10. wholmgren commented on Sep 28, 2020

    @wholmgren
    Member

    PVSystem.get_irradiance has some relevant shim code:

    # not needed for all models, but this is easier
    if dni_extra is None:
    dni_extra = irradiance.get_extra_radiation(solar_zenith.index)
    if airmass is None:
    airmass = atmosphere.get_relative_airmass(solar_zenith)

  11. modified the milestones: 0.8.1, 0.9.0 on Dec 17, 2020
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

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions