Skip to content

Commit 0329ca6

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix/line-endings-normalization
2 parents 3f55a73 + 9a0ad55 commit 0329ca6

13 files changed

Lines changed: 145 additions & 156 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Contributing
22
============
33

4-
We welcome your contributions! Please see the [contributing](http://pvlib-python.readthedocs.io/en/latest/contributing.html) page for information about how to contribute.
4+
We welcome your contributions! Please see the [contributing](https://pvlib-python.readthedocs.io/en/stable/contributing/index.html) page for information about how to contribute.

docs/examples/system-models/oedi_9068.py renamed to docs/examples/system-models/noplot_oedi_9068.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@
77
"""
88
# %%
99
# This example model uses satellite-based solar resource data from the
10-
# NSRDB PSM3. This approach is useful for pre-construction energy modeling
10+
# NSRDB PSM4. This approach is useful for pre-construction energy modeling
1111
# and in retrospective analyses where the system’s own irradiance
1212
# measurements are not present or unreliable.
1313
#
1414
# The system has public monitoring data available at the Open Energy Data
1515
# Initiative (OEDI) under `System ID
16-
# 9068 <https://data.openei.org/s3_viewer?bucket=oedi-data-lake&prefix=pvdaq%2F2023-solar-data-prize%2F9068_OEDI%2F>`__.
16+
# 9068 <https://data.openei.org/s3_viewer?bucket=oedi-data-lake&prefix=pvdaq%2F2023-solar-data-prize%2F9068_OEDI%2F>`__. # noqa: E501
1717
# For more information about the system, see its `OEDI
1818
# page <https://openei.org/wiki/PVDAQ/Sites/SR_CO>`__.
19+
#
20+
# .. warning::
21+
# This example requires user-provided credentials to be run at step
22+
# :ref:`Fetch weather data <fetch_weather_data>`. Therefore, it is not
23+
# executed as part of documentation build process and it's more
24+
# susceptible to API changes. Please, report any issues you may find.
1925

2026
# sphinx_gallery_thumbnail_path = "_images/OEDI_9068_daily_timeseries.png"
2127
import pvlib
@@ -132,20 +138,22 @@
132138
# %%
133139
# Fetch weather data
134140
# ------------------
141+
# .. _fetch_weather_data:
135142
#
136143
# The system does have measured plane-of-array irradiance data, but the
137144
# measurements suffer from row-to-row shading and tracker stalls. In this
138-
# example, we will use weather data taken from the NSRDB PSM3 for the year
145+
# example, we will use weather data taken from the NSRDB PSM4 for the year
139146
# 2019.
140147

141148
api_key = 'DEMO_KEY'
142149
email = 'your_email@domain.com'
143150

144151
keys = ['ghi', 'dni', 'dhi', 'temp_air', 'wind_speed',
145152
'albedo', 'precipitable_water']
146-
psm3, psm3_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude,
153+
psm4, psm4_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude,
147154
api_key, email,
148-
year=2019, interval=5,
155+
year=2019,
156+
time_step=5,
149157
parameters=keys,
150158
map_variables=True,
151159
leap_day=True)
@@ -167,20 +175,20 @@
167175
# module fraction and returns the average irradiance over the total module
168176
# surface.
169177

170-
solar_position = location.get_solarposition(psm3.index)
178+
solar_position = location.get_solarposition(psm4.index)
171179
tracker_angles = mount.get_orientation(
172180
solar_position['apparent_zenith'],
173181
solar_position['azimuth']
174182
)
175-
dni_extra = pvlib.irradiance.get_extra_radiation(psm3.index)
183+
dni_extra = pvlib.irradiance.get_extra_radiation(psm4.index)
176184

177185
# note: this system is monofacial, so only calculate irradiance for the
178186
# front side:
179187
averaged_irradiance = pvlib.bifacial.infinite_sheds.get_irradiance_poa(
180188
tracker_angles['surface_tilt'], tracker_angles['surface_azimuth'],
181189
solar_position['apparent_zenith'], solar_position['azimuth'],
182190
gcr, axis_height, pitch,
183-
psm3['ghi'], psm3['dhi'], psm3['dni'], psm3['albedo'],
191+
psm4['ghi'], psm4['dhi'], psm4['dni'], psm4['albedo'],
184192
model='haydavies', dni_extra=dni_extra,
185193
)
186194

@@ -191,14 +199,14 @@
191199

192200
cell_temperature_steady_state = pvlib.temperature.faiman(
193201
poa_global=averaged_irradiance['poa_global'],
194-
temp_air=psm3['temp_air'],
195-
wind_speed=psm3['wind_speed'],
202+
temp_air=psm4['temp_air'],
203+
wind_speed=psm4['wind_speed'],
196204
**temperature_model_parameters,
197205
)
198206

199207
cell_temperature = pvlib.temperature.prilliman(
200208
cell_temperature_steady_state,
201-
psm3['wind_speed'],
209+
psm4['wind_speed'],
202210
unit_mass=module_unit_mass
203211
)
204212

@@ -215,7 +223,7 @@
215223
'poa_direct': averaged_irradiance['poa_direct'],
216224
'poa_diffuse': averaged_irradiance['poa_diffuse'],
217225
'cell_temperature': cell_temperature,
218-
'precipitable_water': psm3['precipitable_water'], # for the spectral model
226+
'precipitable_water': psm4['precipitable_water'], # for the spectral model
219227
})
220228
model.run_model_from_poa(weather_inputs)
221229

docs/sphinx/source/conf.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
# for generating GH links with linenumbers
2121
import inspect
2222

23-
# import distutils before calling pd.show_versions()
24-
# https://github.com/pypa/setuptools/issues/3044
25-
import distutils # noqa: F401
23+
# to escape special characters in sphinx-gallery OS-dependant regex
24+
import re
25+
2626
import pandas as pd
2727

2828
pd.show_versions()
@@ -384,12 +384,19 @@ def setup(app):
384384
# https://github.com/pvlib/pvlib-python/issues/837
385385
suppress_warnings = ['ref.footnote']
386386

387+
os_re_sep = re.escape(os.path.sep)
387388
# settings for sphinx-gallery
388389
sphinx_gallery_conf = {
389390
'examples_dirs': ['../../examples'], # location of gallery scripts
390391
'gallery_dirs': ['gallery'], # location of generated output
391-
# execute only files starting with plot_
392-
'filename_pattern': 'plot_',
392+
393+
# do not execute gallery examples filenames that begin with noplot_
394+
# first group + sep := match folders up to filename
395+
# negative lookahead + match anything but sep := match filename (if valid)
396+
# https://sphinx-gallery.github.io/stable/configuration.html#parsing-and-executing-examples-via-matching-patterns # noqa: E501
397+
# unix: filename_pattern = '^(.*)/(?!noplot_)([^/]*)$'
398+
# win: filename_pattern = '^(.*)\\\\(?!noplot_)([^\\\\]*)$'
399+
'filename_pattern': rf"^(.*){os_re_sep}(?!noplot_)([^{os_re_sep}]*)$",
393400

394401
# directory where function/class granular galleries are stored
395402
'backreferences_dir': 'reference/generated/gallery_backreferences',

docs/sphinx/source/whatsnew/v0.15.3.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ Bug fixes
1818

1919
Enhancements
2020
~~~~~~~~~~~~
21+
* Ensure all timezones are available in all OSs. (:issue:`2795`, :pull:`2809`)
2122

2223

2324
Documentation
2425
~~~~~~~~~~~~~
26+
* Fix broken link in GitHub Contributing tab. (:issue:`2628`, :pull:`2806`)
27+
* Fixed broken ``interval`` keyword argument in the ``oedi_9068`` gallery
28+
example; the correct parameter name is ``time_step``. (:issue:`2791`)
2529

2630

2731
Testing
@@ -38,8 +42,15 @@ Requirements
3842

3943
Maintenance
4044
~~~~~~~~~~~
45+
* Fix some gallery examples not being run. Only gallery examples whose filename begins with ``noplot_`` will be excluded. (:issue:`2790`, :pull:`2792`)
46+
* Removed unused internal function ``clearsky._is_leap_year`` (:issue:`2768`, :pull:`2813`)
47+
* Fix documentation builds on runner images lacking link-type timezones. (:issue:`2795`, :pull:`2809`)
4148

4249

4350
Contributors
4451
~~~~~~~~~~~~
45-
52+
* Eesh Saxena (:ghuser:`eeshsaxena`)
53+
* Karl Hill (:ghuser:`karlhillx`)
54+
* Mathias Aschwanden (:ghuser:`maschwanden`)
55+
* Yonry Zhu (:ghuser:`yonryzhu`)
56+
* Darshan Gowda (:ghuser:`dgowdaan-cmyk`)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.. _whatsnew_0_16_0:
2+
3+
4+
v0.16.0
5+
Breaking Changes
6+
~~~~~~~~~~~~~~~~
7+
* Change output type of :py:func:`pvlib.irradiance.perez` and
8+
:py:func:`pvlib.irradiance.perez_driesse` from ``OrderedDict`` to ``dict`` when
9+
``return_components=True`` to be consistent with other models.
10+
(:pull:`2789`)
11+
* Remove empty ``poa_horizon`` key from the ``diffuse_components`` output of
12+
:py:func:`pvlib.irradiance.haydavies`.
13+
(:pull:`2788`)
14+
15+
16+
Deprecations
17+
~~~~~~~~~~~~
18+
19+
20+
Bug fixes
21+
~~~~~~~~~
22+
23+
24+
Enhancements
25+
~~~~~~~~~~~~
26+
27+
28+
Documentation
29+
~~~~~~~~~~~~~
30+
31+
32+
Testing
33+
~~~~~~~
34+
35+
36+
Benchmarking
37+
~~~~~~~~~~~~
38+
39+
40+
Requirements
41+
~~~~~~~~~~~~
42+
43+
44+
Maintenance
45+
~~~~~~~~~~~
46+
47+
48+
Contributors
49+
~~~~~~~~~~~~
50+
* Carolina Crespo (:ghuser:`cbcrespo`)

pvlib/bifacial/infinite_sheds.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,6 @@ def _poa_sky_diffuse_pv(dhi, gcr, surface_tilt):
4545
Integrated view factors from the shaded and unshaded parts of
4646
the row slant height to the sky.
4747
48-
Parameters
49-
----------
50-
f_x : numeric
51-
Fraction of row slant height from the bottom that is shaded from
52-
direct irradiance. [unitless]
53-
surface_tilt : numeric
54-
Surface tilt angle in degrees from horizontal, e.g., surface facing up
55-
= 0, surface facing horizon = 90. [degree]
56-
gcr : float
57-
Ratio of row slant length to row spacing (pitch). [unitless]
58-
npoints : int, default 100
59-
Number of points for integration. [unitless]
60-
6148
A detailed calculation would be
6249
6350
dhi * (f_x * vf_shade_sky_integ + (1 - f_x) * vf_noshade_sky_integ)
@@ -73,9 +60,6 @@ def _poa_sky_diffuse_pv(dhi, gcr, surface_tilt):
7360
7461
Parameters
7562
----------
76-
f_x : numeric
77-
Fraction of row slant height from the bottom that is shaded from
78-
direct irradiance. [unitless]
7963
dhi : numeric
8064
Diffuse horizontal irradiance (DHI). [W/m^2]
8165
gcr : float

pvlib/clearsky.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -220,22 +220,6 @@ def lookup_linke_turbidity(time, latitude, longitude, filepath=None,
220220
return linke_turbidity
221221

222222

223-
def _is_leap_year(year):
224-
"""Determine if a year is leap year.
225-
226-
Parameters
227-
----------
228-
year : numeric
229-
230-
Returns
231-
-------
232-
isleap : array of bools
233-
"""
234-
isleap = ((np.mod(year, 4) == 0) &
235-
((np.mod(year, 100) != 0) | (np.mod(year, 400) == 0)))
236-
return isleap
237-
238-
239223
def _interpolate_turbidity(lts, time):
240224
"""
241225
Interpolated monthly Linke turbidity onto daily values.

0 commit comments

Comments
 (0)