Skip to content

Deprecate modelchain.get_orientation #2495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jul 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/sphinx/source/whatsnew/v0.13.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down
9 changes: 9 additions & 0 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions tests/test_modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Loading