Skip to content

Commit eba406d

Browse files
committed
Merge branch 'main' into joss-paper
2 parents 46fb840 + 4e55d50 commit eba406d

24 files changed

+431
-69
lines changed

benchmarks/benchmarks/location.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pandas as pd
66
import pvlib
7-
from pkg_resources import parse_version
7+
from packaging.version import Version
88

99

1010
def set_solar_position(obj):
@@ -37,7 +37,7 @@ def time_location_get_clearsky(self):
3737
class Location_0_6_1:
3838

3939
def setup(self):
40-
if parse_version(pvlib.__version__) < parse_version('0.6.1'):
40+
if Version(pvlib.__version__) < Version('0.6.1'):
4141
raise NotImplementedError
4242

4343
set_solar_position(self)

benchmarks/benchmarks/solarposition.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
import pvlib
88
from pvlib import solarposition
99

10-
from pkg_resources import parse_version
10+
from packaging.version import Version
1111

1212

13-
if parse_version(pvlib.__version__) >= parse_version('0.6.1'):
13+
if Version(pvlib.__version__) >= Version('0.6.1'):
1414
sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa
1515
else:
1616
sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit

benchmarks/benchmarks/solarposition_numba.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Try to keep relevant sections in sync with benchmarks/solarposition.py
88
"""
99

10-
from pkg_resources import parse_version
10+
from packaging.version import Version
1111
import pandas as pd
1212

1313
import os
@@ -18,7 +18,7 @@
1818
from pvlib import solarposition # NOQA: E402
1919

2020

21-
if parse_version(pvlib.__version__) >= parse_version('0.6.1'):
21+
if Version(pvlib.__version__) >= Version('0.6.1'):
2222
sun_rise_set_transit_spa = solarposition.sun_rise_set_transit_spa
2323
else:
2424
sun_rise_set_transit_spa = solarposition.get_sun_rise_set_transit

benchmarks/benchmarks/temperature.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pandas as pd
66
import pvlib
7-
from pkg_resources import parse_version
7+
from packaging.version import Version
88
from functools import partial
99

1010

@@ -20,7 +20,7 @@ class SAPM:
2020

2121
def setup(self):
2222
set_weather_data(self)
23-
if parse_version(pvlib.__version__) >= parse_version('0.7.0'):
23+
if Version(pvlib.__version__) >= Version('0.7.0'):
2424
kwargs = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm']
2525
kwargs = kwargs['open_rack_glass_glass']
2626
self.sapm_cell_wrapper = partial(pvlib.temperature.sapm_cell,
@@ -41,7 +41,7 @@ def time_sapm_cell(self):
4141
class Fuentes:
4242

4343
def setup(self):
44-
if parse_version(pvlib.__version__) < parse_version('0.8.0'):
44+
if Version(pvlib.__version__) < Version('0.8.0'):
4545
raise NotImplementedError
4646

4747
set_weather_data(self)

docs/examples/irradiance-decomposition/plot_diffuse_fraction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
# `NSRDB`_ user manuals.
204204
#
205205
# The Erbs and Boland models are correlations only based on the clearness index
206-
# kt, which is the ratio of GHI to the the horizontal component of the
206+
# kt, which is the ratio of GHI to the horizontal component of the
207207
# extra-terrestrial irradiance. At low sun elevation (zenith near 90 degrees),
208208
# especially near sunset, kt can explode because the denominator
209209
# (extra-terrestrial irradiance) approaches zero. In pvlib this behavior is

docs/examples/iv-modeling/plot_singlediode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@
118118
plt.xlabel('Module voltage [V]')
119119
plt.ylabel('Module current [A]')
120120
plt.title(parameters['Name'])
121-
plt.show()
122121
plt.gcf().set_tight_layout(True)
123122

124123

@@ -136,6 +135,7 @@ def draw_arrow(ax, label, x0, y0, rotation, size, direction):
136135
ax = plt.gca()
137136
draw_arrow(ax, 'Irradiance', 20, 2.5, 90, 15, 'r')
138137
draw_arrow(ax, 'Temperature', 35, 1, 0, 15, 'l')
138+
plt.show()
139139

140140
print(pd.DataFrame({
141141
'i_sc': curve_info['i_sc'],

docs/sphinx/source/reference/irradiance/transposition.rst

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Transposition models
1010
irradiance.get_sky_diffuse
1111
irradiance.isotropic
1212
irradiance.perez
13+
irradiance.perez_driesse
1314
irradiance.haydavies
1415
irradiance.klucher
1516
irradiance.reindl

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

+12-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,29 @@ v0.10.3 (Anticipated December, 2023)
77

88
Enhancements
99
~~~~~~~~~~~~
10-
10+
* Added the continuous Perez-Driesse transposition model.
11+
:py:func:`pvlib.irradiance.perez_driesse` (:issue:`1841`, :pull:`1876`)
12+
* :py:func:`pvlib.bifacial.infinite_sheds.get_irradiance` and
13+
:py:func:`pvlib.bifacial.infinite_sheds.get_irradiance_poa` now include
14+
shaded fraction in returned variables. (:pull:`1871`)
1115

1216
Bug fixes
1317
~~~~~~~~~
1418

1519

1620
Testing
1721
~~~~~~~
22+
* Replace use of deprecated ``pkg_resources``. (:issue:`1881`, :pull:`1882`)
1823

1924

2025
Documentation
2126
~~~~~~~~~~~~~
22-
27+
* Fixed a plotting issue in the IV curve gallery example (:pull:`1895`)
2328

2429
Contributors
2530
~~~~~~~~~~~~
26-
31+
* Arjan Keeman (:ghuser:`akeeman`)
32+
* Miguel Sánchez de León Peque (:ghuser:`Peque`)
33+
* Will Hobbs (:ghuser:`williamhobbs`)
34+
* Anton Driesse (:ghuser:`adriesse`)
35+
* :ghuser:`matsuobasho`

pvlib/bifacial/infinite_sheds.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
276276
[W/m^2]
277277
- ``poa_ground_diffuse`` : total ground-reflected diffuse irradiance on the
278278
plane of array. [W/m^2]
279+
- ``shaded_fraction`` : fraction of row slant height from the bottom that
280+
is shaded from direct irradiance by adjacent rows. [unitless]
279281
280282
References
281283
----------
@@ -369,7 +371,7 @@ def get_irradiance_poa(surface_tilt, surface_azimuth, solar_zenith,
369371
output = {
370372
'poa_global': poa_global, 'poa_direct': poa_direct,
371373
'poa_diffuse': poa_diffuse, 'poa_ground_diffuse': poa_gnd_pv,
372-
'poa_sky_diffuse': poa_sky_pv}
374+
'poa_sky_diffuse': poa_sky_pv, 'shaded_fraction': f_x}
373375
if isinstance(poa_global, pd.Series):
374376
output = pd.DataFrame(output)
375377
return output
@@ -502,6 +504,9 @@ def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
502504
cells from the front surface. [W/m^2]
503505
- ``poa_front_ground_diffuse`` : ground-reflected diffuse irradiance
504506
reaching the module cells from the front surface. [W/m^2]
507+
- ``shaded_fraction_front`` : fraction of row slant height from the bottom
508+
that is shaded from direct irradiance on the front surface by adjacent
509+
rows. [unitless]
505510
- ``poa_back_direct`` : direct irradiance reaching the module cells from
506511
the back surface. [W/m^2]
507512
- ``poa_back_diffuse`` : total diffuse irradiance reaching the module
@@ -510,6 +515,9 @@ def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
510515
cells from the back surface. [W/m^2]
511516
- ``poa_back_ground_diffuse`` : ground-reflected diffuse irradiance
512517
reaching the module cells from the back surface. [W/m^2]
518+
- ``shaded_fraction_back`` : fraction of row slant height from the bottom
519+
that is shaded from direct irradiance on the back surface by adjacent
520+
rows. [unitless]
513521
514522
References
515523
----------
@@ -545,13 +553,15 @@ def get_irradiance(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
545553
'poa_diffuse': 'poa_front_diffuse',
546554
'poa_sky_diffuse': 'poa_front_sky_diffuse',
547555
'poa_ground_diffuse': 'poa_front_ground_diffuse',
556+
'shaded_fraction': 'shaded_fraction_front',
548557
}
549558
colmap_back = {
550559
'poa_global': 'poa_back',
551560
'poa_direct': 'poa_back_direct',
552561
'poa_diffuse': 'poa_back_diffuse',
553562
'poa_sky_diffuse': 'poa_back_sky_diffuse',
554563
'poa_ground_diffuse': 'poa_back_ground_diffuse',
564+
'shaded_fraction': 'shaded_fraction_back',
555565
}
556566

557567
if isinstance(ghi, pd.Series):

pvlib/iam.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ def schlick(aoi):
840840

841841

842842
def schlick_diffuse(surface_tilt):
843-
"""
843+
r"""
844844
Determine the incidence angle modifiers (IAM) for diffuse sky and
845845
ground-reflected irradiance on a tilted surface using the Schlick
846846
incident angle model.

0 commit comments

Comments
 (0)