-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Infinite sheds perf improvement: vectorize over surface_tilt #1680
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
Comments
I haven't profiled it but I suspect you are right: this line is the likely bottleneck. |
@wholmgren in #1627 you mentioned looking into optimizations for infinite sheds. I wonder if there is anything in the works? Also here's a quick and dirty profile, for reference: import pvlib
import pandas as pd
times = pd.date_range('2019-01-01', '2019-02-01', freq='5T', tz='Etc/GMT+5')
location = pvlib.location.Location(40, -80)
sp = location.get_solarposition(times)
cs = location.get_clearsky(times, solar_position=sp)
tr = pvlib.tracking.singleaxis(sp.zenith, sp.azimuth)
gcr = 0.5
height = 1.5
pitch = 3.0
albedo = 0.2
result = pvlib.bifacial.infinite_sheds.get_irradiance(
surface_tilt=tr.surface_tilt, surface_azimuth=tr.surface_azimuth,
solar_zenith=sp.zenith, solar_azimuth=sp.azimuth,
gcr=0.5, height=1.5, pitch=3.0,
ghi=cs.ghi, dhi=cs.dhi, dni=cs.dni, albedo=0.2
) |
I identified a few places with repeated calculations and started thinking about larger changes to mostly private functions that would avoid more repeated calculations. So all of that is largely complementary to vectorization. |
This is a great conversation, thanks all for responding so quickly. Is there a timeline by which we could expect some of these perf changes to go in? Excited to use a faster Infinite Sheds. :) |
I tried out vectorizing over @aturabi, separately from these code optimizations, you might take a look at reducing the |
Infinite sheds is quite a bit slower than the modelchain POA modeling we use for frontside (as expected). I see a TODO comment in the code for _vf_ground_sky_integ (
_TODO: vectorize over surface_tilt_
) that could potentially result in some perf improvement for Infinite sheds calls with tracking systems.The text was updated successfully, but these errors were encountered: