-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add benchmarks for infinite sheds #1627
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
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fa51231
slight changes to min asv config
wholmgren 4b83c8f
infite sheds benchmark
wholmgren 3ff475f
get_irradiance benchmarks
wholmgren 60e2fe2
whatsnew
wholmgren 5143406
Update docs/sphinx/source/whatsnew/v0.9.5.rst
wholmgren 98a4b1f
one day
wholmgren c1c999a
cleanup
wholmgren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
""" | ||
ASV benchmarks for infinite_sheds.py | ||
""" | ||
|
||
import numpy as np | ||
import pandas as pd | ||
from pvlib.bifacial import infinite_sheds | ||
from pvlib import location, tracking | ||
|
||
|
||
class InfiniteSheds: | ||
|
||
def setup(self): | ||
self.times = pd.date_range(start='20180601', freq='1min', | ||
periods=1440) | ||
self.location = location.Location(40, -80) | ||
self.solar_position = self.location.get_solarposition(self.times) | ||
self.clearsky_irradiance = self.location.get_clearsky(self.times) | ||
self.surface_tilt = 20 | ||
self.surface_azimuth = 180 | ||
self.gcr = 0.35 | ||
self.height = 2.5 | ||
self.pitch = 5. | ||
self.albedo = 0.2 | ||
self.npoints = 100 | ||
|
||
with np.errstate(invalid='ignore'): | ||
self.tracking = tracking.singleaxis( | ||
self.solar_position['apparent_zenith'], | ||
self.solar_position['azimuth'], | ||
axis_tilt=0, | ||
axis_azimuth=0, | ||
max_angle=60, | ||
backtrack=True, | ||
gcr=self.gcr | ||
) | ||
|
||
def time_get_irradiance_poa_fixed(self): | ||
infinite_sheds.get_irradiance_poa( | ||
surface_tilt=self.surface_tilt, | ||
surface_azimuth=self.surface_azimuth, | ||
solar_zenith=self.solar_position['apparent_zenith'], | ||
solar_azimuth=self.solar_position['azimuth'], | ||
gcr=self.gcr, | ||
height=self.height, | ||
pitch=self.pitch, | ||
ghi=self.clearsky_irradiance['ghi'], | ||
dhi=self.clearsky_irradiance['dhi'], | ||
dni=self.clearsky_irradiance['dni'], | ||
albedo=self.albedo, | ||
npoints=self.npoints | ||
) | ||
|
||
def time_get_irradiance_poa_tracking(self): | ||
infinite_sheds.get_irradiance_poa( | ||
surface_tilt=self.tracking['surface_tilt'], | ||
surface_azimuth=self.tracking['surface_azimuth'], | ||
solar_zenith=self.solar_position['apparent_zenith'], | ||
solar_azimuth=self.solar_position['azimuth'], | ||
gcr=self.gcr, | ||
height=self.height, | ||
pitch=self.pitch, | ||
ghi=self.clearsky_irradiance['ghi'], | ||
dhi=self.clearsky_irradiance['dhi'], | ||
dni=self.clearsky_irradiance['dni'], | ||
albedo=self.albedo, | ||
npoints=self.npoints | ||
) | ||
|
||
def time_get_irradiance_fixed(self): | ||
infinite_sheds.get_irradiance( | ||
surface_tilt=self.surface_tilt, | ||
surface_azimuth=self.surface_azimuth, | ||
solar_zenith=self.solar_position['apparent_zenith'], | ||
solar_azimuth=self.solar_position['azimuth'], | ||
gcr=self.gcr, | ||
height=self.height, | ||
pitch=self.pitch, | ||
ghi=self.clearsky_irradiance['ghi'], | ||
dhi=self.clearsky_irradiance['dhi'], | ||
dni=self.clearsky_irradiance['dni'], | ||
albedo=self.albedo, | ||
npoints=self.npoints | ||
) | ||
|
||
def time_get_irradiance_tracking(self): | ||
infinite_sheds.get_irradiance( | ||
surface_tilt=self.tracking['surface_tilt'], | ||
surface_azimuth=self.tracking['surface_azimuth'], | ||
solar_zenith=self.solar_position['apparent_zenith'], | ||
solar_azimuth=self.solar_position['azimuth'], | ||
gcr=self.gcr, | ||
height=self.height, | ||
pitch=self.pitch, | ||
ghi=self.clearsky_irradiance['ghi'], | ||
dhi=self.clearsky_irradiance['dhi'], | ||
dni=self.clearsky_irradiance['dni'], | ||
albedo=self.albedo, | ||
npoints=self.npoints | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.