From f1b77b88aded3b7e399e6cfb244ddfff6f3cf153 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Sat, 13 Jul 2024 13:07:00 +0200 Subject: [PATCH 1/5] Remove `pvlib.atmosphere.first_solar_spectral_correction` --- docs/sphinx/source/reference/airmass_atmospheric.rst | 1 - pvlib/atmosphere.py | 6 ------ pvlib/tests/test_atmosphere.py | 6 ------ 3 files changed, 13 deletions(-) diff --git a/docs/sphinx/source/reference/airmass_atmospheric.rst b/docs/sphinx/source/reference/airmass_atmospheric.rst index fbd33a5f28..00f63bf66f 100644 --- a/docs/sphinx/source/reference/airmass_atmospheric.rst +++ b/docs/sphinx/source/reference/airmass_atmospheric.rst @@ -12,7 +12,6 @@ Airmass and atmospheric models atmosphere.pres2alt atmosphere.alt2pres atmosphere.gueymard94_pw - atmosphere.first_solar_spectral_correction atmosphere.bird_hulstrom80_aod_bb atmosphere.kasten96_lt atmosphere.angstrom_aod_at_lambda diff --git a/pvlib/atmosphere.py b/pvlib/atmosphere.py index 08e40b9fc2..ee5ddf610f 100644 --- a/pvlib/atmosphere.py +++ b/pvlib/atmosphere.py @@ -336,12 +336,6 @@ def gueymard94_pw(temp_air, relative_humidity): return pw -first_solar_spectral_correction = deprecated( - since='0.10.0', - alternative='pvlib.spectrum.spectral_factor_firstsolar' -)(pvlib.spectrum.spectral_factor_firstsolar) - - def bird_hulstrom80_aod_bb(aod380, aod500): """ Approximate broadband aerosol optical depth. diff --git a/pvlib/tests/test_atmosphere.py b/pvlib/tests/test_atmosphere.py index 46db622ee5..e9774d3dab 100644 --- a/pvlib/tests/test_atmosphere.py +++ b/pvlib/tests/test_atmosphere.py @@ -88,12 +88,6 @@ def test_gueymard94_pw(): assert_allclose(pws, expected, atol=0.01) -def test_first_solar_spectral_correction_deprecated(): - with pytest.warns(pvlibDeprecationWarning, - match='Use pvlib.spectrum.spectral_factor_firstsolar'): - atmosphere.first_solar_spectral_correction(1, 1, 'cdte') - - def test_kasten96_lt(): """Test Linke turbidity factor calculated from AOD, Pwat and AM""" amp = np.array([1, 3, 5]) From 9d685e5f743d47b44bb3df2977639bd45feb2ca8 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:39:53 +0200 Subject: [PATCH 2/5] Remove unneeded imports --- pvlib/atmosphere.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pvlib/atmosphere.py b/pvlib/atmosphere.py index ee5ddf610f..b8a914c1a4 100644 --- a/pvlib/atmosphere.py +++ b/pvlib/atmosphere.py @@ -5,9 +5,6 @@ import numpy as np import pandas as pd -import pvlib - -from pvlib._deprecation import deprecated APPARENT_ZENITH_MODELS = ('simple', 'kasten1966', 'kastenyoung1989', 'gueymard1993', 'pickering2002') From cf08a73b4427f07e41913f8753a0d810f41510f7 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 14 Mar 2025 18:45:53 +0000 Subject: [PATCH 3/5] re-do deletion --- pvlib/atmosphere.py | 6 ------ tests/test_atmosphere.py | 8 -------- 2 files changed, 14 deletions(-) diff --git a/pvlib/atmosphere.py b/pvlib/atmosphere.py index 3121a91cb7..8150abe405 100644 --- a/pvlib/atmosphere.py +++ b/pvlib/atmosphere.py @@ -413,12 +413,6 @@ def tdew_from_rh(temp_air, relative_humidity, coeff=(6.112, 17.62, 243.12)): return dewpoint -first_solar_spectral_correction = deprecated( - since='0.10.0', - alternative='pvlib.spectrum.spectral_factor_firstsolar' -)(pvlib.spectrum.spectral_factor_firstsolar) - - def bird_hulstrom80_aod_bb(aod380, aod500): """ Approximate broadband aerosol optical depth. diff --git a/tests/test_atmosphere.py b/tests/test_atmosphere.py index 2f0b5cadc2..7c3f56051c 100644 --- a/tests/test_atmosphere.py +++ b/tests/test_atmosphere.py @@ -9,8 +9,6 @@ from pvlib import atmosphere -from pvlib._deprecation import pvlibDeprecationWarning - def test_pres2alt(): out = atmosphere.pres2alt(np.array([10000, 90000, 101325])) @@ -235,12 +233,6 @@ def test_tdew_from_rh(): assert np.isclose(dewpoint_float, dewpoint.iloc[0]) -def test_first_solar_spectral_correction_deprecated(): - with pytest.warns(pvlibDeprecationWarning, - match='Use pvlib.spectrum.spectral_factor_firstsolar'): - atmosphere.first_solar_spectral_correction(1, 1, 'cdte') - - def test_kasten96_lt(): """Test Linke turbidity factor calculated from AOD, Pwat and AM""" amp = np.array([1, 3, 5]) From f823ca84a600be4cf9f7d086d3f6e36c02bd18c8 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 14 Mar 2025 18:47:46 +0000 Subject: [PATCH 4/5] remove links to reference --- docs/sphinx/source/whatsnew/v0.10.0.rst | 2 +- docs/sphinx/source/whatsnew/v0.7.0.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.10.0.rst b/docs/sphinx/source/whatsnew/v0.10.0.rst index 7f86137407..7599eb0915 100644 --- a/docs/sphinx/source/whatsnew/v0.10.0.rst +++ b/docs/sphinx/source/whatsnew/v0.10.0.rst @@ -53,7 +53,7 @@ Deprecations deprecated. Use :py:func:`pvlib.pvsystem.v_from_i` and :py:func:`pvlib.pvsystem.i_from_v` instead. (:issue:`1626`, :pull:`1743`) * Functions for calculating spectral modifiers have been moved to :py:mod:`pvlib.spectrum`: - :py:func:`pvlib.atmosphere.first_solar_spectral_correction` is deprecated and + :py:func:`!pvlib.atmosphere.first_solar_spectral_correction` is deprecated and replaced by :py:func:`~pvlib.spectrum.spectral_factor_firstsolar`, and :py:func:`pvlib.pvsystem.sapm_spectral_loss` is deprecated and replaced by :py:func:`~pvlib.spectrum.spectral_factor_sapm`. (:pull:`1628`) diff --git a/docs/sphinx/source/whatsnew/v0.7.0.rst b/docs/sphinx/source/whatsnew/v0.7.0.rst index 751b00f180..011852e513 100644 --- a/docs/sphinx/source/whatsnew/v0.7.0.rst +++ b/docs/sphinx/source/whatsnew/v0.7.0.rst @@ -104,7 +104,7 @@ API Changes with Deprecations * Changes related to spectral modifier (:issue:`782`): * Changes to functions - Added the argument `pw_min` and `pw_max`, default values 0.1 and 8 resp., - to `atmosphere.first_solar_spectral_correction`. This function now returns NaN + to :py:func:`!pvlib.atmosphere.first_solar_spectral_correction`. This function now returns NaN if pw value higher than `pw_max`. * The `times` keyword argument has been deprecated in the :py:meth:`pvlib.modelchain.ModelChain.run_model`, From 0e6630e80ece1d60347fad3a8a76cdccf82e134f Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 14 Mar 2025 18:54:21 +0000 Subject: [PATCH 5/5] Update v0.11.3.rst --- docs/sphinx/source/whatsnew/v0.11.3.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.11.3.rst b/docs/sphinx/source/whatsnew/v0.11.3.rst index 62c7c29c57..d1fbf7f308 100644 --- a/docs/sphinx/source/whatsnew/v0.11.3.rst +++ b/docs/sphinx/source/whatsnew/v0.11.3.rst @@ -12,6 +12,8 @@ Breaking Changes * Users must now provide ModelChain.spectral_model, or the 'no_loss' spectral model is assumed. pvlib.modelchain.ModelChain no longer attempts to infer the spectral model from PVSystem attributes. (:issue:`2017`, :pull:`2253`) +* Remove :py:func:`!pvlib.atmosphere.first_solar_spectral_correction`, deprecated in v0.10.0. + Use :py:func:`~pvlib.spectrum.spectral_factor_firstsolar` instead. (:issue:`2130`, :pull:`2131`) Bug fixes ~~~~~~~~~