From 0264ea242a4d64ccc52e9887c603484601e42946 Mon Sep 17 00:00:00 2001 From: roger-lcc Date: Thu, 21 Apr 2022 13:33:19 +0800 Subject: [PATCH 01/43] test --- benchmarks/benchmarks/solarposition.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index cddf8bed..71bc3070 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -101,9 +101,9 @@ def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): self.times_daily, self.lat, self.lon, declination, equationoftime) - # def time_sun_rise_set_transit_ephem(self, ndays): - # solarposition.sun_rise_set_transit_ephem( - # self.times_daily, self.lat, self.lon) + def time_sun_rise_set_transit_ephem(self, ndays): + solarposition.sun_rise_set_transit_ephem( + self.times_daily, self.lat, self.lon) class SolarPositionCalcTime: From 9964ff3a565a495a6fd7197cbded24f1304cf010 Mon Sep 17 00:00:00 2001 From: roger-lcc Date: Thu, 21 Apr 2022 13:44:11 +0800 Subject: [PATCH 02/43] test --- benchmarks/benchmarks/soiling.py | 3 + benchmarks/benchmarks/solarposition.py | 256 +++++++++---------- benchmarks/benchmarks/solarposition_numba.py | 92 +++---- 3 files changed, 177 insertions(+), 174 deletions(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 8d364925..61cec43b 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -20,6 +20,9 @@ def time_hsu(self, ndays): cleaningthreshold = 0.5 soiling.hsu(self.rainfall, cleaningthreshold, self.tilt, self.pm2_5, self.pm10) + + def time_test(self, nadys): + soiling.hsu(self.rainfall) def time_kimber(self, ndays): cleaningthreshold = 25 diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index 71bc3070..76ac5d44 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -1,128 +1,128 @@ -""" -ASV benchmarks for solarposition.py -""" - -import datetime -import pandas as pd -import pvlib -from pvlib import solarposition - -from pkg_resources import parse_version - - -if parse_version(pvlib.__version__) >= parse_version('0.6.1'): - sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa -else: - sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit - - -class SolarPositionSlow: - params = [1, 10, 100] # number of days - param_names = ['ndays'] - - def setup(self, ndays): - self.times_localized = pd.date_range( - start='20180601', freq='1min', - periods=1440 * ndays, tz='Etc/GMT+7') - self.lat = 35.1 - self.lon = -106.6 - - # GH 512 - def time_ephemeris_localized(self, ndays): - solarposition.ephemeris(self.times_localized, self.lat, self.lon) - - def time_spa_python(self, ndays): - solarposition.spa_python(self.times_localized, self.lat, self.lon) - - def time_pyephem(self, ndays): - solarposition.pyephem(self.times_localized, self.lat, self.lon) - - def time_nrel_earthsun_distance(self, ndays): - solarposition.nrel_earthsun_distance(self.times_localized) - - def time_pyephem_earthsun_distance(self, ndays): - solarposition.pyephem_earthsun_distance(self.times_localized) - - -class SolarPositionFast: - params = [1, 365 * 10, 365 * 100] - param_names = ['ndays'] # provide informative names for the parameters - - def setup(self, ndays): - self.lat = 35.1 - self.lon = -106.6 - self.times_daily = pd.date_range( - start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') - - def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): - dayofyear = self.times_daily.dayofyear - declination = solarposition.declination_spencer71(dayofyear) - equationoftime = solarposition.equation_of_time_spencer71(dayofyear) - solarposition.sun_rise_set_transit_geometric( - self.times_daily, self.lat, self.lon, declination, - equationoftime) - - def time__local_times_from_hours_full_comparison(self, ndays): - dayofyear = self.times_daily.dayofyear - equationoftime = solarposition.equation_of_time_spencer71(dayofyear) - hourangle = solarposition.hour_angle(self.times_daily, - self.lon, equationoftime) - solarposition._hour_angle_to_hours(self.times_daily, - hourangle, self.lon, equationoftime) - - def time_solar_azimuth_analytical_full_comparison(self, nadys): - dayofyear = self.times_daily.dayofyear - equationoftime = solarposition.equation_of_time_spencer71(dayofyear) - declination = solarposition.declination_spencer71(dayofyear) - hourangle = solarposition.hour_angle(self.times_daily, - self.lon, equationoftime) - zenith = solarposition.solar_zenith_analytical(self.lat, - hourangle, declination) - solarposition.solar_azimuth_analytical(self.lat, - hourangle, declination, zenith) - - def time_calculate_simple_day_angle(self, ndays): - solarposition._calculate_simple_day_angle(self.times_daily.dayofyear) - - def time_equation_of_time_pvcdrom(self, ndays): - solarposition.equation_of_time_pvcdrom(self.times_daily.dayofyear) - - def time_declination_cooper69(self, ndays): - solarposition.declination_cooper69(self.times_daily.dayofyear) - - def time_sun_rise_set_transit_spa(self, ndays): - sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon) - - def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): - dayofyear = self.times_daily.dayofyear - declination = solarposition.declination_spencer71(dayofyear) - equationoftime = solarposition.equation_of_time_spencer71(dayofyear) - solarposition.sun_rise_set_transit_geometric( - self.times_daily, self.lat, self.lon, declination, - equationoftime) - - def time_sun_rise_set_transit_ephem(self, ndays): - solarposition.sun_rise_set_transit_ephem( - self.times_daily, self.lat, self.lon) - - -class SolarPositionCalcTime: - - def setup(self): - # test calc_time for finding times at which sun is 3 degrees - # above the horizon. - # Tucson 2020-09-14 sunrise at 6:08 AM MST, 13:08 UTC - # according to google. - self.start = datetime.datetime(2020, 9, 14, 12) - self.end = datetime.datetime(2020, 9, 14, 15) - self.value = 0.05235987755982988 - self.lat = 32.2 - self.lon = -110.9 - self.attribute = 'alt' - - def time_calc_time(self): - # datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=) - solarposition.calc_time( - self.start, self.end, self.lat, self.lon, self.attribute, - self.value - ) +# """ +# ASV benchmarks for solarposition.py +# """ +# +# import datetime +# import pandas as pd +# import pvlib +# from pvlib import solarposition +# +# from pkg_resources import parse_version +# +# +# if parse_version(pvlib.__version__) >= parse_version('0.6.1'): +# sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa +# else: +# sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit +# +# +# class SolarPositionSlow: +# params = [1, 10, 100] # number of days +# param_names = ['ndays'] +# +# def setup(self, ndays): +# self.times_localized = pd.date_range( +# start='20180601', freq='1min', +# periods=1440 * ndays, tz='Etc/GMT+7') +# self.lat = 35.1 +# self.lon = -106.6 +# +# # GH 512 +# def time_ephemeris_localized(self, ndays): +# solarposition.ephemeris(self.times_localized, self.lat, self.lon) +# +# def time_spa_python(self, ndays): +# solarposition.spa_python(self.times_localized, self.lat, self.lon) +# +# def time_pyephem(self, ndays): +# solarposition.pyephem(self.times_localized, self.lat, self.lon) +# +# def time_nrel_earthsun_distance(self, ndays): +# solarposition.nrel_earthsun_distance(self.times_localized) +# +# def time_pyephem_earthsun_distance(self, ndays): +# solarposition.pyephem_earthsun_distance(self.times_localized) +# +# +# class SolarPositionFast: +# params = [1, 365 * 10, 365 * 100] +# param_names = ['ndays'] # provide informative names for the parameters +# +# def setup(self, ndays): +# self.lat = 35.1 +# self.lon = -106.6 +# self.times_daily = pd.date_range( +# start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') +# +# def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): +# dayofyear = self.times_daily.dayofyear +# declination = solarposition.declination_spencer71(dayofyear) +# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) +# solarposition.sun_rise_set_transit_geometric( +# self.times_daily, self.lat, self.lon, declination, +# equationoftime) +# +# def time__local_times_from_hours_full_comparison(self, ndays): +# dayofyear = self.times_daily.dayofyear +# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) +# hourangle = solarposition.hour_angle(self.times_daily, +# self.lon, equationoftime) +# solarposition._hour_angle_to_hours(self.times_daily, +# hourangle, self.lon, equationoftime) +# +# def time_solar_azimuth_analytical_full_comparison(self, nadys): +# dayofyear = self.times_daily.dayofyear +# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) +# declination = solarposition.declination_spencer71(dayofyear) +# hourangle = solarposition.hour_angle(self.times_daily, +# self.lon, equationoftime) +# zenith = solarposition.solar_zenith_analytical(self.lat, +# hourangle, declination) +# solarposition.solar_azimuth_analytical(self.lat, +# hourangle, declination, zenith) +# +# def time_calculate_simple_day_angle(self, ndays): +# solarposition._calculate_simple_day_angle(self.times_daily.dayofyear) +# +# def time_equation_of_time_pvcdrom(self, ndays): +# solarposition.equation_of_time_pvcdrom(self.times_daily.dayofyear) +# +# def time_declination_cooper69(self, ndays): +# solarposition.declination_cooper69(self.times_daily.dayofyear) +# +# def time_sun_rise_set_transit_spa(self, ndays): +# sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon) +# +# def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): +# dayofyear = self.times_daily.dayofyear +# declination = solarposition.declination_spencer71(dayofyear) +# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) +# solarposition.sun_rise_set_transit_geometric( +# self.times_daily, self.lat, self.lon, declination, +# equationoftime) +# +# def time_sun_rise_set_transit_ephem(self, ndays): +# solarposition.sun_rise_set_transit_ephem( +# self.times_daily, self.lat, self.lon) +# +# +# class SolarPositionCalcTime: +# +# def setup(self): +# # test calc_time for finding times at which sun is 3 degrees +# # above the horizon. +# # Tucson 2020-09-14 sunrise at 6:08 AM MST, 13:08 UTC +# # according to google. +# self.start = datetime.datetime(2020, 9, 14, 12) +# self.end = datetime.datetime(2020, 9, 14, 15) +# self.value = 0.05235987755982988 +# self.lat = 32.2 +# self.lon = -110.9 +# self.attribute = 'alt' +# +# def time_calc_time(self): +# # datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=) +# solarposition.calc_time( +# self.start, self.end, self.lat, self.lon, self.attribute, +# self.value +# ) diff --git a/benchmarks/benchmarks/solarposition_numba.py b/benchmarks/benchmarks/solarposition_numba.py index bcadfd18..44416f6f 100644 --- a/benchmarks/benchmarks/solarposition_numba.py +++ b/benchmarks/benchmarks/solarposition_numba.py @@ -1,46 +1,46 @@ -"""ASV benchmarks for solarposition.py using numba. - -We use a separate module so that we can control the pvlib import process -using an environment variable. This will force pvlib to compile the numba -code during setup. - -Try to keep relevant sections in sync with benchmarks/solarposition.py -""" - -from pkg_resources import parse_version -import pandas as pd - -import os -os.environ['PVLIB_USE_NUMBA'] = '1' - - -import pvlib # NOQA: E402 -from pvlib import solarposition # NOQA: E402 - - -if parse_version(pvlib.__version__) >= parse_version('0.6.1'): - sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa -else: - sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit - - -class SolarPositionNumba: - params = [1, 10, 100] # number of days - param_names = ['ndays'] - - def setup(self, ndays): - self.times = pd.date_range(start='20180601', freq='1min', - periods=1440*ndays) - self.times_localized = self.times.tz_localize('Etc/GMT+7') - self.lat = 35.1 - self.lon = -106.6 - self.times_daily = pd.date_range( - start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') - - def time_spa_python(self, ndays): - solarposition.spa_python( - self.times_localized, self.lat, self.lon, how='numba') - - def time_sun_rise_set_transit_spa(self, ndays): - sun_rise_set_transit_spa( - self.times_daily, self.lat, self.lon, how='numba') +# """ASV benchmarks for solarposition.py using numba. +# +# We use a separate module so that we can control the pvlib import process +# using an environment variable. This will force pvlib to compile the numba +# code during setup. +# +# Try to keep relevant sections in sync with benchmarks/solarposition.py +# """ +# +# from pkg_resources import parse_version +# import pandas as pd +# +# import os +# os.environ['PVLIB_USE_NUMBA'] = '1' +# +# +# import pvlib # NOQA: E402 +# from pvlib import solarposition # NOQA: E402 +# +# +# if parse_version(pvlib.__version__) >= parse_version('0.6.1'): +# sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa +# else: +# sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit +# +# +# class SolarPositionNumba: +# params = [1, 10, 100] # number of days +# param_names = ['ndays'] +# +# def setup(self, ndays): +# self.times = pd.date_range(start='20180601', freq='1min', +# periods=1440*ndays) +# self.times_localized = self.times.tz_localize('Etc/GMT+7') +# self.lat = 35.1 +# self.lon = -106.6 +# self.times_daily = pd.date_range( +# start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') +# +# def time_spa_python(self, ndays): +# solarposition.spa_python( +# self.times_localized, self.lat, self.lon, how='numba') +# +# def time_sun_rise_set_transit_spa(self, ndays): +# sun_rise_set_transit_spa( +# self.times_daily, self.lat, self.lon, how='numba') From 614c3d4c836d3b948def4895f8289e1e2fb2b931 Mon Sep 17 00:00:00 2001 From: roger-lcc Date: Thu, 21 Apr 2022 16:15:23 +0800 Subject: [PATCH 03/43] test --- benchmarks/benchmarks/soiling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 61cec43b..f489ea4f 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -20,9 +20,9 @@ def time_hsu(self, ndays): cleaningthreshold = 0.5 soiling.hsu(self.rainfall, cleaningthreshold, self.tilt, self.pm2_5, self.pm10) - + def time_test(self, nadys): - soiling.hsu(self.rainfall) + soiling.hsu(self.rainfall, ) def time_kimber(self, ndays): cleaningthreshold = 25 From 10aedb00d379b4e2e744e4e965855fb425f6c4dd Mon Sep 17 00:00:00 2001 From: roger-lcc Date: Thu, 21 Apr 2022 16:35:20 +0800 Subject: [PATCH 04/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index f489ea4f..b49004c7 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall, ) + soiling.hsu(self.rainfall) def time_kimber(self, ndays): cleaningthreshold = 25 From 6816bbb4a396800eba53541c2625a5fd050c21be Mon Sep 17 00:00:00 2001 From: roger-lcc Date: Thu, 21 Apr 2022 16:48:29 +0800 Subject: [PATCH 05/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index b49004c7..3d903e59 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall) + soiling.hsu(self.rainfall,) def time_kimber(self, ndays): cleaningthreshold = 25 From 476a7aa326ee137fa089dccde8f11056c364a763 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Fri, 22 Apr 2022 22:19:47 +0800 Subject: [PATCH 06/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 3d903e59..b49004c7 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall,) + soiling.hsu(self.rainfall) def time_kimber(self, ndays): cleaningthreshold = 25 From 61ae7210f49b9d4f11845a411a9804fe6c41c3c8 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Fri, 22 Apr 2022 22:32:02 +0800 Subject: [PATCH 07/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index b49004c7..f489ea4f 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall) + soiling.hsu(self.rainfall, ) def time_kimber(self, ndays): cleaningthreshold = 25 From 634bef70d2a9e4847221290a78a31b36577eb137 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Fri, 22 Apr 2022 22:43:35 +0800 Subject: [PATCH 08/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index f489ea4f..b49004c7 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall, ) + soiling.hsu(self.rainfall) def time_kimber(self, ndays): cleaningthreshold = 25 From af81912c7f5170f6073d81a41e621481eab1c6df Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Fri, 22 Apr 2022 23:32:10 +0800 Subject: [PATCH 09/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index b49004c7..f489ea4f 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall) + soiling.hsu(self.rainfall, ) def time_kimber(self, ndays): cleaningthreshold = 25 From e9eee8ea3e38afa20afd85dc7e3b99ba035e0315 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Fri, 22 Apr 2022 23:39:18 +0800 Subject: [PATCH 10/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index f489ea4f..b49004c7 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall, ) + soiling.hsu(self.rainfall) def time_kimber(self, ndays): cleaningthreshold = 25 From c6feaed2411283b2137344c49f136b299ea7763b Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Fri, 22 Apr 2022 23:51:25 +0800 Subject: [PATCH 11/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index b49004c7..f489ea4f 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall) + soiling.hsu(self.rainfall, ) def time_kimber(self, ndays): cleaningthreshold = 25 From e48929f70c2ceb99958fc7b1422f04abad12387a Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 00:00:49 +0800 Subject: [PATCH 12/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index f489ea4f..b49004c7 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall, ) + soiling.hsu(self.rainfall) def time_kimber(self, ndays): cleaningthreshold = 25 From ab03f7498daab2dcd99c576191bc4ddb5f719815 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 00:13:10 +0800 Subject: [PATCH 13/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index b49004c7..f489ea4f 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall) + soiling.hsu(self.rainfall, ) def time_kimber(self, ndays): cleaningthreshold = 25 From 8cba5e3331d7d580c562f9f4465a3d1a576779ed Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 00:17:24 +0800 Subject: [PATCH 14/43] test --- benchmarks/benchmarks/soiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index f489ea4f..b49004c7 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -22,7 +22,7 @@ def time_hsu(self, ndays): self.tilt, self.pm2_5, self.pm10) def time_test(self, nadys): - soiling.hsu(self.rainfall, ) + soiling.hsu(self.rainfall) def time_kimber(self, ndays): cleaningthreshold = 25 From 527ebb2e08a9a38c3161dbe2be5f62dc24cee1c1 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 00:21:49 +0800 Subject: [PATCH 15/43] test --- benchmarks/benchmarks/soiling.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index b49004c7..8d364925 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -21,9 +21,6 @@ def time_hsu(self, ndays): soiling.hsu(self.rainfall, cleaningthreshold, self.tilt, self.pm2_5, self.pm10) - def time_test(self, nadys): - soiling.hsu(self.rainfall) - def time_kimber(self, ndays): cleaningthreshold = 25 soiling.kimber(self.rainfall, cleaningthreshold) \ No newline at end of file From 7aa26c9a49dea6c67de813cbcc4ce9bcc8caf43e Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 00:38:55 +0800 Subject: [PATCH 16/43] test --- benchmarks/benchmarks/solarposition.py | 256 +++++++++---------- benchmarks/benchmarks/solarposition_numba.py | 92 +++---- 2 files changed, 174 insertions(+), 174 deletions(-) diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index 76ac5d44..71bc3070 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -1,128 +1,128 @@ -# """ -# ASV benchmarks for solarposition.py -# """ -# -# import datetime -# import pandas as pd -# import pvlib -# from pvlib import solarposition -# -# from pkg_resources import parse_version -# -# -# if parse_version(pvlib.__version__) >= parse_version('0.6.1'): -# sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa -# else: -# sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit -# -# -# class SolarPositionSlow: -# params = [1, 10, 100] # number of days -# param_names = ['ndays'] -# -# def setup(self, ndays): -# self.times_localized = pd.date_range( -# start='20180601', freq='1min', -# periods=1440 * ndays, tz='Etc/GMT+7') -# self.lat = 35.1 -# self.lon = -106.6 -# -# # GH 512 -# def time_ephemeris_localized(self, ndays): -# solarposition.ephemeris(self.times_localized, self.lat, self.lon) -# -# def time_spa_python(self, ndays): -# solarposition.spa_python(self.times_localized, self.lat, self.lon) -# -# def time_pyephem(self, ndays): -# solarposition.pyephem(self.times_localized, self.lat, self.lon) -# -# def time_nrel_earthsun_distance(self, ndays): -# solarposition.nrel_earthsun_distance(self.times_localized) -# -# def time_pyephem_earthsun_distance(self, ndays): -# solarposition.pyephem_earthsun_distance(self.times_localized) -# -# -# class SolarPositionFast: -# params = [1, 365 * 10, 365 * 100] -# param_names = ['ndays'] # provide informative names for the parameters -# -# def setup(self, ndays): -# self.lat = 35.1 -# self.lon = -106.6 -# self.times_daily = pd.date_range( -# start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') -# -# def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): -# dayofyear = self.times_daily.dayofyear -# declination = solarposition.declination_spencer71(dayofyear) -# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) -# solarposition.sun_rise_set_transit_geometric( -# self.times_daily, self.lat, self.lon, declination, -# equationoftime) -# -# def time__local_times_from_hours_full_comparison(self, ndays): -# dayofyear = self.times_daily.dayofyear -# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) -# hourangle = solarposition.hour_angle(self.times_daily, -# self.lon, equationoftime) -# solarposition._hour_angle_to_hours(self.times_daily, -# hourangle, self.lon, equationoftime) -# -# def time_solar_azimuth_analytical_full_comparison(self, nadys): -# dayofyear = self.times_daily.dayofyear -# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) -# declination = solarposition.declination_spencer71(dayofyear) -# hourangle = solarposition.hour_angle(self.times_daily, -# self.lon, equationoftime) -# zenith = solarposition.solar_zenith_analytical(self.lat, -# hourangle, declination) -# solarposition.solar_azimuth_analytical(self.lat, -# hourangle, declination, zenith) -# -# def time_calculate_simple_day_angle(self, ndays): -# solarposition._calculate_simple_day_angle(self.times_daily.dayofyear) -# -# def time_equation_of_time_pvcdrom(self, ndays): -# solarposition.equation_of_time_pvcdrom(self.times_daily.dayofyear) -# -# def time_declination_cooper69(self, ndays): -# solarposition.declination_cooper69(self.times_daily.dayofyear) -# -# def time_sun_rise_set_transit_spa(self, ndays): -# sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon) -# -# def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): -# dayofyear = self.times_daily.dayofyear -# declination = solarposition.declination_spencer71(dayofyear) -# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) -# solarposition.sun_rise_set_transit_geometric( -# self.times_daily, self.lat, self.lon, declination, -# equationoftime) -# -# def time_sun_rise_set_transit_ephem(self, ndays): -# solarposition.sun_rise_set_transit_ephem( -# self.times_daily, self.lat, self.lon) -# -# -# class SolarPositionCalcTime: -# -# def setup(self): -# # test calc_time for finding times at which sun is 3 degrees -# # above the horizon. -# # Tucson 2020-09-14 sunrise at 6:08 AM MST, 13:08 UTC -# # according to google. -# self.start = datetime.datetime(2020, 9, 14, 12) -# self.end = datetime.datetime(2020, 9, 14, 15) -# self.value = 0.05235987755982988 -# self.lat = 32.2 -# self.lon = -110.9 -# self.attribute = 'alt' -# -# def time_calc_time(self): -# # datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=) -# solarposition.calc_time( -# self.start, self.end, self.lat, self.lon, self.attribute, -# self.value -# ) +""" +ASV benchmarks for solarposition.py +""" + +import datetime +import pandas as pd +import pvlib +from pvlib import solarposition + +from pkg_resources import parse_version + + +if parse_version(pvlib.__version__) >= parse_version('0.6.1'): + sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa +else: + sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit + + +class SolarPositionSlow: + params = [1, 10, 100] # number of days + param_names = ['ndays'] + + def setup(self, ndays): + self.times_localized = pd.date_range( + start='20180601', freq='1min', + periods=1440 * ndays, tz='Etc/GMT+7') + self.lat = 35.1 + self.lon = -106.6 + + # GH 512 + def time_ephemeris_localized(self, ndays): + solarposition.ephemeris(self.times_localized, self.lat, self.lon) + + def time_spa_python(self, ndays): + solarposition.spa_python(self.times_localized, self.lat, self.lon) + + def time_pyephem(self, ndays): + solarposition.pyephem(self.times_localized, self.lat, self.lon) + + def time_nrel_earthsun_distance(self, ndays): + solarposition.nrel_earthsun_distance(self.times_localized) + + def time_pyephem_earthsun_distance(self, ndays): + solarposition.pyephem_earthsun_distance(self.times_localized) + + +class SolarPositionFast: + params = [1, 365 * 10, 365 * 100] + param_names = ['ndays'] # provide informative names for the parameters + + def setup(self, ndays): + self.lat = 35.1 + self.lon = -106.6 + self.times_daily = pd.date_range( + start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') + + def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): + dayofyear = self.times_daily.dayofyear + declination = solarposition.declination_spencer71(dayofyear) + equationoftime = solarposition.equation_of_time_spencer71(dayofyear) + solarposition.sun_rise_set_transit_geometric( + self.times_daily, self.lat, self.lon, declination, + equationoftime) + + def time__local_times_from_hours_full_comparison(self, ndays): + dayofyear = self.times_daily.dayofyear + equationoftime = solarposition.equation_of_time_spencer71(dayofyear) + hourangle = solarposition.hour_angle(self.times_daily, + self.lon, equationoftime) + solarposition._hour_angle_to_hours(self.times_daily, + hourangle, self.lon, equationoftime) + + def time_solar_azimuth_analytical_full_comparison(self, nadys): + dayofyear = self.times_daily.dayofyear + equationoftime = solarposition.equation_of_time_spencer71(dayofyear) + declination = solarposition.declination_spencer71(dayofyear) + hourangle = solarposition.hour_angle(self.times_daily, + self.lon, equationoftime) + zenith = solarposition.solar_zenith_analytical(self.lat, + hourangle, declination) + solarposition.solar_azimuth_analytical(self.lat, + hourangle, declination, zenith) + + def time_calculate_simple_day_angle(self, ndays): + solarposition._calculate_simple_day_angle(self.times_daily.dayofyear) + + def time_equation_of_time_pvcdrom(self, ndays): + solarposition.equation_of_time_pvcdrom(self.times_daily.dayofyear) + + def time_declination_cooper69(self, ndays): + solarposition.declination_cooper69(self.times_daily.dayofyear) + + def time_sun_rise_set_transit_spa(self, ndays): + sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon) + + def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): + dayofyear = self.times_daily.dayofyear + declination = solarposition.declination_spencer71(dayofyear) + equationoftime = solarposition.equation_of_time_spencer71(dayofyear) + solarposition.sun_rise_set_transit_geometric( + self.times_daily, self.lat, self.lon, declination, + equationoftime) + + def time_sun_rise_set_transit_ephem(self, ndays): + solarposition.sun_rise_set_transit_ephem( + self.times_daily, self.lat, self.lon) + + +class SolarPositionCalcTime: + + def setup(self): + # test calc_time for finding times at which sun is 3 degrees + # above the horizon. + # Tucson 2020-09-14 sunrise at 6:08 AM MST, 13:08 UTC + # according to google. + self.start = datetime.datetime(2020, 9, 14, 12) + self.end = datetime.datetime(2020, 9, 14, 15) + self.value = 0.05235987755982988 + self.lat = 32.2 + self.lon = -110.9 + self.attribute = 'alt' + + def time_calc_time(self): + # datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=) + solarposition.calc_time( + self.start, self.end, self.lat, self.lon, self.attribute, + self.value + ) diff --git a/benchmarks/benchmarks/solarposition_numba.py b/benchmarks/benchmarks/solarposition_numba.py index 44416f6f..bcadfd18 100644 --- a/benchmarks/benchmarks/solarposition_numba.py +++ b/benchmarks/benchmarks/solarposition_numba.py @@ -1,46 +1,46 @@ -# """ASV benchmarks for solarposition.py using numba. -# -# We use a separate module so that we can control the pvlib import process -# using an environment variable. This will force pvlib to compile the numba -# code during setup. -# -# Try to keep relevant sections in sync with benchmarks/solarposition.py -# """ -# -# from pkg_resources import parse_version -# import pandas as pd -# -# import os -# os.environ['PVLIB_USE_NUMBA'] = '1' -# -# -# import pvlib # NOQA: E402 -# from pvlib import solarposition # NOQA: E402 -# -# -# if parse_version(pvlib.__version__) >= parse_version('0.6.1'): -# sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa -# else: -# sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit -# -# -# class SolarPositionNumba: -# params = [1, 10, 100] # number of days -# param_names = ['ndays'] -# -# def setup(self, ndays): -# self.times = pd.date_range(start='20180601', freq='1min', -# periods=1440*ndays) -# self.times_localized = self.times.tz_localize('Etc/GMT+7') -# self.lat = 35.1 -# self.lon = -106.6 -# self.times_daily = pd.date_range( -# start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') -# -# def time_spa_python(self, ndays): -# solarposition.spa_python( -# self.times_localized, self.lat, self.lon, how='numba') -# -# def time_sun_rise_set_transit_spa(self, ndays): -# sun_rise_set_transit_spa( -# self.times_daily, self.lat, self.lon, how='numba') +"""ASV benchmarks for solarposition.py using numba. + +We use a separate module so that we can control the pvlib import process +using an environment variable. This will force pvlib to compile the numba +code during setup. + +Try to keep relevant sections in sync with benchmarks/solarposition.py +""" + +from pkg_resources import parse_version +import pandas as pd + +import os +os.environ['PVLIB_USE_NUMBA'] = '1' + + +import pvlib # NOQA: E402 +from pvlib import solarposition # NOQA: E402 + + +if parse_version(pvlib.__version__) >= parse_version('0.6.1'): + sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa +else: + sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit + + +class SolarPositionNumba: + params = [1, 10, 100] # number of days + param_names = ['ndays'] + + def setup(self, ndays): + self.times = pd.date_range(start='20180601', freq='1min', + periods=1440*ndays) + self.times_localized = self.times.tz_localize('Etc/GMT+7') + self.lat = 35.1 + self.lon = -106.6 + self.times_daily = pd.date_range( + start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') + + def time_spa_python(self, ndays): + solarposition.spa_python( + self.times_localized, self.lat, self.lon, how='numba') + + def time_sun_rise_set_transit_spa(self, ndays): + sun_rise_set_transit_spa( + self.times_daily, self.lat, self.lon, how='numba') From 83d2ea5a7ed308f895e643e13cf31687d9a865cc Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 14:11:02 +0800 Subject: [PATCH 17/43] test --- benchmarks/benchmarks/soiling.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 8d364925..4d828377 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -23,4 +23,8 @@ def time_hsu(self, ndays): def time_kimber(self, ndays): cleaningthreshold = 25 - soiling.kimber(self.rainfall, cleaningthreshold) \ No newline at end of file + soiling.kimber(self.rainfall, cleaningthreshold) + + def time_test(self, ndays): + cleaningthreshold = 0.5 + soiling.hsu(self.rainfall, ) From 09f5af77faeb8681b7127f4714662ab0847c5350 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 14:39:58 +0800 Subject: [PATCH 18/43] test --- benchmarks/benchmarks/soiling.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 4d828377..58453095 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -25,6 +25,6 @@ def time_kimber(self, ndays): cleaningthreshold = 25 soiling.kimber(self.rainfall, cleaningthreshold) - def time_test(self, ndays): - cleaningthreshold = 0.5 - soiling.hsu(self.rainfall, ) + # def time_test(self, ndays): + # cleaningthreshold = 0.5 + # soiling.hsu(self.rainfall, ) From 44ca35e03b97c400557313cf296311c52b04ffed Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 14:44:28 +0800 Subject: [PATCH 19/43] test --- benchmarks/benchmarks/soiling.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 58453095..1cfc5781 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -28,3 +28,4 @@ def time_kimber(self, ndays): # def time_test(self, ndays): # cleaningthreshold = 0.5 # soiling.hsu(self.rainfall, ) + From daaee31f82717f7e44ac352769fe7f5174c03f1c Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 14:53:02 +0800 Subject: [PATCH 20/43] test --- benchmarks/benchmarks/soiling.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 1cfc5781..58453095 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -28,4 +28,3 @@ def time_kimber(self, ndays): # def time_test(self, ndays): # cleaningthreshold = 0.5 # soiling.hsu(self.rainfall, ) - From 29a255b308cbceb48b7517fd3aa8fe7f14b56e8c Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 14:58:09 +0800 Subject: [PATCH 21/43] test --- benchmarks/benchmarks/soiling.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 58453095..1cfc5781 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -28,3 +28,4 @@ def time_kimber(self, ndays): # def time_test(self, ndays): # cleaningthreshold = 0.5 # soiling.hsu(self.rainfall, ) + From 36f5979b30d81f53646a1c7b014a1307b274c53f Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 15:05:15 +0800 Subject: [PATCH 22/43] test --- benchmarks/benchmarks/soiling.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 1cfc5781..58453095 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -28,4 +28,3 @@ def time_kimber(self, ndays): # def time_test(self, ndays): # cleaningthreshold = 0.5 # soiling.hsu(self.rainfall, ) - From 3f214365250ff268950dd3d67904f654cf967084 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 15:17:46 +0800 Subject: [PATCH 23/43] test --- benchmarks/benchmarks/soiling.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 58453095..1cfc5781 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -28,3 +28,4 @@ def time_kimber(self, ndays): # def time_test(self, ndays): # cleaningthreshold = 0.5 # soiling.hsu(self.rainfall, ) + From 587176787aadca5bfc5b524a9fa04503479bf8a7 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 17:26:26 +0800 Subject: [PATCH 24/43] test --- benchmarks/benchmarks/location.py | 102 ++++---- benchmarks/benchmarks/solarposition.py | 256 +++++++++---------- benchmarks/benchmarks/solarposition_numba.py | 92 +++---- benchmarks/benchmarks/temperature.py | 102 ++++---- 4 files changed, 276 insertions(+), 276 deletions(-) diff --git a/benchmarks/benchmarks/location.py b/benchmarks/benchmarks/location.py index 2356ca1e..b729da4a 100644 --- a/benchmarks/benchmarks/location.py +++ b/benchmarks/benchmarks/location.py @@ -1,51 +1,51 @@ -""" -ASV benchmarks for location.py -""" - -import pandas as pd -import pvlib -from pkg_resources import parse_version - - -def set_solar_position(obj): - obj.location = pvlib.location.Location(32, -110, altitude=700, - tz='Etc/GMT+7') - obj.times = pd.date_range(start='20180601', freq='3min', - periods=1440) - obj.days = pd.date_range(start='20180101', freq='d', periods=365, - tz=obj.location.tz) - obj.solar_position = obj.location.get_solarposition(obj.times) - - -class Location: - - def setup(self): - set_solar_position(self) - - # GH 502 - def time_location_get_airmass(self): - self.location.get_airmass(solar_position=self.solar_position) - - def time_location_get_solarposition(self): - self.location.get_solarposition(times=self.times) - - def time_location_get_clearsky(self): - self.location.get_clearsky(times=self.times, - solar_position=self.solar_position) - - -class Location_0_6_1: - - def setup(self): - if parse_version(pvlib.__version__) < parse_version('0.6.1'): - raise NotImplementedError - - set_solar_position(self) - - def time_location_get_sun_rise_set_transit_pyephem(self): - self.location.get_sun_rise_set_transit(times=self.days, - method='pyephem') - - def time_location_get_sun_rise_set_transit_spa(self): - self.location.get_sun_rise_set_transit(times=self.days, - method='spa') +# """ +# ASV benchmarks for location.py +# """ +# +# import pandas as pd +# import pvlib +# from pkg_resources import parse_version +# +# +# def set_solar_position(obj): +# obj.location = pvlib.location.Location(32, -110, altitude=700, +# tz='Etc/GMT+7') +# obj.times = pd.date_range(start='20180601', freq='3min', +# periods=1440) +# obj.days = pd.date_range(start='20180101', freq='d', periods=365, +# tz=obj.location.tz) +# obj.solar_position = obj.location.get_solarposition(obj.times) +# +# +# class Location: +# +# def setup(self): +# set_solar_position(self) +# +# # GH 502 +# def time_location_get_airmass(self): +# self.location.get_airmass(solar_position=self.solar_position) +# +# def time_location_get_solarposition(self): +# self.location.get_solarposition(times=self.times) +# +# def time_location_get_clearsky(self): +# self.location.get_clearsky(times=self.times, +# solar_position=self.solar_position) +# +# +# class Location_0_6_1: +# +# def setup(self): +# if parse_version(pvlib.__version__) < parse_version('0.6.1'): +# raise NotImplementedError +# +# set_solar_position(self) +# +# def time_location_get_sun_rise_set_transit_pyephem(self): +# self.location.get_sun_rise_set_transit(times=self.days, +# method='pyephem') +# +# def time_location_get_sun_rise_set_transit_spa(self): +# self.location.get_sun_rise_set_transit(times=self.days, +# method='spa') diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index 71bc3070..76ac5d44 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -1,128 +1,128 @@ -""" -ASV benchmarks for solarposition.py -""" - -import datetime -import pandas as pd -import pvlib -from pvlib import solarposition - -from pkg_resources import parse_version - - -if parse_version(pvlib.__version__) >= parse_version('0.6.1'): - sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa -else: - sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit - - -class SolarPositionSlow: - params = [1, 10, 100] # number of days - param_names = ['ndays'] - - def setup(self, ndays): - self.times_localized = pd.date_range( - start='20180601', freq='1min', - periods=1440 * ndays, tz='Etc/GMT+7') - self.lat = 35.1 - self.lon = -106.6 - - # GH 512 - def time_ephemeris_localized(self, ndays): - solarposition.ephemeris(self.times_localized, self.lat, self.lon) - - def time_spa_python(self, ndays): - solarposition.spa_python(self.times_localized, self.lat, self.lon) - - def time_pyephem(self, ndays): - solarposition.pyephem(self.times_localized, self.lat, self.lon) - - def time_nrel_earthsun_distance(self, ndays): - solarposition.nrel_earthsun_distance(self.times_localized) - - def time_pyephem_earthsun_distance(self, ndays): - solarposition.pyephem_earthsun_distance(self.times_localized) - - -class SolarPositionFast: - params = [1, 365 * 10, 365 * 100] - param_names = ['ndays'] # provide informative names for the parameters - - def setup(self, ndays): - self.lat = 35.1 - self.lon = -106.6 - self.times_daily = pd.date_range( - start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') - - def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): - dayofyear = self.times_daily.dayofyear - declination = solarposition.declination_spencer71(dayofyear) - equationoftime = solarposition.equation_of_time_spencer71(dayofyear) - solarposition.sun_rise_set_transit_geometric( - self.times_daily, self.lat, self.lon, declination, - equationoftime) - - def time__local_times_from_hours_full_comparison(self, ndays): - dayofyear = self.times_daily.dayofyear - equationoftime = solarposition.equation_of_time_spencer71(dayofyear) - hourangle = solarposition.hour_angle(self.times_daily, - self.lon, equationoftime) - solarposition._hour_angle_to_hours(self.times_daily, - hourangle, self.lon, equationoftime) - - def time_solar_azimuth_analytical_full_comparison(self, nadys): - dayofyear = self.times_daily.dayofyear - equationoftime = solarposition.equation_of_time_spencer71(dayofyear) - declination = solarposition.declination_spencer71(dayofyear) - hourangle = solarposition.hour_angle(self.times_daily, - self.lon, equationoftime) - zenith = solarposition.solar_zenith_analytical(self.lat, - hourangle, declination) - solarposition.solar_azimuth_analytical(self.lat, - hourangle, declination, zenith) - - def time_calculate_simple_day_angle(self, ndays): - solarposition._calculate_simple_day_angle(self.times_daily.dayofyear) - - def time_equation_of_time_pvcdrom(self, ndays): - solarposition.equation_of_time_pvcdrom(self.times_daily.dayofyear) - - def time_declination_cooper69(self, ndays): - solarposition.declination_cooper69(self.times_daily.dayofyear) - - def time_sun_rise_set_transit_spa(self, ndays): - sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon) - - def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): - dayofyear = self.times_daily.dayofyear - declination = solarposition.declination_spencer71(dayofyear) - equationoftime = solarposition.equation_of_time_spencer71(dayofyear) - solarposition.sun_rise_set_transit_geometric( - self.times_daily, self.lat, self.lon, declination, - equationoftime) - - def time_sun_rise_set_transit_ephem(self, ndays): - solarposition.sun_rise_set_transit_ephem( - self.times_daily, self.lat, self.lon) - - -class SolarPositionCalcTime: - - def setup(self): - # test calc_time for finding times at which sun is 3 degrees - # above the horizon. - # Tucson 2020-09-14 sunrise at 6:08 AM MST, 13:08 UTC - # according to google. - self.start = datetime.datetime(2020, 9, 14, 12) - self.end = datetime.datetime(2020, 9, 14, 15) - self.value = 0.05235987755982988 - self.lat = 32.2 - self.lon = -110.9 - self.attribute = 'alt' - - def time_calc_time(self): - # datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=) - solarposition.calc_time( - self.start, self.end, self.lat, self.lon, self.attribute, - self.value - ) +# """ +# ASV benchmarks for solarposition.py +# """ +# +# import datetime +# import pandas as pd +# import pvlib +# from pvlib import solarposition +# +# from pkg_resources import parse_version +# +# +# if parse_version(pvlib.__version__) >= parse_version('0.6.1'): +# sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa +# else: +# sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit +# +# +# class SolarPositionSlow: +# params = [1, 10, 100] # number of days +# param_names = ['ndays'] +# +# def setup(self, ndays): +# self.times_localized = pd.date_range( +# start='20180601', freq='1min', +# periods=1440 * ndays, tz='Etc/GMT+7') +# self.lat = 35.1 +# self.lon = -106.6 +# +# # GH 512 +# def time_ephemeris_localized(self, ndays): +# solarposition.ephemeris(self.times_localized, self.lat, self.lon) +# +# def time_spa_python(self, ndays): +# solarposition.spa_python(self.times_localized, self.lat, self.lon) +# +# def time_pyephem(self, ndays): +# solarposition.pyephem(self.times_localized, self.lat, self.lon) +# +# def time_nrel_earthsun_distance(self, ndays): +# solarposition.nrel_earthsun_distance(self.times_localized) +# +# def time_pyephem_earthsun_distance(self, ndays): +# solarposition.pyephem_earthsun_distance(self.times_localized) +# +# +# class SolarPositionFast: +# params = [1, 365 * 10, 365 * 100] +# param_names = ['ndays'] # provide informative names for the parameters +# +# def setup(self, ndays): +# self.lat = 35.1 +# self.lon = -106.6 +# self.times_daily = pd.date_range( +# start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') +# +# def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): +# dayofyear = self.times_daily.dayofyear +# declination = solarposition.declination_spencer71(dayofyear) +# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) +# solarposition.sun_rise_set_transit_geometric( +# self.times_daily, self.lat, self.lon, declination, +# equationoftime) +# +# def time__local_times_from_hours_full_comparison(self, ndays): +# dayofyear = self.times_daily.dayofyear +# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) +# hourangle = solarposition.hour_angle(self.times_daily, +# self.lon, equationoftime) +# solarposition._hour_angle_to_hours(self.times_daily, +# hourangle, self.lon, equationoftime) +# +# def time_solar_azimuth_analytical_full_comparison(self, nadys): +# dayofyear = self.times_daily.dayofyear +# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) +# declination = solarposition.declination_spencer71(dayofyear) +# hourangle = solarposition.hour_angle(self.times_daily, +# self.lon, equationoftime) +# zenith = solarposition.solar_zenith_analytical(self.lat, +# hourangle, declination) +# solarposition.solar_azimuth_analytical(self.lat, +# hourangle, declination, zenith) +# +# def time_calculate_simple_day_angle(self, ndays): +# solarposition._calculate_simple_day_angle(self.times_daily.dayofyear) +# +# def time_equation_of_time_pvcdrom(self, ndays): +# solarposition.equation_of_time_pvcdrom(self.times_daily.dayofyear) +# +# def time_declination_cooper69(self, ndays): +# solarposition.declination_cooper69(self.times_daily.dayofyear) +# +# def time_sun_rise_set_transit_spa(self, ndays): +# sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon) +# +# def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): +# dayofyear = self.times_daily.dayofyear +# declination = solarposition.declination_spencer71(dayofyear) +# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) +# solarposition.sun_rise_set_transit_geometric( +# self.times_daily, self.lat, self.lon, declination, +# equationoftime) +# +# def time_sun_rise_set_transit_ephem(self, ndays): +# solarposition.sun_rise_set_transit_ephem( +# self.times_daily, self.lat, self.lon) +# +# +# class SolarPositionCalcTime: +# +# def setup(self): +# # test calc_time for finding times at which sun is 3 degrees +# # above the horizon. +# # Tucson 2020-09-14 sunrise at 6:08 AM MST, 13:08 UTC +# # according to google. +# self.start = datetime.datetime(2020, 9, 14, 12) +# self.end = datetime.datetime(2020, 9, 14, 15) +# self.value = 0.05235987755982988 +# self.lat = 32.2 +# self.lon = -110.9 +# self.attribute = 'alt' +# +# def time_calc_time(self): +# # datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=) +# solarposition.calc_time( +# self.start, self.end, self.lat, self.lon, self.attribute, +# self.value +# ) diff --git a/benchmarks/benchmarks/solarposition_numba.py b/benchmarks/benchmarks/solarposition_numba.py index bcadfd18..44416f6f 100644 --- a/benchmarks/benchmarks/solarposition_numba.py +++ b/benchmarks/benchmarks/solarposition_numba.py @@ -1,46 +1,46 @@ -"""ASV benchmarks for solarposition.py using numba. - -We use a separate module so that we can control the pvlib import process -using an environment variable. This will force pvlib to compile the numba -code during setup. - -Try to keep relevant sections in sync with benchmarks/solarposition.py -""" - -from pkg_resources import parse_version -import pandas as pd - -import os -os.environ['PVLIB_USE_NUMBA'] = '1' - - -import pvlib # NOQA: E402 -from pvlib import solarposition # NOQA: E402 - - -if parse_version(pvlib.__version__) >= parse_version('0.6.1'): - sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa -else: - sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit - - -class SolarPositionNumba: - params = [1, 10, 100] # number of days - param_names = ['ndays'] - - def setup(self, ndays): - self.times = pd.date_range(start='20180601', freq='1min', - periods=1440*ndays) - self.times_localized = self.times.tz_localize('Etc/GMT+7') - self.lat = 35.1 - self.lon = -106.6 - self.times_daily = pd.date_range( - start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') - - def time_spa_python(self, ndays): - solarposition.spa_python( - self.times_localized, self.lat, self.lon, how='numba') - - def time_sun_rise_set_transit_spa(self, ndays): - sun_rise_set_transit_spa( - self.times_daily, self.lat, self.lon, how='numba') +# """ASV benchmarks for solarposition.py using numba. +# +# We use a separate module so that we can control the pvlib import process +# using an environment variable. This will force pvlib to compile the numba +# code during setup. +# +# Try to keep relevant sections in sync with benchmarks/solarposition.py +# """ +# +# from pkg_resources import parse_version +# import pandas as pd +# +# import os +# os.environ['PVLIB_USE_NUMBA'] = '1' +# +# +# import pvlib # NOQA: E402 +# from pvlib import solarposition # NOQA: E402 +# +# +# if parse_version(pvlib.__version__) >= parse_version('0.6.1'): +# sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa +# else: +# sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit +# +# +# class SolarPositionNumba: +# params = [1, 10, 100] # number of days +# param_names = ['ndays'] +# +# def setup(self, ndays): +# self.times = pd.date_range(start='20180601', freq='1min', +# periods=1440*ndays) +# self.times_localized = self.times.tz_localize('Etc/GMT+7') +# self.lat = 35.1 +# self.lon = -106.6 +# self.times_daily = pd.date_range( +# start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') +# +# def time_spa_python(self, ndays): +# solarposition.spa_python( +# self.times_localized, self.lat, self.lon, how='numba') +# +# def time_sun_rise_set_transit_spa(self, ndays): +# sun_rise_set_transit_spa( +# self.times_daily, self.lat, self.lon, how='numba') diff --git a/benchmarks/benchmarks/temperature.py b/benchmarks/benchmarks/temperature.py index d8a8dad9..58867dd3 100644 --- a/benchmarks/benchmarks/temperature.py +++ b/benchmarks/benchmarks/temperature.py @@ -1,51 +1,51 @@ -""" -ASV benchmarks for irradiance.py -""" - -import pandas as pd -import pvlib -from pkg_resources import parse_version -from functools import partial - - -def set_weather_data(obj): - obj.times = pd.date_range(start='20180601', freq='1min', - periods=14400) - obj.poa = pd.Series(1000, index=obj.times) - obj.tamb = pd.Series(20, index=obj.times) - obj.wind_speed = pd.Series(2, index=obj.times) - - -class SAPM: - - def setup(self): - set_weather_data(self) - if parse_version(pvlib.__version__) >= parse_version('0.7.0'): - kwargs = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm'] - kwargs = kwargs['open_rack_glass_glass'] - self.sapm_cell_wrapper = partial(pvlib.temperature.sapm_cell, - **kwargs) - else: - sapm_celltemp = pvlib.pvsystem.sapm_celltemp - - def sapm_cell_wrapper(poa_global, temp_air, wind_speed): - # just swap order; model params are provided by default - return sapm_celltemp(poa_global, wind_speed, temp_air) - self.sapm_cell_wrapper = sapm_cell_wrapper - - def time_sapm_cell(self): - # use version-appropriate wrapper - self.sapm_cell_wrapper(self.poa, self.tamb, self.wind_speed) - - -class Fuentes: - - def setup(self): - if parse_version(pvlib.__version__) < parse_version('0.8.0'): - raise NotImplementedError - - set_weather_data(self) - - def time_fuentes(self): - pvlib.temperature.fuentes(self.poa, self.tamb, self.wind_speed, - noct_installed=45) +# """ +# ASV benchmarks for irradiance.py +# """ +# +# import pandas as pd +# import pvlib +# from pkg_resources import parse_version +# from functools import partial +# +# +# def set_weather_data(obj): +# obj.times = pd.date_range(start='20180601', freq='1min', +# periods=14400) +# obj.poa = pd.Series(1000, index=obj.times) +# obj.tamb = pd.Series(20, index=obj.times) +# obj.wind_speed = pd.Series(2, index=obj.times) +# +# +# class SAPM: +# +# def setup(self): +# set_weather_data(self) +# if parse_version(pvlib.__version__) >= parse_version('0.7.0'): +# kwargs = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm'] +# kwargs = kwargs['open_rack_glass_glass'] +# self.sapm_cell_wrapper = partial(pvlib.temperature.sapm_cell, +# **kwargs) +# else: +# sapm_celltemp = pvlib.pvsystem.sapm_celltemp +# +# def sapm_cell_wrapper(poa_global, temp_air, wind_speed): +# # just swap order; model params are provided by default +# return sapm_celltemp(poa_global, wind_speed, temp_air) +# self.sapm_cell_wrapper = sapm_cell_wrapper +# +# def time_sapm_cell(self): +# # use version-appropriate wrapper +# self.sapm_cell_wrapper(self.poa, self.tamb, self.wind_speed) +# +# +# class Fuentes: +# +# def setup(self): +# if parse_version(pvlib.__version__) < parse_version('0.8.0'): +# raise NotImplementedError +# +# set_weather_data(self) +# +# def time_fuentes(self): +# pvlib.temperature.fuentes(self.poa, self.tamb, self.wind_speed, +# noct_installed=45) From f017f226d887b294e05da60e2f0790d74f4b3ec5 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 17:29:30 +0800 Subject: [PATCH 25/43] test --- benchmarks/benchmarks/soiling.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 1cfc5781..42b6d6ce 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -25,7 +25,7 @@ def time_kimber(self, ndays): cleaningthreshold = 25 soiling.kimber(self.rainfall, cleaningthreshold) - # def time_test(self, ndays): - # cleaningthreshold = 0.5 - # soiling.hsu(self.rainfall, ) + def time_test(self, ndays): + cleaningthreshold = 0.5 + soiling.hsu(self.rainfall, ) From b361b385edfa382931a08f1386b36fa550e6f491 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 17:35:28 +0800 Subject: [PATCH 26/43] test --- benchmarks/benchmarks/soiling.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 42b6d6ce..4d828377 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -28,4 +28,3 @@ def time_kimber(self, ndays): def time_test(self, ndays): cleaningthreshold = 0.5 soiling.hsu(self.rainfall, ) - From f31c1098667a3a04757ac09fd3e926bd6b8cea37 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 17:38:09 +0800 Subject: [PATCH 27/43] test --- benchmarks/benchmarks/soiling.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 4d828377..42b6d6ce 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -28,3 +28,4 @@ def time_kimber(self, ndays): def time_test(self, ndays): cleaningthreshold = 0.5 soiling.hsu(self.rainfall, ) + From 5752b043e44f012b2f084c0861bccf648a18b71d Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 17:40:32 +0800 Subject: [PATCH 28/43] test --- benchmarks/benchmarks/soiling.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 42b6d6ce..4d828377 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -28,4 +28,3 @@ def time_kimber(self, ndays): def time_test(self, ndays): cleaningthreshold = 0.5 soiling.hsu(self.rainfall, ) - From 6524640de8628337a4d25f66e1f4bfd514a18716 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 23:16:52 +0800 Subject: [PATCH 29/43] test --- benchmarks/benchmarks/soiling.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 4d828377..58453095 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -25,6 +25,6 @@ def time_kimber(self, ndays): cleaningthreshold = 25 soiling.kimber(self.rainfall, cleaningthreshold) - def time_test(self, ndays): - cleaningthreshold = 0.5 - soiling.hsu(self.rainfall, ) + # def time_test(self, ndays): + # cleaningthreshold = 0.5 + # soiling.hsu(self.rainfall, ) From d5f846780aa3324bde62ec7d758acf341534d790 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 23:19:17 +0800 Subject: [PATCH 30/43] test --- pvlib/pvsystem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 6bb89f34..fd6a6bf6 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -3,6 +3,7 @@ performance of PV modules and inverters. """ + from collections import OrderedDict import functools import io From c319dc89e30c02e01060a76ef0196121abb57ebb Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 23:40:07 +0800 Subject: [PATCH 31/43] test --- pvlib/pvsystem.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index fd6a6bf6..6bb89f34 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -3,7 +3,6 @@ performance of PV modules and inverters. """ - from collections import OrderedDict import functools import io From 74ab8a589f4d852aa4e232cfac8c7200690c8693 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 23:44:29 +0800 Subject: [PATCH 32/43] test --- pvlib/pvsystem.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index 6bb89f34..fd6a6bf6 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -3,6 +3,7 @@ performance of PV modules and inverters. """ + from collections import OrderedDict import functools import io From a122c5618600597794083bd9a5f42513711b08e5 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 23:53:22 +0800 Subject: [PATCH 33/43] test --- pvlib/pvsystem.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index fd6a6bf6..6bb89f34 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -3,7 +3,6 @@ performance of PV modules and inverters. """ - from collections import OrderedDict import functools import io From 29b809d3e077d26684cd20d7beca8df1e85c0271 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Sat, 23 Apr 2022 23:54:34 +0800 Subject: [PATCH 34/43] lcc --- benchmarks/benchmarks/soiling.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 58453095..4d828377 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -25,6 +25,6 @@ def time_kimber(self, ndays): cleaningthreshold = 25 soiling.kimber(self.rainfall, cleaningthreshold) - # def time_test(self, ndays): - # cleaningthreshold = 0.5 - # soiling.hsu(self.rainfall, ) + def time_test(self, ndays): + cleaningthreshold = 0.5 + soiling.hsu(self.rainfall, ) From c12af182140b953890e9fd477f32d784082a6b2f Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Tue, 26 Apr 2022 00:24:29 +0800 Subject: [PATCH 35/43] v0.9.0 --- benchmarks/benchmarks/location.py | 102 ++++---- benchmarks/benchmarks/soiling.py | 3 - benchmarks/benchmarks/solarposition.py | 256 +++++++++---------- benchmarks/benchmarks/solarposition_numba.py | 92 +++---- benchmarks/benchmarks/temperature.py | 102 ++++---- 5 files changed, 276 insertions(+), 279 deletions(-) diff --git a/benchmarks/benchmarks/location.py b/benchmarks/benchmarks/location.py index b729da4a..2356ca1e 100644 --- a/benchmarks/benchmarks/location.py +++ b/benchmarks/benchmarks/location.py @@ -1,51 +1,51 @@ -# """ -# ASV benchmarks for location.py -# """ -# -# import pandas as pd -# import pvlib -# from pkg_resources import parse_version -# -# -# def set_solar_position(obj): -# obj.location = pvlib.location.Location(32, -110, altitude=700, -# tz='Etc/GMT+7') -# obj.times = pd.date_range(start='20180601', freq='3min', -# periods=1440) -# obj.days = pd.date_range(start='20180101', freq='d', periods=365, -# tz=obj.location.tz) -# obj.solar_position = obj.location.get_solarposition(obj.times) -# -# -# class Location: -# -# def setup(self): -# set_solar_position(self) -# -# # GH 502 -# def time_location_get_airmass(self): -# self.location.get_airmass(solar_position=self.solar_position) -# -# def time_location_get_solarposition(self): -# self.location.get_solarposition(times=self.times) -# -# def time_location_get_clearsky(self): -# self.location.get_clearsky(times=self.times, -# solar_position=self.solar_position) -# -# -# class Location_0_6_1: -# -# def setup(self): -# if parse_version(pvlib.__version__) < parse_version('0.6.1'): -# raise NotImplementedError -# -# set_solar_position(self) -# -# def time_location_get_sun_rise_set_transit_pyephem(self): -# self.location.get_sun_rise_set_transit(times=self.days, -# method='pyephem') -# -# def time_location_get_sun_rise_set_transit_spa(self): -# self.location.get_sun_rise_set_transit(times=self.days, -# method='spa') +""" +ASV benchmarks for location.py +""" + +import pandas as pd +import pvlib +from pkg_resources import parse_version + + +def set_solar_position(obj): + obj.location = pvlib.location.Location(32, -110, altitude=700, + tz='Etc/GMT+7') + obj.times = pd.date_range(start='20180601', freq='3min', + periods=1440) + obj.days = pd.date_range(start='20180101', freq='d', periods=365, + tz=obj.location.tz) + obj.solar_position = obj.location.get_solarposition(obj.times) + + +class Location: + + def setup(self): + set_solar_position(self) + + # GH 502 + def time_location_get_airmass(self): + self.location.get_airmass(solar_position=self.solar_position) + + def time_location_get_solarposition(self): + self.location.get_solarposition(times=self.times) + + def time_location_get_clearsky(self): + self.location.get_clearsky(times=self.times, + solar_position=self.solar_position) + + +class Location_0_6_1: + + def setup(self): + if parse_version(pvlib.__version__) < parse_version('0.6.1'): + raise NotImplementedError + + set_solar_position(self) + + def time_location_get_sun_rise_set_transit_pyephem(self): + self.location.get_sun_rise_set_transit(times=self.days, + method='pyephem') + + def time_location_get_sun_rise_set_transit_spa(self): + self.location.get_sun_rise_set_transit(times=self.days, + method='spa') diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index 4d828377..a5c17229 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -25,6 +25,3 @@ def time_kimber(self, ndays): cleaningthreshold = 25 soiling.kimber(self.rainfall, cleaningthreshold) - def time_test(self, ndays): - cleaningthreshold = 0.5 - soiling.hsu(self.rainfall, ) diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index 76ac5d44..71bc3070 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -1,128 +1,128 @@ -# """ -# ASV benchmarks for solarposition.py -# """ -# -# import datetime -# import pandas as pd -# import pvlib -# from pvlib import solarposition -# -# from pkg_resources import parse_version -# -# -# if parse_version(pvlib.__version__) >= parse_version('0.6.1'): -# sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa -# else: -# sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit -# -# -# class SolarPositionSlow: -# params = [1, 10, 100] # number of days -# param_names = ['ndays'] -# -# def setup(self, ndays): -# self.times_localized = pd.date_range( -# start='20180601', freq='1min', -# periods=1440 * ndays, tz='Etc/GMT+7') -# self.lat = 35.1 -# self.lon = -106.6 -# -# # GH 512 -# def time_ephemeris_localized(self, ndays): -# solarposition.ephemeris(self.times_localized, self.lat, self.lon) -# -# def time_spa_python(self, ndays): -# solarposition.spa_python(self.times_localized, self.lat, self.lon) -# -# def time_pyephem(self, ndays): -# solarposition.pyephem(self.times_localized, self.lat, self.lon) -# -# def time_nrel_earthsun_distance(self, ndays): -# solarposition.nrel_earthsun_distance(self.times_localized) -# -# def time_pyephem_earthsun_distance(self, ndays): -# solarposition.pyephem_earthsun_distance(self.times_localized) -# -# -# class SolarPositionFast: -# params = [1, 365 * 10, 365 * 100] -# param_names = ['ndays'] # provide informative names for the parameters -# -# def setup(self, ndays): -# self.lat = 35.1 -# self.lon = -106.6 -# self.times_daily = pd.date_range( -# start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') -# -# def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): -# dayofyear = self.times_daily.dayofyear -# declination = solarposition.declination_spencer71(dayofyear) -# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) -# solarposition.sun_rise_set_transit_geometric( -# self.times_daily, self.lat, self.lon, declination, -# equationoftime) -# -# def time__local_times_from_hours_full_comparison(self, ndays): -# dayofyear = self.times_daily.dayofyear -# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) -# hourangle = solarposition.hour_angle(self.times_daily, -# self.lon, equationoftime) -# solarposition._hour_angle_to_hours(self.times_daily, -# hourangle, self.lon, equationoftime) -# -# def time_solar_azimuth_analytical_full_comparison(self, nadys): -# dayofyear = self.times_daily.dayofyear -# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) -# declination = solarposition.declination_spencer71(dayofyear) -# hourangle = solarposition.hour_angle(self.times_daily, -# self.lon, equationoftime) -# zenith = solarposition.solar_zenith_analytical(self.lat, -# hourangle, declination) -# solarposition.solar_azimuth_analytical(self.lat, -# hourangle, declination, zenith) -# -# def time_calculate_simple_day_angle(self, ndays): -# solarposition._calculate_simple_day_angle(self.times_daily.dayofyear) -# -# def time_equation_of_time_pvcdrom(self, ndays): -# solarposition.equation_of_time_pvcdrom(self.times_daily.dayofyear) -# -# def time_declination_cooper69(self, ndays): -# solarposition.declination_cooper69(self.times_daily.dayofyear) -# -# def time_sun_rise_set_transit_spa(self, ndays): -# sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon) -# -# def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): -# dayofyear = self.times_daily.dayofyear -# declination = solarposition.declination_spencer71(dayofyear) -# equationoftime = solarposition.equation_of_time_spencer71(dayofyear) -# solarposition.sun_rise_set_transit_geometric( -# self.times_daily, self.lat, self.lon, declination, -# equationoftime) -# -# def time_sun_rise_set_transit_ephem(self, ndays): -# solarposition.sun_rise_set_transit_ephem( -# self.times_daily, self.lat, self.lon) -# -# -# class SolarPositionCalcTime: -# -# def setup(self): -# # test calc_time for finding times at which sun is 3 degrees -# # above the horizon. -# # Tucson 2020-09-14 sunrise at 6:08 AM MST, 13:08 UTC -# # according to google. -# self.start = datetime.datetime(2020, 9, 14, 12) -# self.end = datetime.datetime(2020, 9, 14, 15) -# self.value = 0.05235987755982988 -# self.lat = 32.2 -# self.lon = -110.9 -# self.attribute = 'alt' -# -# def time_calc_time(self): -# # datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=) -# solarposition.calc_time( -# self.start, self.end, self.lat, self.lon, self.attribute, -# self.value -# ) +""" +ASV benchmarks for solarposition.py +""" + +import datetime +import pandas as pd +import pvlib +from pvlib import solarposition + +from pkg_resources import parse_version + + +if parse_version(pvlib.__version__) >= parse_version('0.6.1'): + sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa +else: + sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit + + +class SolarPositionSlow: + params = [1, 10, 100] # number of days + param_names = ['ndays'] + + def setup(self, ndays): + self.times_localized = pd.date_range( + start='20180601', freq='1min', + periods=1440 * ndays, tz='Etc/GMT+7') + self.lat = 35.1 + self.lon = -106.6 + + # GH 512 + def time_ephemeris_localized(self, ndays): + solarposition.ephemeris(self.times_localized, self.lat, self.lon) + + def time_spa_python(self, ndays): + solarposition.spa_python(self.times_localized, self.lat, self.lon) + + def time_pyephem(self, ndays): + solarposition.pyephem(self.times_localized, self.lat, self.lon) + + def time_nrel_earthsun_distance(self, ndays): + solarposition.nrel_earthsun_distance(self.times_localized) + + def time_pyephem_earthsun_distance(self, ndays): + solarposition.pyephem_earthsun_distance(self.times_localized) + + +class SolarPositionFast: + params = [1, 365 * 10, 365 * 100] + param_names = ['ndays'] # provide informative names for the parameters + + def setup(self, ndays): + self.lat = 35.1 + self.lon = -106.6 + self.times_daily = pd.date_range( + start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') + + def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): + dayofyear = self.times_daily.dayofyear + declination = solarposition.declination_spencer71(dayofyear) + equationoftime = solarposition.equation_of_time_spencer71(dayofyear) + solarposition.sun_rise_set_transit_geometric( + self.times_daily, self.lat, self.lon, declination, + equationoftime) + + def time__local_times_from_hours_full_comparison(self, ndays): + dayofyear = self.times_daily.dayofyear + equationoftime = solarposition.equation_of_time_spencer71(dayofyear) + hourangle = solarposition.hour_angle(self.times_daily, + self.lon, equationoftime) + solarposition._hour_angle_to_hours(self.times_daily, + hourangle, self.lon, equationoftime) + + def time_solar_azimuth_analytical_full_comparison(self, nadys): + dayofyear = self.times_daily.dayofyear + equationoftime = solarposition.equation_of_time_spencer71(dayofyear) + declination = solarposition.declination_spencer71(dayofyear) + hourangle = solarposition.hour_angle(self.times_daily, + self.lon, equationoftime) + zenith = solarposition.solar_zenith_analytical(self.lat, + hourangle, declination) + solarposition.solar_azimuth_analytical(self.lat, + hourangle, declination, zenith) + + def time_calculate_simple_day_angle(self, ndays): + solarposition._calculate_simple_day_angle(self.times_daily.dayofyear) + + def time_equation_of_time_pvcdrom(self, ndays): + solarposition.equation_of_time_pvcdrom(self.times_daily.dayofyear) + + def time_declination_cooper69(self, ndays): + solarposition.declination_cooper69(self.times_daily.dayofyear) + + def time_sun_rise_set_transit_spa(self, ndays): + sun_rise_set_transit_spa(self.times_daily, self.lat, self.lon) + + def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): + dayofyear = self.times_daily.dayofyear + declination = solarposition.declination_spencer71(dayofyear) + equationoftime = solarposition.equation_of_time_spencer71(dayofyear) + solarposition.sun_rise_set_transit_geometric( + self.times_daily, self.lat, self.lon, declination, + equationoftime) + + def time_sun_rise_set_transit_ephem(self, ndays): + solarposition.sun_rise_set_transit_ephem( + self.times_daily, self.lat, self.lon) + + +class SolarPositionCalcTime: + + def setup(self): + # test calc_time for finding times at which sun is 3 degrees + # above the horizon. + # Tucson 2020-09-14 sunrise at 6:08 AM MST, 13:08 UTC + # according to google. + self.start = datetime.datetime(2020, 9, 14, 12) + self.end = datetime.datetime(2020, 9, 14, 15) + self.value = 0.05235987755982988 + self.lat = 32.2 + self.lon = -110.9 + self.attribute = 'alt' + + def time_calc_time(self): + # datetime.datetime(2020, 9, 14, 13, 24, 13, 861913, tzinfo=) + solarposition.calc_time( + self.start, self.end, self.lat, self.lon, self.attribute, + self.value + ) diff --git a/benchmarks/benchmarks/solarposition_numba.py b/benchmarks/benchmarks/solarposition_numba.py index 44416f6f..bcadfd18 100644 --- a/benchmarks/benchmarks/solarposition_numba.py +++ b/benchmarks/benchmarks/solarposition_numba.py @@ -1,46 +1,46 @@ -# """ASV benchmarks for solarposition.py using numba. -# -# We use a separate module so that we can control the pvlib import process -# using an environment variable. This will force pvlib to compile the numba -# code during setup. -# -# Try to keep relevant sections in sync with benchmarks/solarposition.py -# """ -# -# from pkg_resources import parse_version -# import pandas as pd -# -# import os -# os.environ['PVLIB_USE_NUMBA'] = '1' -# -# -# import pvlib # NOQA: E402 -# from pvlib import solarposition # NOQA: E402 -# -# -# if parse_version(pvlib.__version__) >= parse_version('0.6.1'): -# sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa -# else: -# sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit -# -# -# class SolarPositionNumba: -# params = [1, 10, 100] # number of days -# param_names = ['ndays'] -# -# def setup(self, ndays): -# self.times = pd.date_range(start='20180601', freq='1min', -# periods=1440*ndays) -# self.times_localized = self.times.tz_localize('Etc/GMT+7') -# self.lat = 35.1 -# self.lon = -106.6 -# self.times_daily = pd.date_range( -# start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') -# -# def time_spa_python(self, ndays): -# solarposition.spa_python( -# self.times_localized, self.lat, self.lon, how='numba') -# -# def time_sun_rise_set_transit_spa(self, ndays): -# sun_rise_set_transit_spa( -# self.times_daily, self.lat, self.lon, how='numba') +"""ASV benchmarks for solarposition.py using numba. + +We use a separate module so that we can control the pvlib import process +using an environment variable. This will force pvlib to compile the numba +code during setup. + +Try to keep relevant sections in sync with benchmarks/solarposition.py +""" + +from pkg_resources import parse_version +import pandas as pd + +import os +os.environ['PVLIB_USE_NUMBA'] = '1' + + +import pvlib # NOQA: E402 +from pvlib import solarposition # NOQA: E402 + + +if parse_version(pvlib.__version__) >= parse_version('0.6.1'): + sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa +else: + sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit + + +class SolarPositionNumba: + params = [1, 10, 100] # number of days + param_names = ['ndays'] + + def setup(self, ndays): + self.times = pd.date_range(start='20180601', freq='1min', + periods=1440*ndays) + self.times_localized = self.times.tz_localize('Etc/GMT+7') + self.lat = 35.1 + self.lon = -106.6 + self.times_daily = pd.date_range( + start='20180601', freq='24h', periods=ndays, tz='Etc/GMT+7') + + def time_spa_python(self, ndays): + solarposition.spa_python( + self.times_localized, self.lat, self.lon, how='numba') + + def time_sun_rise_set_transit_spa(self, ndays): + sun_rise_set_transit_spa( + self.times_daily, self.lat, self.lon, how='numba') diff --git a/benchmarks/benchmarks/temperature.py b/benchmarks/benchmarks/temperature.py index 58867dd3..d8a8dad9 100644 --- a/benchmarks/benchmarks/temperature.py +++ b/benchmarks/benchmarks/temperature.py @@ -1,51 +1,51 @@ -# """ -# ASV benchmarks for irradiance.py -# """ -# -# import pandas as pd -# import pvlib -# from pkg_resources import parse_version -# from functools import partial -# -# -# def set_weather_data(obj): -# obj.times = pd.date_range(start='20180601', freq='1min', -# periods=14400) -# obj.poa = pd.Series(1000, index=obj.times) -# obj.tamb = pd.Series(20, index=obj.times) -# obj.wind_speed = pd.Series(2, index=obj.times) -# -# -# class SAPM: -# -# def setup(self): -# set_weather_data(self) -# if parse_version(pvlib.__version__) >= parse_version('0.7.0'): -# kwargs = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm'] -# kwargs = kwargs['open_rack_glass_glass'] -# self.sapm_cell_wrapper = partial(pvlib.temperature.sapm_cell, -# **kwargs) -# else: -# sapm_celltemp = pvlib.pvsystem.sapm_celltemp -# -# def sapm_cell_wrapper(poa_global, temp_air, wind_speed): -# # just swap order; model params are provided by default -# return sapm_celltemp(poa_global, wind_speed, temp_air) -# self.sapm_cell_wrapper = sapm_cell_wrapper -# -# def time_sapm_cell(self): -# # use version-appropriate wrapper -# self.sapm_cell_wrapper(self.poa, self.tamb, self.wind_speed) -# -# -# class Fuentes: -# -# def setup(self): -# if parse_version(pvlib.__version__) < parse_version('0.8.0'): -# raise NotImplementedError -# -# set_weather_data(self) -# -# def time_fuentes(self): -# pvlib.temperature.fuentes(self.poa, self.tamb, self.wind_speed, -# noct_installed=45) +""" +ASV benchmarks for irradiance.py +""" + +import pandas as pd +import pvlib +from pkg_resources import parse_version +from functools import partial + + +def set_weather_data(obj): + obj.times = pd.date_range(start='20180601', freq='1min', + periods=14400) + obj.poa = pd.Series(1000, index=obj.times) + obj.tamb = pd.Series(20, index=obj.times) + obj.wind_speed = pd.Series(2, index=obj.times) + + +class SAPM: + + def setup(self): + set_weather_data(self) + if parse_version(pvlib.__version__) >= parse_version('0.7.0'): + kwargs = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm'] + kwargs = kwargs['open_rack_glass_glass'] + self.sapm_cell_wrapper = partial(pvlib.temperature.sapm_cell, + **kwargs) + else: + sapm_celltemp = pvlib.pvsystem.sapm_celltemp + + def sapm_cell_wrapper(poa_global, temp_air, wind_speed): + # just swap order; model params are provided by default + return sapm_celltemp(poa_global, wind_speed, temp_air) + self.sapm_cell_wrapper = sapm_cell_wrapper + + def time_sapm_cell(self): + # use version-appropriate wrapper + self.sapm_cell_wrapper(self.poa, self.tamb, self.wind_speed) + + +class Fuentes: + + def setup(self): + if parse_version(pvlib.__version__) < parse_version('0.8.0'): + raise NotImplementedError + + set_weather_data(self) + + def time_fuentes(self): + pvlib.temperature.fuentes(self.poa, self.tamb, self.wind_speed, + noct_installed=45) From 84edfb90c789b61231efd94fbefb9fb5851f52af Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Tue, 26 Apr 2022 01:02:41 +0800 Subject: [PATCH 36/43] test --- benchmarks/benchmarks/location.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/benchmarks/location.py b/benchmarks/benchmarks/location.py index 2356ca1e..2e5a31ca 100644 --- a/benchmarks/benchmarks/location.py +++ b/benchmarks/benchmarks/location.py @@ -2,6 +2,7 @@ ASV benchmarks for location.py """ + import pandas as pd import pvlib from pkg_resources import parse_version From f9e66d6192931b2836d05d3b8c16484b8e810ec7 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Tue, 26 Apr 2022 01:04:52 +0800 Subject: [PATCH 37/43] test --- benchmarks/benchmarks/location.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/benchmarks/location.py b/benchmarks/benchmarks/location.py index 2e5a31ca..2356ca1e 100644 --- a/benchmarks/benchmarks/location.py +++ b/benchmarks/benchmarks/location.py @@ -2,7 +2,6 @@ ASV benchmarks for location.py """ - import pandas as pd import pvlib from pkg_resources import parse_version From e55abffc8fce8fb4a98d7daac4b3275917f3d214 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Tue, 26 Apr 2022 01:06:49 +0800 Subject: [PATCH 38/43] test --- benchmarks/benchmarks/location.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/benchmarks/location.py b/benchmarks/benchmarks/location.py index 2356ca1e..2e5a31ca 100644 --- a/benchmarks/benchmarks/location.py +++ b/benchmarks/benchmarks/location.py @@ -2,6 +2,7 @@ ASV benchmarks for location.py """ + import pandas as pd import pvlib from pkg_resources import parse_version From b48545879edfdd3c8077a52ec3e8fe8572b2ca72 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Tue, 26 Apr 2022 01:13:16 +0800 Subject: [PATCH 39/43] test --- benchmarks/benchmarks/location.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/benchmarks/location.py b/benchmarks/benchmarks/location.py index 2e5a31ca..2356ca1e 100644 --- a/benchmarks/benchmarks/location.py +++ b/benchmarks/benchmarks/location.py @@ -2,7 +2,6 @@ ASV benchmarks for location.py """ - import pandas as pd import pvlib from pkg_resources import parse_version From 4158fd0c2ce0d592c71274c732dcc1220f8f66b9 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Wed, 27 Apr 2022 01:04:20 +0800 Subject: [PATCH 40/43] asv --- benchmarks/benchmarks/solarposition.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index 71bc3070..e759c4e7 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -2,6 +2,7 @@ ASV benchmarks for solarposition.py """ + import datetime import pandas as pd import pvlib From 0f342cfe7a1e014ed12c140101c8d821d29c2b1e Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Wed, 27 Apr 2022 01:11:20 +0800 Subject: [PATCH 41/43] asv --- benchmarks/benchmarks/solarposition.py | 1 - 1 file changed, 1 deletion(-) diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index e759c4e7..71bc3070 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -2,7 +2,6 @@ ASV benchmarks for solarposition.py """ - import datetime import pandas as pd import pvlib From 56a42bb55e300a186d2683e9eb5e9c36e6df57d4 Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Wed, 27 Apr 2022 01:25:50 +0800 Subject: [PATCH 42/43] asv --- benchmarks/benchmarks/solarposition.py | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index 71bc3070..e759c4e7 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -2,6 +2,7 @@ ASV benchmarks for solarposition.py """ + import datetime import pandas as pd import pvlib From b7dca4c243fba5d5306d1b67e21227ac97eec58d Mon Sep 17 00:00:00 2001 From: roger-lcc <953120129@qq.com> Date: Wed, 27 Apr 2022 01:32:03 +0800 Subject: [PATCH 43/43] asv --- benchmarks/benchmarks/soiling.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/benchmarks/benchmarks/soiling.py b/benchmarks/benchmarks/soiling.py index a5c17229..e1d76a2a 100644 --- a/benchmarks/benchmarks/soiling.py +++ b/benchmarks/benchmarks/soiling.py @@ -25,3 +25,6 @@ def time_kimber(self, ndays): cleaningthreshold = 25 soiling.kimber(self.rainfall, cleaningthreshold) + def time_hsu(self, ndays): + cleaningthreshold = 0.5 + soiling.hsu(self.rainfall, )