Skip to content

Commit 1f26199

Browse files
committed
Merge remote-tracking branch 'upstream/main' into angles
2 parents 80efca1 + 908d3da commit 1f26199

12 files changed

Lines changed: 60 additions & 45 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Documentation
6868
=============
6969

7070
Full documentation can be found at [readthedocs](http://pvlib-python.readthedocs.io/en/stable/),
71-
including an [FAQ](http://pvlib-python.readthedocs.io/en/stable/user_guide/faq.html) page.
71+
including an [FAQ](https://pvlib-python.readthedocs.io/en/stable/user_guide/extras/faq.html) page.
7272

7373
Installation
7474
============

docs/examples/agrivoltaics/plot_agrivoltaics_ground_irradiance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
tracking_orientations = pvlib.tracking.singleaxis(
6161
apparent_zenith=solpos['apparent_zenith'],
62-
apparent_azimuth=solpos['azimuth'],
62+
solar_azimuth=solpos['azimuth'],
6363
axis_azimuth=axis_azimuth,
6464
max_angle=max_angle,
6565
backtrack=True,

docs/examples/shading/plot_martinez_shade_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090

9191
tracking_result = pvlib.tracking.singleaxis(
9292
apparent_zenith=solar_apparent_zenith,
93-
apparent_azimuth=solar_azimuth,
93+
solar_azimuth=solar_azimuth,
9494
axis_tilt=axis_tilt,
9595
axis_azimuth=axis_azimuth,
9696
max_angle=(-90 + cross_axis_tilt, 90 + cross_axis_tilt), # (min, max)

docs/examples/solar-tracking/plot_single_axis_tracking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
truetracking_angles = tracking.singleaxis(
3535
apparent_zenith=solpos['apparent_zenith'],
36-
apparent_azimuth=solpos['azimuth'],
36+
solar_azimuth=solpos['azimuth'],
3737
axis_tilt=0,
3838
axis_azimuth=180,
3939
max_angle=90,
@@ -61,7 +61,7 @@
6161
for gcr in [0.2, 0.4, 0.6]:
6262
backtracking_angles = tracking.singleaxis(
6363
apparent_zenith=solpos['apparent_zenith'],
64-
apparent_azimuth=solpos['azimuth'],
64+
solar_azimuth=solpos['azimuth'],
6565
axis_tilt=0,
6666
axis_azimuth=180,
6767
max_angle=90,

docs/examples/solar-tracking/plot_single_axis_tracking_on_sloped_terrain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
for cross_axis_tilt in [0, 5, 10]:
101101
tracker_data = tracking.singleaxis(
102102
apparent_zenith=solpos['apparent_zenith'],
103-
apparent_azimuth=solpos['azimuth'],
103+
solar_azimuth=solpos['azimuth'],
104104
axis_tilt=0, # flat because the axis is perpendicular to the slope
105105
axis_azimuth=180, # N-S axis, azimuth facing south
106106
max_angle=90,
@@ -156,7 +156,7 @@
156156

157157
tracker_data = tracking.singleaxis(
158158
apparent_zenith=solpos['apparent_zenith'],
159-
apparent_azimuth=solpos['azimuth'],
159+
solar_azimuth=solpos['azimuth'],
160160
axis_tilt=axis_tilt, # no longer flat because the terrain imparts a tilt
161161
axis_azimuth=axis_azimuth,
162162
max_angle=90,

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Breaking Changes
1010

1111
Deprecations
1212
~~~~~~~~~~~~
13-
13+
* Rename parameter name ``aparent_azimuth`` to ``solar_azimuth`` in :py:func:`~pvlib.tracking.singleaxis`.
14+
(:issue:`2479`, :pull:`2480`)
1415

1516
Bug fixes
1617
~~~~~~~~~
@@ -38,8 +39,9 @@ Requirements
3839

3940
Maintenance
4041
~~~~~~~~~~~
42+
* Fix FAQ URL in ``README.md``. (:pull:`2488`)
4143

4244

4345
Contributors
4446
~~~~~~~~~~~~
45-
47+
* Elijah Passmore (:ghuser:`eljpsm`)

pvlib/bifacial/pvfactors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
The ``bifacial.pvfactors`` module contains functions for modeling back surface
3-
plane-of-array irradiance using an external implementaton of the pvfactors
3+
plane-of-array irradiance using an external implementation of the pvfactors
44
model (either ``solarfactors`` or the original ``pvfactors``).
55
"""
66

pvlib/ivtools/sdm/_fit_desoto_pvsyst_sandia.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def _update_io(voc, iph, io, rs, rsh, nnsvth):
267267
.. [1] PVLib MATLAB https://github.com/sandialabs/MATLAB_PV_LIB
268268
.. [2] C. Hansen, Parameter Estimation for Single Diode Models of
269269
Photovoltaic Modules, Sandia National Laboratories Report SAND2015-2065
270-
.. [3] C. Hansen, Estimation of Parameteres for Single Diode Models using
270+
.. [3] C. Hansen, Estimation of Parameters for Single Diode Models using
271271
Measured IV Curves, Proc. of the 39th IEEE PVSC, June 2013.
272272
"""
273273

pvlib/modelchain.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# 'cell_temperature' overrides ModelChain.temperature_model and sets
3232
# ModelChain.cell_temperature to the data. If 'module_temperature' is provided,
3333
# overrides ModelChain.temperature_model with
34-
# pvlib.temperature.sapm_celL_from_module
34+
# pvlib.temperature.sapm_cell_from_module
3535
TEMPERATURE_KEYS = ('module_temperature', 'cell_temperature')
3636

3737
DATA_KEYS = WEATHER_KEYS + POA_KEYS + TEMPERATURE_KEYS
@@ -46,7 +46,7 @@
4646
# for Flat-Plate Photovoltaic Arrays. SAND85-0330. Albuquerque, NM:
4747
# Sandia National Laboratories. Accessed September 3, 2013:
4848
# http://prod.sandia.gov/techlib/access-control.cgi/1985/850330.pdf
49-
# pvlib python does not implement that model, so use the SAPM instead.
49+
# pvlib-python does not implement that model, so it uses the SAPM instead.
5050
PVWATTS_CONFIG = dict(
5151
dc_model='pvwatts', ac_model='pvwatts', losses_model='pvwatts',
5252
transposition_model='perez', aoi_model='physical',
@@ -84,7 +84,7 @@ def get_orientation(strategy, **kwargs):
8484
surface_tilt = 0
8585
else:
8686
raise ValueError('invalid orientation strategy. strategy must '
87-
'be one of south_at_latitude, flat,')
87+
'be one of south_at_latitude_tilt, flat,')
8888

8989
return surface_tilt, surface_azimuth
9090

@@ -162,8 +162,8 @@ class ModelChainResult:
162162
# per DC array information
163163
total_irrad: Optional[PerArray[pd.DataFrame]] = field(default=None)
164164
""" DataFrame (or tuple of DataFrame, one for each array) containing
165-
columns ``'poa_global'``, ``'poa_direct'`` ``'poa_diffuse'``,
166-
``poa_sky_diffuse'``, ``'poa_ground_diffuse'`` (W/m2); see
165+
columns ``'poa_global'``, ``'poa_direct'``, ``'poa_diffuse'``,
166+
``poa_sky_diffuse'``, and ``'poa_ground_diffuse'`` (Wm⁻²); see
167167
:py:func:`~pvlib.irradiance.get_total_irradiance` for details.
168168
"""
169169

@@ -190,12 +190,12 @@ class ModelChainResult:
190190

191191
cell_temperature: Optional[PerArray[pd.Series]] = field(default=None)
192192
"""Series (or tuple of Series, one for each array) containing cell
193-
temperature (C).
193+
temperature (°C).
194194
"""
195195

196196
effective_irradiance: Optional[PerArray[pd.Series]] = field(default=None)
197197
"""Series (or tuple of Series, one for each array) containing effective
198-
irradiance (W/m2) which is total plane-of-array irradiance adjusted for
198+
irradiance (Wm⁻²) which is total plane-of-array irradiance adjusted for
199199
reflections and spectral content.
200200
"""
201201

@@ -215,12 +215,12 @@ class ModelChainResult:
215215

216216
dc_ohmic_losses: Optional[PerArray[pd.Series]] = field(default=None)
217217
"""Series (or tuple of Series, one for each array) containing DC ohmic
218-
loss (W) calculated by ``ModelChain.dc_ohmic_model``.
218+
losses (W) calculated by ``ModelChain.dc_ohmic_model``.
219219
"""
220220

221221
# copies of input data, for user convenience
222222
weather: Optional[PerArray[pd.DataFrame]] = None
223-
"""DataFrame (or tuple of DataFrame, one for each array) contains a
223+
"""DataFrame (or tuple of DataFrame, one for each array) containing a
224224
copy of the input weather data.
225225
"""
226226

@@ -806,7 +806,7 @@ def infer_aoi_model(self):
806806
'system.arrays[i].module_parameters. Check that '
807807
'the module_parameters for all Arrays in '
808808
'system.arrays contain parameters for the '
809-
'physical, aoi, ashrae, martin_ruiz or interp '
809+
'physical, sapm, ashrae, martin_ruiz or interp '
810810
'model; explicitly set the model with the '
811811
'aoi_model kwarg; or set aoi_model="no_loss".')
812812

pvlib/singlediode.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -696,27 +696,34 @@ def _lambertw_v_from_i(current, photocurrent, saturation_current,
696696

697697
# Only compute using LambertW if there are cases with Gsh>0
698698
if np.any(idx_p):
699+
700+
# use only the relevant subset for what follows
701+
I = I[idx_p]
702+
IL = IL[idx_p]
703+
I0 = I0[idx_p]
704+
Rs = Rs[idx_p]
705+
Gsh = Gsh[idx_p]
706+
a = a[idx_p]
707+
699708
# LambertW argument, cannot be float128, may overflow to np.inf
700709
# overflow is explicitly handled below, so ignore warnings here
701710
with np.errstate(over='ignore'):
702-
argW = (I0[idx_p] / (Gsh[idx_p] * a[idx_p]) *
703-
np.exp((-I[idx_p] + IL[idx_p] + I0[idx_p]) /
704-
(Gsh[idx_p] * a[idx_p])))
711+
argW = I0 / (Gsh * a) * np.exp((-I + IL + I0) / (Gsh * a))
705712

706713
# lambertw typically returns complex value with zero imaginary part
707714
# may overflow to np.inf
708715
lambertwterm = lambertw(argW).real
709716

710717
# Record indices where lambertw input overflowed output
711-
idx_inf = np.logical_not(np.isfinite(lambertwterm))
718+
idx_inf = np.isinf(lambertwterm)
712719

713720
# Only re-compute LambertW if it overflowed
714721
if np.any(idx_inf):
715722
# Calculate using log(argW) in case argW is really big
716-
logargW = (np.log(I0[idx_p]) - np.log(Gsh[idx_p]) -
717-
np.log(a[idx_p]) +
718-
(-I[idx_p] + IL[idx_p] + I0[idx_p]) /
719-
(Gsh[idx_p] * a[idx_p]))[idx_inf]
723+
logargW = (np.log(I0[idx_inf]) - np.log(Gsh[idx_inf]) -
724+
np.log(a[idx_inf]) +
725+
(-I[idx_inf] + IL[idx_inf] + I0[idx_inf]) /
726+
(Gsh[idx_inf] * a[idx_inf]))
720727

721728
# Three iterations of Newton-Raphson method to solve
722729
# w+log(w)=logargW. The initial guess is w=logargW. Where direct
@@ -730,8 +737,7 @@ def _lambertw_v_from_i(current, photocurrent, saturation_current,
730737
# Eqn. 3 in Jain and Kapoor, 2004
731738
# V = -I*(Rs + Rsh) + IL*Rsh - a*lambertwterm + I0*Rsh
732739
# Recast in terms of Gsh=1/Rsh for better numerical stability.
733-
V[idx_p] = (IL[idx_p] + I0[idx_p] - I[idx_p]) / Gsh[idx_p] - \
734-
I[idx_p] * Rs[idx_p] - a[idx_p] * lambertwterm
740+
V[idx_p] = (IL + I0 - I) / Gsh - I * Rs - a * lambertwterm
735741

736742
if output_is_scalar:
737743
return V.item()

0 commit comments

Comments
 (0)