10000 Set up airspeed velocity benchmarks by kandersolar · Pull Request #1049 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Set up airspeed velocity benchmarks #1049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Sep 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ecf2a9e
add airspeed velocity config and tests
wholmgren Aug 13, 2018
d53b782
add documentation
wholmgren Aug 14, 2018
cd25327
Merge branch 'master' into asv_setup
kandersolar Mar 22, 2020
c75c24d
move whatsnew line to 0.7.2
kandersolar Mar 22, 2020
53568cb
update asv.conf.json to most recent asv format
kandersolar Mar 22, 2020
37095c2
add useful tips to readme
kandersolar Mar 22, 2020
1c6cbb7
modify asv conf to install optional pvlib reqs (pytables etc)
kandersolar Mar 22, 2020
8db2f63
add more benchmarks for location and solarposition
kandersolar Mar 22, 2020
48e6366
fix solarposition docstring
kandersolar Mar 22, 2020
636bcaf
add tracking benchmark file
kandersolar Mar 22, 2020
8000
5a93520
add irradiance benchmark file
kandersolar Mar 22, 2020
d480806
fix tracking benchmarks
kandersolar Mar 22, 2020
8b3eb3c
Merge branch 'master' into asv_setup
kandersolar Jul 22, 2020
c07003a
test python3.7 only, regardless of installed version
kandersolar Jul 22, 2020
329ba90
switch from conda to virtualenv
kandersolar Jul 22, 2020
066bd9e
restructure
kandersolar Sep 5, 2020
2e3c76e
stickler
kandersolar Sep 6, 2020
3f5b1ba
drop old whatsnew entry
kandersolar Sep 6, 2020
008f8ca
use separate classes for version checking
kandersolar Sep 6, 2020
25d7b9f
fix aoi_projection benchmark
kandersolar Sep 7, 2020
daf7e40
do version switching in setup() instead of in global scope
kandersolar Sep 7, 2020
c7bb2ec
singular space to satisfy stickler
kandersolar Sep 7, 2020
01e79a4
move asv conf to pvlib
kandersolar Sep 8, 2020
0ff98b6
move benchmarks to subdirectory
kandersolar Sep 8, 2020
d42ef6d
change to local repo instead of cloning from GH
kandersolar Sep 9, 2020
37993fa
docs
kandersolar Sep 9, 2020
605d744
update benchmark readme
kandersolar Sep 9, 2020
8c43a12
Merge branch 'master' into asv_setup
kandersolar Sep 10, 2020
73e6347
create 0.8.1 whatsnew
kandersolar Sep 10, 2020
791ee9b
conda channel ordering
kandersolar Sep 10, 2020
64adc84
link to readme
kandersolar Sep 10, 2020
1021400
fix wrong link
kandersolar Sep 10, 2020
85235a5
benchmark on minimum and latest dependency versions
kandersolar Sep 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use separate classes for version checking
  • Loading branch information
kandersolar committed Sep 6, 2020
commit 008f8ca8bb92a5fe6ccdb7cb37027083e2d602d7
2 changes: 1 addition & 1 deletion benchmarks/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pvlib import irradiance, location


class TimeSuite:
class Irradiance:

def setup(self):
self.times = pd.date_range(start='20180601', freq='1min',
Expand Down
43 changes: 27 additions & 16 deletions benchmarks/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
from pkg_resources import parse_version


class TimeSuite:
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):
self.location = pvlib.location.Location(32, -110, altitude=700,
tz='Etc/GMT+7')
self.times = pd.date_range(start='20180601', freq='3min',
periods=1440)
self.days = pd.date_range(start='20180101', freq='d', periods=365,
tz=self.location.tz)
self.solar_position = self.location.get_solarposition(self.times)
set_solar_position(self)

# GH 502
def time_location_get_airmass(self):
Expand All @@ -29,12 +33,19 @@ def time_location_get_clearsky(self):
self.location.get_clearsky(times=self.times,
solar_position=self.solar_position)

if parse_version(pvlib.__version__) >= parse_version('0.6.1'):
def time_location_get_sun_rise_set_transit_pyephem(self):
self.location.get_sun_rise_set_transit(times=self.days,
method='pyephem')

if parse_version(pvlib.__version__) >= parse_version('0.6.1'):
8000 def time_location_get_sun_rise_set_transit_spa(self):
self.location.get_sun_rise_set_transit(times=self.days,
method='spa')
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')
2 changes: 1 addition & 1 deletion benchmarks/solarposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit


class TimeSuite:
class SolarPosition:

def setup(self):
self.times = pd.date_range(start='20180601', freq='1min',
Expand Down
50 changes: 50 additions & 0 deletions benchmarks/temperature.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""
ASV benchmarks for irradiance.py
"""

import pandas as pd
import pvlib
from pkg_resources import parse_version
import functools


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.windspeed = pd.Series(2, index=obj.times)


if parse_version(pvlib.__version__) >= parse_version('0.7.0'):
params = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm']
params = params['open_rack_glass_glass']
sapm_cell = functools.partial(pvlib.temperature.sapm_cell, **params)
else:
sapm_celltemp = pvlib.pvsystem.sapm_celltemp

def sapm_cell(poa_global, temp_air, wind_speed):
return sapm_celltemp(poa_global, wind_speed, temp_air)


class SAPM:

def setup(self):
set_weather_data(self)

def time_sapm_cell(self):
# use version-appropriate wrapper
sapm_cell(self.poa, self.tamb, self.windspeed)


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)
2 changes: 1 addition & 1 deletion benchmarks/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np


class TimeSuite:
class SingleAxis:

def setup(self):
self.times = pd.date_range(start='20180601', freq='1min',
Expand Down
0