From 4653d9ddbd0c01f180c8b5d5f85766abfc68b6d6 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Wed, 2 Jul 2025 15:56:46 -0600 Subject: [PATCH 01/15] enhance tests to check error message --- tests/test_modelchain.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index 51b401830d..31f24d31ff 100644 --- a/tests/test_modelchain.py +++ b/tests/test_modelchain.py @@ -1785,9 +1785,11 @@ def test_invalid_models(model, sapm_dc_snl_ac_system, location): ModelChain(sapm_dc_snl_ac_system, location, **kwargs) -def test_bad_get_orientation(): - with pytest.raises(ValueError): - modelchain.get_orientation('bad value') +def test_get_orientation_invalid_strategy(): + with pytest.raises(ValueError, + match='invalid orientation strategy. strategy must ' + 'be one of south_at_latitude_tilt, flat,'): + modelchain.get_orientation('invalid_strategy') # tests for PVSystem with multiple Arrays From 442ee6a08ef7bf78de70d6cee37a2826687938b2 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Wed, 2 Jul 2025 16:08:44 -0600 Subject: [PATCH 02/15] linting, whatsnew --- docs/sphinx/source/whatsnew/v0.13.1.rst | 4 +++- tests/test_modelchain.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.13.1.rst b/docs/sphinx/source/whatsnew/v0.13.1.rst index cf591f7d0b..3310abb05a 100644 --- a/docs/sphinx/source/whatsnew/v0.13.1.rst +++ b/docs/sphinx/source/whatsnew/v0.13.1.rst @@ -26,7 +26,9 @@ Documentation Testing ~~~~~~~ - +* Update test for :py:func:`~pvlib.modelchain.get_orientation` to check + whether the correct error message is raised when an invalid strategy is + provided. (:issue:`2492`, :pull:`2691`) Benchmarking ~~~~~~~~~~~~ diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index 31f24d31ff..44f109cf28 100644 --- a/tests/test_modelchain.py +++ b/tests/test_modelchain.py @@ -1786,7 +1786,7 @@ def test_invalid_models(model, sapm_dc_snl_ac_system, location): def test_get_orientation_invalid_strategy(): - with pytest.raises(ValueError, + with pytest.raises(ValueError, match='invalid orientation strategy. strategy must ' 'be one of south_at_latitude_tilt, flat,'): modelchain.get_orientation('invalid_strategy') From 7b7f66717c011f1905704c31eab81ce7b137f827 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Thu, 3 Jul 2025 09:49:54 -0600 Subject: [PATCH 03/15] deprecate get_orientation --- pvlib/modelchain.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 52732ebaeb..f448845a0d 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -18,6 +18,8 @@ from pvlib.pvsystem import _DC_MODEL_PARAMS from pvlib.tools import _build_kwargs +from pvlib._deprecation import deprecated + # keys that are used to detect input data and assign data to appropriate # ModelChain attribute # for ModelChain.weather @@ -59,6 +61,13 @@ ) +@deprecated( + since="0.13", + removal="0.14", + name="pvlib.modelchain.get_orientation", + alternative=None, + addendum=None, +) def get_orientation(strategy, **kwargs): """ Determine a PV system's surface tilt and surface azimuth From 2a7ac3525cd25bc1c3dc1813250ab2ea5f03f809 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Thu, 3 Jul 2025 09:50:20 -0600 Subject: [PATCH 04/15] remove test --- tests/test_modelchain.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index 44f109cf28..f0db831fa0 100644 --- a/tests/test_modelchain.py +++ b/tests/test_modelchain.py @@ -1785,13 +1785,6 @@ def test_invalid_models(model, sapm_dc_snl_ac_system, location): ModelChain(sapm_dc_snl_ac_system, location, **kwargs) -def test_get_orientation_invalid_strategy(): - with pytest.raises(ValueError, - match='invalid orientation strategy. strategy must ' - 'be one of south_at_latitude_tilt, flat,'): - modelchain.get_orientation('invalid_strategy') - - # tests for PVSystem with multiple Arrays def test_with_sapm_pvsystem_arrays(sapm_dc_snl_ac_system_Array, location, weather): From 8e256376f2aa7170df4eaa934265227f16f10e9d Mon Sep 17 00:00:00 2001 From: RDaxini Date: Thu, 3 Jul 2025 09:52:10 -0600 Subject: [PATCH 05/15] Update modelchain.rst --- docs/sphinx/source/reference/modelchain.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/docs/sphinx/source/reference/modelchain.rst b/docs/sphinx/source/reference/modelchain.rst index 89de825f0d..56c0cfccd8 100644 --- a/docs/sphinx/source/reference/modelchain.rst +++ b/docs/sphinx/source/reference/modelchain.rst @@ -115,12 +115,3 @@ on the information in the associated :py:class:`~pvsystem.PVSystem` object. modelchain.ModelChain.infer_temperature_model modelchain.ModelChain.infer_losses_model -Functions ---------- - -Functions for power modeling. - -.. autosummary:: - :toctree: generated/ - - modelchain.get_orientation From bb3d7dfafb46b24ca869653eff76686b98aa2d25 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Thu, 3 Jul 2025 09:53:56 -0600 Subject: [PATCH 06/15] Update v0.13.1.rst --- docs/sphinx/source/whatsnew/v0.13.1.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.13.1.rst b/docs/sphinx/source/whatsnew/v0.13.1.rst index 3310abb05a..d54d1ef422 100644 --- a/docs/sphinx/source/whatsnew/v0.13.1.rst +++ b/docs/sphinx/source/whatsnew/v0.13.1.rst @@ -10,6 +10,8 @@ Breaking Changes Deprecations ~~~~~~~~~~~~ +* Deprecate :py:func:`~pvlib.modelchain.get_orientation`. Removal scheduled for + 0.14.0. (:pull:`2691`) Bug fixes @@ -26,9 +28,7 @@ Documentation Testing ~~~~~~~ -* Update test for :py:func:`~pvlib.modelchain.get_orientation` to check - whether the correct error message is raised when an invalid strategy is - provided. (:issue:`2492`, :pull:`2691`) + Benchmarking ~~~~~~~~~~~~ @@ -46,3 +46,4 @@ Maintenance Contributors ~~~~~~~~~~~~ * Elijah Passmore (:ghuser:`eljpsm`) +* Rajiv Daxini (:ghuser:`RDaxini`) \ No newline at end of file From e2c7fc3233acaf3ad2ffca7ad60987932a87133d Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 7 Jul 2025 08:43:32 -0600 Subject: [PATCH 07/15] Update v0.13.1.rst --- docs/sphinx/source/whatsnew/v0.13.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.13.1.rst b/docs/sphinx/source/whatsnew/v0.13.1.rst index d54d1ef422..981f8fd776 100644 --- a/docs/sphinx/source/whatsnew/v0.13.1.rst +++ b/docs/sphinx/source/whatsnew/v0.13.1.rst @@ -11,7 +11,7 @@ Breaking Changes Deprecations ~~~~~~~~~~~~ * Deprecate :py:func:`~pvlib.modelchain.get_orientation`. Removal scheduled for - 0.14.0. (:pull:`2691`) + ``v0.14.0``. (:pull:`2691`) Bug fixes From 002d78260b7de3b955fc1fa1dc6cfade81238c3d Mon Sep 17 00:00:00 2001 From: RDaxini Date: Wed, 16 Jul 2025 10:25:55 -0600 Subject: [PATCH 08/15] reinstate test --- tests/test_modelchain.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index f0db831fa0..51b401830d 100644 --- a/tests/test_modelchain.py +++ b/tests/test_modelchain.py @@ -1785,6 +1785,11 @@ def test_invalid_models(model, sapm_dc_snl_ac_system, location): ModelChain(sapm_dc_snl_ac_system, location, **kwargs) +def test_bad_get_orientation(): + with pytest.raises(ValueError): + modelchain.get_orientation('bad value') + + # tests for PVSystem with multiple Arrays def test_with_sapm_pvsystem_arrays(sapm_dc_snl_ac_system_Array, location, weather): From 78b71e71ab92c095b8d92e0c9d4f0b4c2272ab94 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 18 Jul 2025 10:59:10 -0600 Subject: [PATCH 09/15] update removal schedule --- pvlib/modelchain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index f448845a0d..e0bd456e62 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -62,8 +62,8 @@ @deprecated( - since="0.13", - removal="0.14", + since="0.13.1", + removal="the next version", name="pvlib.modelchain.get_orientation", alternative=None, addendum=None, From 1490b305bc01a5e3d0df124859372e39a5fc70c7 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Fri, 18 Jul 2025 11:03:04 -0600 Subject: [PATCH 10/15] reinstate function in docs --- docs/sphinx/source/reference/modelchain.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/sphinx/source/reference/modelchain.rst b/docs/sphinx/source/reference/modelchain.rst index 56c0cfccd8..89de825f0d 100644 --- a/docs/sphinx/source/reference/modelchain.rst +++ b/docs/sphinx/source/reference/modelchain.rst @@ -115,3 +115,12 @@ on the information in the associated :py:class:`~pvsystem.PVSystem` object. modelchain.ModelChain.infer_temperature_model modelchain.ModelChain.infer_losses_model +Functions +--------- + +Functions for power modeling. + +.. autosummary:: + :toctree: generated/ + + modelchain.get_orientation From 77cc6da8d3b7389206751ad6f5847629399418b7 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Mon, 21 Jul 2025 09:01:24 -0600 Subject: [PATCH 11/15] revert to default deprecation message --- pvlib/modelchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index e0bd456e62..09e4434e84 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -63,7 +63,7 @@ @deprecated( since="0.13.1", - removal="the next version", + removal="", name="pvlib.modelchain.get_orientation", alternative=None, addendum=None, From 5a649311aa3e0e334c93857e4064459bb277891b Mon Sep 17 00:00:00 2001 From: RDaxini <143435106+RDaxini@users.noreply.github.com> Date: Wed, 30 Jul 2025 12:38:14 -0600 Subject: [PATCH 12/15] remove removal date from whatsnew --- docs/sphinx/source/whatsnew/v0.13.1.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/sphinx/source/whatsnew/v0.13.1.rst b/docs/sphinx/source/whatsnew/v0.13.1.rst index 779c03a965..d8eb147ed8 100644 --- a/docs/sphinx/source/whatsnew/v0.13.1.rst +++ b/docs/sphinx/source/whatsnew/v0.13.1.rst @@ -10,8 +10,7 @@ Breaking Changes Deprecations ~~~~~~~~~~~~ -* Deprecate :py:func:`~pvlib.modelchain.get_orientation`. Removal scheduled for - ``v0.14.0``. (:pull:`2691`) +* Deprecate :py:func:`~pvlib.modelchain.get_orientation`. (:pull:`2691`) * Rename parameter name ``aparent_azimuth`` to ``solar_azimuth`` in :py:func:`~pvlib.tracking.singleaxis`. (:issue:`2479`, :pull:`2480`) From 627092a8b12ffd63f6960d5f93d71fb64c464157 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Thu, 31 Jul 2025 09:43:32 -0600 Subject: [PATCH 13/15] test deprecationwarning --- tests/test_modelchain.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index 51b401830d..0e6bef5024 100644 --- a/tests/test_modelchain.py +++ b/tests/test_modelchain.py @@ -8,6 +8,8 @@ from pvlib.pvsystem import PVSystem from pvlib.location import Location +from pvlib._deprecation import pvlibDeprecationWarning + from .conftest import assert_series_equal, assert_frame_equal import pytest @@ -1786,9 +1788,9 @@ def test_invalid_models(model, sapm_dc_snl_ac_system, location): def test_bad_get_orientation(): - with pytest.raises(ValueError): - modelchain.get_orientation('bad value') - + with pytest.warns(pvlibDeprecationWarning, match='will be removed soon'): + with pytest.raises(ValueError): + modelchain.get_orientation('bad value') # tests for PVSystem with multiple Arrays def test_with_sapm_pvsystem_arrays(sapm_dc_snl_ac_system_Array, location, From 10081de0c231850821998451694aa94e5c53c8c4 Mon Sep 17 00:00:00 2001 From: RDaxini Date: Thu, 31 Jul 2025 09:44:21 -0600 Subject: [PATCH 14/15] linter blank line --- tests/test_modelchain.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index 0e6bef5024..ecc2c41447 100644 --- a/tests/test_modelchain.py +++ b/tests/test_modelchain.py @@ -1792,6 +1792,7 @@ def test_bad_get_orientation(): with pytest.raises(ValueError): modelchain.get_orientation('bad value') + # tests for PVSystem with multiple Arrays def test_with_sapm_pvsystem_arrays(sapm_dc_snl_ac_system_Array, location, weather): From c55115e1f3a8729ebe3f6569c9c0449bbf8088d3 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Thu, 31 Jul 2025 14:22:04 -0400 Subject: [PATCH 15/15] Update docs/sphinx/source/whatsnew/v0.13.1.rst --- docs/sphinx/source/whatsnew/v0.13.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.13.1.rst b/docs/sphinx/source/whatsnew/v0.13.1.rst index 5ab489a436..d83667b302 100644 --- a/docs/sphinx/source/whatsnew/v0.13.1.rst +++ b/docs/sphinx/source/whatsnew/v0.13.1.rst @@ -10,7 +10,7 @@ Breaking Changes Deprecations ~~~~~~~~~~~~ -* Deprecate :py:func:`~pvlib.modelchain.get_orientation`. (:pull:`2691`) +* Deprecate :py:func:`~pvlib.modelchain.get_orientation`. (:pull:`2495`) * Rename parameter name ``aparent_azimuth`` to ``solar_azimuth`` in :py:func:`~pvlib.tracking.singleaxis`. (:issue:`2479`, :pull:`2480`)