pvsystem.Array.get_irradiance raises an error if solar_zenith is passed as a float
See original GitHub issueBug Description
pvsystem.get_irradiance
documentation says solar_zenith can be passed as a float or a Series. However, if dni_extra
is not defined and solar_zenith
is passed as float, then solar_zenith.index
is not defined and the call to irradiance.get_extra_irradiance
with solar_zenith.index
as an argument fails.
To Reproduce
Steps to reproduce the behavior:
test_sys = pvsystem.PVSystem()
test_sys.get_irradiance(0.0, 0.0, 0.0, 0.0, 0.0)
Error message
AttributeError: 'float' object has no attribute 'index'
Expected behavior Return a DataFrame containing the irradiance components, as specified in the documentation.
Possible solutions
- Ask for datetime if
dni_extra
is not passed as argument - Remove float from supported types for
solar_zenith
Versions:
pvlib.__version__
: 0.9.0pandas.__version__
: 1.3.3- python: 3.9
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
PVSystem. - get_irradiance - pvlib python
solar_zenith (float or Series) – Solar zenith angle. ... If passed as a tuple the length must be the same as the number...
Read more >pvlib_python Documentation - Read the Docs
A system with multiple arrays is specified by passing a list of Array to the PVSystem constructor. For a PV system.
Read more >pvlib-python/pvsystem.py at main - GitHub
Decorator to warn or error when getting and setting the "pass-through". PVSystem ... PVSystems with only one Array and raises an error for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
*must be a Series with a DatetimeIndex.
I also like @kanderso-nrel’s suggestion in https://github.com/pvlib/pvlib-python/issues/1338#issuecomment-967232590
Most or all of the bottom layer functions work with scalars and I think that’s important. May be less so for the classes, but still desirable.