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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
9 changes: 0 additions & 9 deletions docs/sphinx/source/reference/modelchain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines -118 to -126
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly following deprecations as a concept, this shouldn't be removed till the removal - a just in case clarification. Anyway, we all are sure this function hasn't found it's way into many codebases so I agree with removing it here.

3 changes: 3 additions & 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,8 @@ Breaking Changes

Deprecations
~~~~~~~~~~~~
* Deprecate :py:func:`~pvlib.modelchain.get_orientation`. Removal scheduled for
0.14.0. (:pull:`2691`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
0.14.0. (:pull:`2691`)
``v0.14.0``. (:pull:`2691`)



Bug fixes
Expand Down Expand Up @@ -44,3 +46,4 @@ Maintenance
Contributors
~~~~~~~~~~~~
* Elijah Passmore (:ghuser:`eljpsm`)
* Rajiv Daxini (:ghuser:`RDaxini`)
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",
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
Expand Down
5 changes: 0 additions & 5 deletions tests/test_modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1785,11 +1785,6 @@ 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):
Expand Down
Loading