-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Improved benchmark in solarposition.py #1443
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
Open
roger-lcc
wants to merge
12
commits into
pvlib:main
Choose a base branch
from
roger-lcc:benchmark-improvement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bd8b8b3
Improved benchmark in solarposition.py
roger-two 3c508d5
Improved benchmark in solarposition.py
roger-two 981aa5e
improved benchmark in solarposition.py
roger-two 3c248c3
deleting useless benchmark
roger-two 221bc55
deleting useless benchmark
roger-two 98be326
change for wrong checks
roger-two 9480d41
change for stickler-ci
roger-two 68b2800
change for Test_conda_linux
roger-two ad3b469
deleting useless benchmark
roger-two e08dad8
Merge remote-tracking branch 'upstream/master' into pr/1443
kandersolar 9382725
Merge remote-tracking branch 'upstream/main' into pr/1443
kandersolar 6d26829
move whatsnew entry from 0.9.2 to 0.9.4
kandersolar 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
8000
improved benchmark in solarposition.py
- Loading branch information
commit 981aa5e231e1c1b16f62fde410642161844e2945
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,16 @@ class SolarPositionSlow: | |
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.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 | ||
|
||
# GH 512 | ||
# def time_ephemeris(self, ndays): | ||
# solarposition.ephemeris(self.times, self.lat, self.lon) | ||
|
||
# GH 512 | ||
def time_ephemeris_localized(self, ndays): | ||
solarposition.ephemeris(self.times_localized, self.lat, self.lon) | ||
|
@@ -40,10 +45,11 @@ 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)) | ||
solarposition.pyephem_earthsun_distance(self.times_localized) | ||
|
||
def time_get_solarposition(self, ndays): | ||
solarposition.get_solarposition(self.times_localized, self.lat, self.lon) | ||
solarposition.get_solarposition(self.times_localized, | ||
self.lat, self.lon) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure there's any need to benchmark |
||
|
||
|
||
class SolarPositionFast: | ||
|
@@ -59,22 +65,29 @@ def setup(self, ndays): | |
def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): | ||
dayofyear = self.times_daily.dayofyear | ||
declination = solarposition.declination_spencer71(dayofyear) | ||
equation_of_time = solarposition.equation_of_time_spencer71(dayofyear) | ||
equationoftime = solarposition.equation_of_time_spencer71(dayofyear) | ||
solarposition.sun_rise_set_transit_geometric( | ||
self.times_daily, self.lat, self.lon, declination, | ||
equation_of_time) | ||
equationoftime) | ||
|
||
def time__local_times_from_hours_since_midnight_full_comparison(self, ndays): | ||
equation_of_time = solarposition.equation_of_time_spencer71(self.times_daily.dayofyear) | ||
hourangle = solarposition.hour_angle(self.times_daily, self.lon, equation_of_time) | ||
solarposition._hour_angle_to_hours(self.times_daily, hourangle, self.lon, equation_of_time) | ||
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): | ||
equation_of_time = solarposition.equation_of_time_spencer71(self.times_daily.dayofyear) | ||
declination = solarposition.declination_spencer71(self.times_daily.dayofyear) | ||
hourangle = solarposition.hour_angle(self.times_daily, self.lon, equation_of_time) | ||
zenith = solarposition.solar_zenith_analytical(self.lat, hourangle, declination) | ||
solarposition.solar_azimuth_analytical(self.lat, hourangle, declination, zenith) | ||
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) | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come these lines are commented out?