Skip to content

first_solar_spectral_correction deprecation points to a non-existent alternative #1810

Closed

Description

@cwhanse

Describe the bug

This line points calls to pvlib.atmosphere.first_solar_spectral_correction to pvlib.spectrum.spectral_factor_firstsolar which doesn't exist. The deprecation should point to pvlib.spectrum.mismatch.spectral_factor_firstsolar

Versions:

  • pvlib.__version__: 0.10.1

Activity

  1. added this to the v0.10.2 milestone on Jul 18, 2023
  2. ai-naymul commented on Jul 19, 2023

    @ai-naymul

    Hey I would like to work on this issue, may I?

  3. cwhanse commented on Jul 19, 2023

    @cwhanse
    MemberAuthor

    @ai-naymul yes, please!

  4. kandersolar commented on Jul 19, 2023

    @kandersolar
    Member

    It's true that spectral_factor_firstsolar lives in pvlib/spectrum/mismatch.py, but the spectrum __init__.py file imports it into the pvlib.spectrum namespace: https://github.com/pvlib/pvlib-python/blob/main/pvlib/spectrum/__init__.py#L7

    So the function is indeed accessible with pvlib.spectrum.spectral_factor_firstsolar:

    In [133]: pvlib.spectrum.spectral_factor_firstsolar
    Out[133]: <function pvlib.spectrum.mismatch.spectral_factor_firstsolar(precipitable_water, airmass_absolute, module_type=None, coefficients=None, min_precipitable_water=0.1, max_precipitable_water=8)>

    This is also the name that is used in the docs: https://pvlib-python.readthedocs.io/en/stable/reference/generated/pvlib.spectrum.spectral_factor_firstsolar.html

    So I think it makes sense to leave the deprecation message as-is.

  5. cwhanse commented on Jul 19, 2023

    @cwhanse
    MemberAuthor

    OK, my mistake. I don't quite grok how that import works and couldn't find the function when I was looking for it.

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