diff --git a/docs/sphinx/source/whatsnew/v0.13.1.rst b/docs/sphinx/source/whatsnew/v0.13.1.rst index 57092ebcae..d83667b302 100644 --- a/docs/sphinx/source/whatsnew/v0.13.1.rst +++ b/docs/sphinx/source/whatsnew/v0.13.1.rst @@ -10,6 +10,7 @@ Breaking Changes Deprecations ~~~~~~~~~~~~ +* 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`) diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index 52732ebaeb..09e4434e84 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.1", + removal="", + name="pvlib.modelchain.get_orientation", + alternative=None, + addendum=None, +) def get_orientation(strategy, **kwargs): """ Determine a PV system's surface tilt and surface azimuth diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index 51b401830d..ecc2c41447 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,8 +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