From 502419a5bd51d5ec9fa9a47a6b466075e0b17ff8 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 31 Mar 2024 22:50:02 +0200 Subject: [PATCH 1/9] VCS tricks to port linear shade loss model to another branch --- .../effects_on_pv_system_output/shading.rst | 1 + docs/sphinx/source/whatsnew/v0.10.4.rst | 4 + pvlib/shading.py | 37 ++++++++ pvlib/tests/test_shading.py | 87 +++++++++++++++++++ 4 files changed, 129 insertions(+) diff --git a/docs/sphinx/source/reference/effects_on_pv_system_output/shading.rst b/docs/sphinx/source/reference/effects_on_pv_system_output/shading.rst index a0fd74a795..d5663e6d25 100644 --- a/docs/sphinx/source/reference/effects_on_pv_system_output/shading.rst +++ b/docs/sphinx/source/reference/effects_on_pv_system_output/shading.rst @@ -11,3 +11,4 @@ Shading shading.masking_angle_passias shading.sky_diffuse_passias shading.projected_solar_zenith_angle + shading.linear_shade_loss diff --git a/docs/sphinx/source/whatsnew/v0.10.4.rst b/docs/sphinx/source/whatsnew/v0.10.4.rst index a194c5e522..692a8c1a5c 100644 --- a/docs/sphinx/source/whatsnew/v0.10.4.rst +++ b/docs/sphinx/source/whatsnew/v0.10.4.rst @@ -16,6 +16,10 @@ Enhancements the SOLRAD ground station network. (:pull:`1967`) * Added metadata parsing to :py:func:`~pvlib.iotools.read_solrad` to follow the standard iotools convention of returning a tuple of (data, meta). Previously the function only returned a dataframe. (:pull:`1968`) +* Added functions `pvlib.shading.tracker_shaded_fraction` and + `pvlib.shading.linear_shade_loss` to calculate row-to-row shade and apply + linear shade loss for thin film CdTe modules like First Solar. + (:issue:`1689`, :issue:`1690`, :pull:`1962`) Bug fixes diff --git a/pvlib/shading.py b/pvlib/shading.py index 007e24e1b7..c385dd770d 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -342,3 +342,40 @@ def projected_solar_zenith_angle(solar_zenith, solar_azimuth, # Eq. (5); angle between sun's beam and surface theta_T = np.degrees(np.arctan2(sx_prime, sz_prime)) return theta_T + + +def linear_shade_loss(shaded_fraction, diffuse_fraction): + """ + Fraction of power lost to linear shade loss applicable to monolithic thin + film modules like First Solar CdTe, where the shadow is perpendicular to + cell scribe lines. + + Parameters + ---------- + shaded_fraction : numeric + The fraction of the collector width shaded by an adjacent row. A + value of 1 is completely shaded and zero is no shade. + diffuse_fraction : numeric + The ratio of diffuse plane of array (poa) irradiance to global poa. + A value of 1 is completely diffuse and zero is no diffuse. + + Returns + ------- + linear_shade_loss : numeric + The fraction of power lost due to linear shading. A value of 1 is all + power lost and zero is no loss. + + See also + -------- + pvlib.shading.tracker_shaded_fraction + + Example + ------- + >>> from pvlib import shading + >>> sf = shading.tracker_shaded_fraction(45.0, 0.8, 45.0, 0) + >>> loss = shading.linear_shade_loss(sf, 0.2) + >>> P_no_shade = 100 # [kWdc] DC output from modules + >>> P_linear_shade = P_no_shade * (1-loss) # [kWdc] output after loss + # 90.71067811865476 [kWdc] + """ + return shaded_fraction * (1 - diffuse_fraction) diff --git a/pvlib/tests/test_shading.py b/pvlib/tests/test_shading.py index 2f1e5b3410..32497d02f4 100644 --- a/pvlib/tests/test_shading.py +++ b/pvlib/tests/test_shading.py @@ -223,3 +223,90 @@ def test_projected_solar_zenith_angle_datatypes( ) psz = psz_func(sun_apparent_zenith, axis_azimuth, axis_tilt, axis_azimuth) assert isinstance(psz, cast_type) + + +@pytest.fixture +def sf1d_premises_and_expected(): + """Data comprised of solar position, rows parameters and terrain slope + with respective shade fractions (sf). Returns a 2-tuple with the premises + to be used directly in shaded_fraction1d(...) in the first element and + the expected shaded fractions in the second element. + See [1] in shaded_fraction1d() + Test data sourced from http://doi.org/10.5281/zenodo.10513987 + """ + test_data = pd.DataFrame( + columns=["x_L", "z_L", "theta_L", "x_R", "z_R", "theta_R", "z_0", "l", + "theta_s", "f_s"], + data=( + (1, 0.2, 50, 0, 0, 25, 0, 0.5, 80, 1), + (1, 0.1, 50, 0, 0, 25, 0.05, 0.5, 80, 0.937191), + (1, 0, 50, 0, 0.1, 25, 0, 0.5, 80, 0.30605), + (1, 0, 50, 0, 0.2, 25, 0, 0.5, 80, 0), + (1, 0.2, -25, 0, 0, -50, 0, 0.5, -80, 0), + (1, 0.1, -25, 0, 0, -50, 0, 0.5, -80, 0.30605), + (1, 0, -25, 0, 0.1, -50, 0.1, 0.5, -80, 0.881549), + (1, 0, -25, 0, 0.2, -50, 0, 0.5, -80, 1), + (1, 0.2, 5, 0, 0, 25, 0.05, 0.5, 80, 0.832499), + (1, 0.2, -25, 0, 0, 25, 0.05, 0.5, 80, 0.832499), + (1, 0.2, 5, 0, 0, -45, 0.05, 0.5, 80, 0.832499), + (1, 0.2, -25, 0, 0, -45, 0.05, 0.5, 80, 0.832499), + (1, 0, -25, 0, 0.2, 25, 0.05, 0.5, -80, 0.832499), + (1, 0, -25, 0, 0.2, -5, 0.05, 0.5, -80, 0.832499), + (1, 0, 45, 0, 0.2, 25, 0.05, 0.5, -80, 0.832499), + (1, 0, 45, 0, 0.2, -5, 0.05, 0.5, -80, 0.832499), + ), + ) # fmt: skip + + test_data["cross_axis_slope"] = atand( + (test_data["z_R"] - test_data["z_L"]) + / (test_data["x_L"] - test_data["x_R"]) + ) + test_data["row_pitch"] = test_data["x_L"] - test_data["x_R"] + # switch Left/Right trackers if needed to make the right one the shaded + where_switch = test_data["theta_s"] >= 0 + test_data["theta_L"], test_data["theta_R"] = ( + np.where( + where_switch, + test_data["theta_L"], + test_data["theta_R"], + ), + np.where( + where_switch, + test_data["theta_R"], + test_data["theta_L"], + ), + ) + test_data.rename( + columns={ + "theta_L": "shading_tracker_tilt", + "theta_R": "shaded_tracker_tilt", + "z_0": "surface_to_axis_offset", + "l": "collector_width", + "theta_s": "solar_zenith", # for the projected solar zenith angle + "f_s": "shaded_fraction", + }, + inplace=True, + ) + test_data.drop(columns=["x_L", "z_L", "x_R", "z_R"], inplace=True) + # for the projected solar zenith angle + # this returns the same psz angle as test_data["solar_zenith"] + test_data["solar_azimuth"], test_data["trackers_axis_azimuth"] = 180, 90 + + # return 1st: premises dataframe first and 2nd: shaded fraction series + return (test_data.drop(columns=["shaded_fraction"]), + test_data["shaded_fraction"]) + + +def test_linear_shade_loss(sf_premises_and_expected): + _, expected_sf_array = sf_premises_and_expected # Premises are not needed + loss = shading.linear_shade_loss(expected_sf_array[0], 0.2) + assert_allclose(loss, 0.09289321881345258) + # if no diffuse, shade fraction is the loss + loss_no_df = shading.linear_shade_loss(expected_sf_array[0], 0) + assert_allclose(loss_no_df, expected_sf_array[0]) + # if all diffuse, no shade loss + no_loss = shading.linear_shade_loss(expected_sf_array[0], 1.0) + assert_allclose(no_loss, 0) + vec_loss = shading.linear_shade_loss(expected_sf_array, 0.2) + expected_loss = np.array([0.09289322, 0.13333333, 0.03019964, 0., 0.]) + assert_allclose(vec_loss, expected_loss) From 00b7dd610b0ba258532723b1823017689d7fc629 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:07:52 +0200 Subject: [PATCH 2/9] Update tests and docstring --- pvlib/shading.py | 8 ++-- pvlib/tests/test_shading.py | 95 +++++-------------------------------- 2 files changed, 16 insertions(+), 87 deletions(-) diff --git a/pvlib/shading.py b/pvlib/shading.py index c385dd770d..6e3e3e8d08 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -367,15 +367,15 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): See also -------- - pvlib.shading.tracker_shaded_fraction + pvlib.shading.shaded_fraction1d Example ------- >>> from pvlib import shading - >>> sf = shading.tracker_shaded_fraction(45.0, 0.8, 45.0, 0) - >>> loss = shading.linear_shade_loss(sf, 0.2) + >>> sf = shading.shaded_fraction1d(TODO) + >>> loss = shading.linear_shade_loss(sf, diffuse_fraction=0.2) >>> P_no_shade = 100 # [kWdc] DC output from modules >>> P_linear_shade = P_no_shade * (1-loss) # [kWdc] output after loss - # 90.71067811865476 [kWdc] + 90.71067811865476 [kWdc] """ return shaded_fraction * (1 - diffuse_fraction) diff --git a/pvlib/tests/test_shading.py b/pvlib/tests/test_shading.py index 32497d02f4..94cc1d3f90 100644 --- a/pvlib/tests/test_shading.py +++ b/pvlib/tests/test_shading.py @@ -225,88 +225,17 @@ def test_projected_solar_zenith_angle_datatypes( assert isinstance(psz, cast_type) -@pytest.fixture -def sf1d_premises_and_expected(): - """Data comprised of solar position, rows parameters and terrain slope - with respective shade fractions (sf). Returns a 2-tuple with the premises - to be used directly in shaded_fraction1d(...) in the first element and - the expected shaded fractions in the second element. - See [1] in shaded_fraction1d() - Test data sourced from http://doi.org/10.5281/zenodo.10513987 - """ +def test_linear_shade_loss(): test_data = pd.DataFrame( - columns=["x_L", "z_L", "theta_L", "x_R", "z_R", "theta_R", "z_0", "l", - "theta_s", "f_s"], - data=( - (1, 0.2, 50, 0, 0, 25, 0, 0.5, 80, 1), - (1, 0.1, 50, 0, 0, 25, 0.05, 0.5, 80, 0.937191), - (1, 0, 50, 0, 0.1, 25, 0, 0.5, 80, 0.30605), - (1, 0, 50, 0, 0.2, 25, 0, 0.5, 80, 0), - (1, 0.2, -25, 0, 0, -50, 0, 0.5, -80, 0), - (1, 0.1, -25, 0, 0, -50, 0, 0.5, -80, 0.30605), - (1, 0, -25, 0, 0.1, -50, 0.1, 0.5, -80, 0.881549), - (1, 0, -25, 0, 0.2, -50, 0, 0.5, -80, 1), - (1, 0.2, 5, 0, 0, 25, 0.05, 0.5, 80, 0.832499), - (1, 0.2, -25, 0, 0, 25, 0.05, 0.5, 80, 0.832499), - (1, 0.2, 5, 0, 0, -45, 0.05, 0.5, 80, 0.832499), - (1, 0.2, -25, 0, 0, -45, 0.05, 0.5, 80, 0.832499), - (1, 0, -25, 0, 0.2, 25, 0.05, 0.5, -80, 0.832499), - (1, 0, -25, 0, 0.2, -5, 0.05, 0.5, -80, 0.832499), - (1, 0, 45, 0, 0.2, 25, 0.05, 0.5, -80, 0.832499), - (1, 0, 45, 0, 0.2, -5, 0.05, 0.5, -80, 0.832499), - ), - ) # fmt: skip - - test_data["cross_axis_slope"] = atand( - (test_data["z_R"] - test_data["z_L"]) - / (test_data["x_L"] - test_data["x_R"]) - ) - test_data["row_pitch"] = test_data["x_L"] - test_data["x_R"] - # switch Left/Right trackers if needed to make the right one the shaded - where_switch = test_data["theta_s"] >= 0 - test_data["theta_L"], test_data["theta_R"] = ( - np.where( - where_switch, - test_data["theta_L"], - test_data["theta_R"], - ), - np.where( - where_switch, - test_data["theta_R"], - test_data["theta_L"], - ), - ) - test_data.rename( - columns={ - "theta_L": "shading_tracker_tilt", - "theta_R": "shaded_tracker_tilt", - "z_0": "surface_to_axis_offset", - "l": "collector_width", - "theta_s": "solar_zenith", # for the projected solar zenith angle - "f_s": "shaded_fraction", - }, - inplace=True, + columns=["shaded_fraction", "diffuse_ratio", "expected_loss"], + data=[ + [0.11611, 0.2, 0.09289], + [0.11611, 0.0, 0.11611], # no diffuse, shade fraction is the loss + [0.11611, 1.0, 0.00000], # all diffuse, no shade loss + [0.16667, 0.2, 0.13333], + [0.03775, 0.2, 0.03019], + ] ) - test_data.drop(columns=["x_L", "z_L", "x_R", "z_R"], inplace=True) - # for the projected solar zenith angle - # this returns the same psz angle as test_data["solar_zenith"] - test_data["solar_azimuth"], test_data["trackers_axis_azimuth"] = 180, 90 - - # return 1st: premises dataframe first and 2nd: shaded fraction series - return (test_data.drop(columns=["shaded_fraction"]), - test_data["shaded_fraction"]) - - -def test_linear_shade_loss(sf_premises_and_expected): - _, expected_sf_array = sf_premises_and_expected # Premises are not needed - loss = shading.linear_shade_loss(expected_sf_array[0], 0.2) - assert_allclose(loss, 0.09289321881345258) - # if no diffuse, shade fraction is the loss - loss_no_df = shading.linear_shade_loss(expected_sf_array[0], 0) - assert_allclose(loss_no_df, expected_sf_array[0]) - # if all diffuse, no shade loss - no_loss = shading.linear_shade_loss(expected_sf_array[0], 1.0) - assert_allclose(no_loss, 0) - vec_loss = shading.linear_shade_loss(expected_sf_array, 0.2) - expected_loss = np.array([0.09289322, 0.13333333, 0.03019964, 0., 0.]) - assert_allclose(vec_loss, expected_loss) + loss = shading.linear_shade_loss(test_data["shaded_fraction"], + test_data["diffuse_ratio"]) + assert_allclose(loss, test_data["expected_loss"], atol=1e-5) From 49859ff1d145aa138d025d5d6552513e7e601f33 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:27:36 +0200 Subject: [PATCH 3/9] Update docs --- pvlib/shading.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pvlib/shading.py b/pvlib/shading.py index 6e3e3e8d08..cc7682455b 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -350,6 +350,8 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): film modules like First Solar CdTe, where the shadow is perpendicular to cell scribe lines. + .. versionadded:: 0.10.5 + Parameters ---------- shaded_fraction : numeric @@ -372,7 +374,9 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): Example ------- >>> from pvlib import shading - >>> sf = shading.shaded_fraction1d(TODO) + >>> sf = shading.shaded_fraction1d(80, 180, 90, 25, + collector_width=0.5, row_pitch=1, surface_to_axis_offset=0 + cross_axis_slope=-5.711, shading_tracker_tilt=50) >>> loss = shading.linear_shade_loss(sf, diffuse_fraction=0.2) >>> P_no_shade = 100 # [kWdc] DC output from modules >>> P_linear_shade = P_no_shade * (1-loss) # [kWdc] output after loss From 3f480e0cd453187224457ac72617436baa171b37 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:56:24 +0200 Subject: [PATCH 4/9] Update shading.py --- pvlib/shading.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pvlib/shading.py b/pvlib/shading.py index cc7682455b..3c8ea9b559 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -375,11 +375,11 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): ------- >>> from pvlib import shading >>> sf = shading.shaded_fraction1d(80, 180, 90, 25, - collector_width=0.5, row_pitch=1, surface_to_axis_offset=0 - cross_axis_slope=-5.711, shading_tracker_tilt=50) + collector_width=0.5, row_pitch=1, surface_to_axis_offset=0, + cross_axis_slope=5.711, shading_tracker_tilt=50) >>> loss = shading.linear_shade_loss(sf, diffuse_fraction=0.2) >>> P_no_shade = 100 # [kWdc] DC output from modules >>> P_linear_shade = P_no_shade * (1-loss) # [kWdc] output after loss - 90.71067811865476 [kWdc] + 75.51797783654133 """ return shaded_fraction * (1 - diffuse_fraction) From 3d30b9fe38501796d914314d79dbf4fe46c859d3 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:33:21 +0200 Subject: [PATCH 5/9] whatsnews --- docs/sphinx/source/whatsnew/v0.10.4.rst | 4 ---- docs/sphinx/source/whatsnew/v0.10.5.rst | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.10.4.rst b/docs/sphinx/source/whatsnew/v0.10.4.rst index 692a8c1a5c..a194c5e522 100644 --- a/docs/sphinx/source/whatsnew/v0.10.4.rst +++ b/docs/sphinx/source/whatsnew/v0.10.4.rst @@ -16,10 +16,6 @@ Enhancements the SOLRAD ground station network. (:pull:`1967`) * Added metadata parsing to :py:func:`~pvlib.iotools.read_solrad` to follow the standard iotools convention of returning a tuple of (data, meta). Previously the function only returned a dataframe. (:pull:`1968`) -* Added functions `pvlib.shading.tracker_shaded_fraction` and - `pvlib.shading.linear_shade_loss` to calculate row-to-row shade and apply - linear shade loss for thin film CdTe modules like First Solar. - (:issue:`1689`, :issue:`1690`, :pull:`1962`) Bug fixes diff --git a/docs/sphinx/source/whatsnew/v0.10.5.rst b/docs/sphinx/source/whatsnew/v0.10.5.rst index e7097ea5b4..ad8882fa5b 100644 --- a/docs/sphinx/source/whatsnew/v0.10.5.rst +++ b/docs/sphinx/source/whatsnew/v0.10.5.rst @@ -11,6 +11,8 @@ Deprecations Enhancements ~~~~~~~~~~~~ +* Added `pvlib.shading.linear_shade_loss` to apply linear shade loss for thin + film CdTe modules. (:issue:`1690`, :pull:`2004`) Bug fixes @@ -31,3 +33,5 @@ Requirements Contributors ~~~~~~~~~~~~ +* Mark Mikofski (:ghuser:`mikofski`) +* Echedey Luis (:ghuser:`echedey-ls`) From b6f9771093f8c53fb5411f16c425751816ed393a Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 12 Apr 2024 11:43:21 +0200 Subject: [PATCH 6/9] :bulb: Add references, improve docs [still missing ref of eq.] --- pvlib/shading.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pvlib/shading.py b/pvlib/shading.py index 3c8ea9b559..4fa89f77b7 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -345,7 +345,7 @@ def projected_solar_zenith_angle(solar_zenith, solar_azimuth, def linear_shade_loss(shaded_fraction, diffuse_fraction): - """ + r""" Fraction of power lost to linear shade loss applicable to monolithic thin film modules like First Solar CdTe, where the shadow is perpendicular to cell scribe lines. @@ -367,9 +367,20 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): The fraction of power lost due to linear shading. A value of 1 is all power lost and zero is no loss. + Notes + ----- + The reasoning behind this loss model is described in sections 4.2 and 4.3 + of [1]_, page 8 of the manual. + + The loss is calculated as: + + .. math:: + + \text{loss} = \text{shaded\_fraction}\cdot(1-\text{diffuse\_fraction}) + See also -------- - pvlib.shading.shaded_fraction1d + pvlib.shading.shaded_fraction1d : 1-dimensional shaded fraction calculation Example ------- @@ -381,5 +392,11 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): >>> P_no_shade = 100 # [kWdc] DC output from modules >>> P_linear_shade = P_no_shade * (1-loss) # [kWdc] output after loss 75.51797783654133 + + References + ---------- + .. [1] First Solar, “First Solar Series 4 Module.” [Online]. Available at: https://web.archive.org/web/20230512210902/https://www.firstsolar.com/-/media/First-Solar/Technical-Documents/User-Guides/Series-4-Module-User-Guide-North-America.ashx?la=en [accessed 2024-04-12] + .. [2] First Solar, “Diffuse Irradiance and Tracker Simulations,” May + 01-02, 2013. http://web.archive.org/web/20170127080529/https://energy.sandia.gov/wp-content/gallery/uploads/26-Littmann-Tracking-and-Diffuse-Shading.pdf0_.pdf [accessed 2024-04-12] """ return shaded_fraction * (1 - diffuse_fraction) From 255e678aa5f76f6d7c55280b7c2ace8e7fb6d775 Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 14 Apr 2024 00:17:39 +0200 Subject: [PATCH 7/9] Apply suggestions from code review (Adam) Co-authored-by: Adam R. Jensen <39184289+AdamRJensen@users.noreply.github.com> --- pvlib/shading.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pvlib/shading.py b/pvlib/shading.py index 4fa89f77b7..c1623cb0a0 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -356,10 +356,11 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): ---------- shaded_fraction : numeric The fraction of the collector width shaded by an adjacent row. A - value of 1 is completely shaded and zero is no shade. + value of 1 corresponds to completely shaded and zero is no shading. diffuse_fraction : numeric - The ratio of diffuse plane of array (poa) irradiance to global poa. - A value of 1 is completely diffuse and zero is no diffuse. + The ratio of diffuse plane of array (POA) irradiance to global POA. + A value of 1 corresponds to all incident irradiance being diffuse, + and a value of zero corresponds to all irradiance being direct. Returns ------- @@ -370,13 +371,13 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): Notes ----- The reasoning behind this loss model is described in sections 4.2 and 4.3 - of [1]_, page 8 of the manual. + of [1]_. The loss is calculated as: .. math:: - \text{loss} = \text{shaded\_fraction}\cdot(1-\text{diffuse\_fraction}) + \text{loss} = \text{shaded_fraction}\cdot(1-\text{diffuse_fraction}) See also -------- @@ -396,7 +397,6 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): References ---------- .. [1] First Solar, “First Solar Series 4 Module.” [Online]. Available at: https://web.archive.org/web/20230512210902/https://www.firstsolar.com/-/media/First-Solar/Technical-Documents/User-Guides/Series-4-Module-User-Guide-North-America.ashx?la=en [accessed 2024-04-12] - .. [2] First Solar, “Diffuse Irradiance and Tracker Simulations,” May - 01-02, 2013. http://web.archive.org/web/20170127080529/https://energy.sandia.gov/wp-content/gallery/uploads/26-Littmann-Tracking-and-Diffuse-Shading.pdf0_.pdf [accessed 2024-04-12] + .. [2] First Solar, “Diffuse Irradiance and Tracker Simulations,” May 01-02, 2013. http://web.archive.org/web/20170127080529/https://energy.sandia.gov/wp-content/gallery/uploads/26-Littmann-Tracking-and-Diffuse-Shading.pdf0_.pdf [accessed 2024-04-12] """ return shaded_fraction * (1 - diffuse_fraction) From 6eae790543ccc270e417c7bdb8beabdf456b1db8 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sun, 14 Apr 2024 00:24:29 +0200 Subject: [PATCH 8/9] More code review from Adam, just deletes extra spaces before suggestion Co-Authored-By: Adam R. Jensen <39184289+AdamRJensen@users.noreply.github.com> --- pvlib/shading.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pvlib/shading.py b/pvlib/shading.py index c1623cb0a0..564731888a 100644 --- a/pvlib/shading.py +++ b/pvlib/shading.py @@ -346,9 +346,10 @@ def projected_solar_zenith_angle(solar_zenith, solar_azimuth, def linear_shade_loss(shaded_fraction, diffuse_fraction): r""" - Fraction of power lost to linear shade loss applicable to monolithic thin - film modules like First Solar CdTe, where the shadow is perpendicular to - cell scribe lines. + Fraction of power lost to linear shade loss. + + Linear shade loss is applicable to monolithic thin film modules like + First Solar CdTe, where the shadow is perpendicular to cell scribe lines. .. versionadded:: 0.10.5 @@ -398,5 +399,5 @@ def linear_shade_loss(shaded_fraction, diffuse_fraction): ---------- .. [1] First Solar, “First Solar Series 4 Module.” [Online]. Available at: https://web.archive.org/web/20230512210902/https://www.firstsolar.com/-/media/First-Solar/Technical-Documents/User-Guides/Series-4-Module-User-Guide-North-America.ashx?la=en [accessed 2024-04-12] .. [2] First Solar, “Diffuse Irradiance and Tracker Simulations,” May 01-02, 2013. http://web.archive.org/web/20170127080529/https://energy.sandia.gov/wp-content/gallery/uploads/26-Littmann-Tracking-and-Diffuse-Shading.pdf0_.pdf [accessed 2024-04-12] - """ + """ # noqa: E501 return shaded_fraction * (1 - diffuse_fraction) From ca10c8464d5882ab757a7e29ddf7392f12d9133c Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Thu, 23 May 2024 13:01:24 +0200 Subject: [PATCH 9/9] Remove whatsme entries --- docs/sphinx/source/whatsnew/v0.10.5.rst | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.10.5.rst b/docs/sphinx/source/whatsnew/v0.10.5.rst index 07e8fee6a8..00daed3a0f 100644 --- a/docs/sphinx/source/whatsnew/v0.10.5.rst +++ b/docs/sphinx/source/whatsnew/v0.10.5.rst @@ -1,18 +1,6 @@ .. _whatsnew_01050: -v0.10.5 (Anticipated June 2024) -------------------------------- - - -Deprecations -~~~~~~~~~~~~ - - -Enhancements -~~~~~~~~~~~~ -* Added `pvlib.shading.linear_shade_loss` to apply linear shade loss for thin - film CdTe modules. (:issue:`1690`, :pull:`2004`) v0.10.5 (May 6, 2024) --------------------- @@ -46,8 +34,6 @@ Requirements Contributors ~~~~~~~~~~~~ * Cliff Hansen (:ghuser:`cwhanse`) -* Mark Mikofski (:ghuser:`mikofski`) -* Echedey Luis (:ghuser:`echedey-ls`) * :ghuser:`apct69` * Mark Mikofski (:ghuser:`mikofski`) * Echedey Luis (:ghuser:`echedey-ls`)