-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Describe the bug
The pvfactors_timeseries docstring currently lists several parameters as "numeric", implying scalar values are acceptable (docs). However, some parameters cannot actually be scalars and should be listed as "array-like" instead.
To Reproduce
Example showing that scalar inputs for the module orientation parameters are not acceptable:
Click to expand!
import pvlib
import pandas as pd
from pvlib.bifacial import pvfactors_timeseries
times = pd.date_range('2019-01-01', '2019-01-02', freq='15min').tz_localize('Etc/GMT+5')
location = pvlib.location.Location(40, -80)
solarpos = location.get_solarposition(times)
clearsky = location.get_clearsky(times)
kwargs = dict(
solar_azimuth=solarpos['azimuth'],
solar_zenith=solarpos['apparent_zenith'],
axis_azimuth=0,
timestamps=times,
dni=clearsky['dni'],
dhi=clearsky['dhi'],
gcr=0.3,
pvrow_height=1.5,
pvrow_width=1.0,
albedo=0.2
)
pvfactors_timeseries(surface_tilt=20, surface_azimuth=90, **kwargs) # IndexError: too many indices for array
pvfactors_timeseries(surface_tilt=pd.Series(20, index=times),
surface_azimuth=pd.Series(90, index=times),
**kwargs) # works
Expected behavior
Correct the types in the docstring to accurately reflect pvfactors' requirements.
Additional context
Originally discussed here: #1331 (reply in thread)
Edit: this is more or less a duplicate of #1127
AdamRJensen