diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index c3340f4e15..9bc019bd8e 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -115,13 +115,13 @@ { "python": "3.7", "build": "", - "numpy": "1.16.0", + "numpy": "1.16.5", "pandas": "0.25.0", "scipy": "1.4.0", // Note: these don't have a minimum in setup.py - "h5py": "2.10.0", + "h5py": "3.1.0", "ephem": "3.7.6.0", - "numba": "0.40.0", + "numba": "0.40.0" }, // latest versions available { diff --git a/benchmarks/benchmarks/infinite_sheds.py b/benchmarks/benchmarks/infinite_sheds.py new file mode 100644 index 0000000000..573cf19d7a --- /dev/null +++ b/benchmarks/benchmarks/infinite_sheds.py @@ -0,0 +1,103 @@ +""" +ASV benchmarks for infinite_sheds.py +""" + +import numpy as np +import pandas as pd +from pvlib.bifacial import infinite_sheds +from pvlib import location, tracking + + +class InfiniteSheds: + + def setup(self): + self.times = pd.date_range(start='20180601', freq='1min', + periods=1440) + self.location = location.Location(40, -80) + self.solar_position = self.location.get_solarposition(self.times) + self.clearsky_irradiance = self.location.get_clearsky( + self.times, + solar_position=self.solar_position, + ) + self.surface_tilt = 20 + self.surface_azimuth = 180 + self.gcr = 0.35 + self.height = 2.5 + self.pitch = 5. + self.albedo = 0.2 + self.npoints = 100 + + with np.errstate(invalid='ignore'): + self.tracking = tracking.singleaxis( + self.solar_position['apparent_zenith'], + self.solar_position['azimuth'], + axis_tilt=0, + axis_azimuth=0, + max_angle=60, + backtrack=True, + gcr=self.gcr + ) + + def time_get_irradiance_poa_fixed(self): + infinite_sheds.get_irradiance_poa( + surface_tilt=self.surface_tilt, + surface_azimuth=self.surface_azimuth, + solar_zenith=self.solar_position['apparent_zenith'], + solar_azimuth=self.solar_position['azimuth'], + gcr=self.gcr, + height=self.height, + pitch=self.pitch, + ghi=self.clearsky_irradiance['ghi'], + dhi=self.clearsky_irradiance['dhi'], + dni=self.clearsky_irradiance['dni'], + albedo=self.albedo, + npoints=self.npoints + ) + + def time_get_irradiance_poa_tracking(self): + infinite_sheds.get_irradiance_poa( + surface_tilt=self.tracking['surface_tilt'], + surface_azimuth=self.tracking['surface_azimuth'], + solar_zenith=self.solar_position['apparent_zenith'], + solar_azimuth=self.solar_position['azimuth'], + gcr=self.gcr, + height=self.height, + pitch=self.pitch, + ghi=self.clearsky_irradiance['ghi'], + dhi=self.clearsky_irradiance['dhi'], + dni=self.clearsky_irradiance['dni'], + albedo=self.albedo, + npoints=self.npoints + ) + + def time_get_irradiance_fixed(self): + infinite_sheds.get_irradiance( + surface_tilt=self.surface_tilt, + surface_azimuth=self.surface_azimuth, + solar_zenith=self.solar_position['apparent_zenith'], + solar_azimuth=self.solar_position['azimuth'], + gcr=self.gcr, + height=self.height, + pitch=self.pitch, + ghi=self.clearsky_irradiance['ghi'], + dhi=self.clearsky_irradiance['dhi'], + dni=self.clearsky_irradiance['dni'], + albedo=self.albedo, + npoints=self.npoints + ) + + def time_get_irradiance_tracking(self): + infinite_sheds.get_irradiance( + surface_tilt=self.tracking['surface_tilt'], + surface_azimuth=self.tracking['surface_azimuth'], + solar_zenith=self.solar_position['apparent_zenith'], + solar_azimuth=self.solar_position['azimuth'], + gcr=self.gcr, + height=self.height, + pitch=self.pitch, + ghi=self.clearsky_irradiance['ghi'], + dhi=self.clearsky_irradiance['dhi'], + dni=self.clearsky_irradiance['dni'], + albedo=self.albedo, + npoints=self.npoints + ) diff --git a/docs/sphinx/source/whatsnew.rst b/docs/sphinx/source/whatsnew.rst index 464e59f121..d32104e889 100644 --- a/docs/sphinx/source/whatsnew.rst +++ b/docs/sphinx/source/whatsnew.rst @@ -6,6 +6,7 @@ What's New These are new features and improvements of note in each release. +.. include:: whatsnew/v0.9.5.rst .. include:: whatsnew/v0.9.4.rst .. include:: whatsnew/v0.9.3.rst .. include:: whatsnew/v0.9.2.rst diff --git a/docs/sphinx/source/whatsnew/v0.9.5.rst b/docs/sphinx/source/whatsnew/v0.9.5.rst index adf31d02f6..32b785fbfd 100644 --- a/docs/sphinx/source/whatsnew/v0.9.5.rst +++ b/docs/sphinx/source/whatsnew/v0.9.5.rst @@ -32,7 +32,7 @@ Documentation Benchmarking ~~~~~~~~~~~~~ - +* Added benchmarks for :py:mod:`pvlib.bifacial.infinite_sheds` (:pull:`1627`) Requirements ~~~~~~~~~~~~ @@ -40,4 +40,5 @@ Requirements Contributors ~~~~~~~~~~~~ - +* Kevin Anderson (:ghuser:`kanderso-nrel`) +* Will Holmgren (:ghuser:`wholmgren`)