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

first_solar_spectral_correction deprecation points to a non-existent alternative #1810

Closed
cwhanse opened this issue Jul 18, 2023 · 4 comments

Comments

@cwhanse
Copy link
Member

cwhanse commented Jul 18, 2023

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
@ai-naymul
Copy link

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

@cwhanse
Copy link
Member Author

cwhanse commented Jul 19, 2023

@ai-naymul yes, please!

@kandersolar
Copy link
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.

@cwhanse
Copy link
Member Author

cwhanse commented Jul 19, 2023

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
Projects
None yet
Development

No branches or pull requests

3 participants