Skip to content
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
3 changes: 3 additions & 0 deletions docs/sphinx/source/whatsnew/v0.15.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Breaking Changes

Deprecations
~~~~~~~~~~~~
* Deprecate :py:attr:`pvlib.irradiance.king`.
Use other diffuse transposition models in :py:attr:`pvlib.irradiance` instead.
(:issue:`2636`, :pull:`2783`)


Bug fixes
Expand Down
6 changes: 6 additions & 0 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,12 @@ def reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra,
return sky_diffuse


@deprecated(
since="0.15.3",
removal="0.17.0",
name="pvlib.irradiance.king",
alternative="other diffuse transposition models in pvlib.irradiance",
)
def king(surface_tilt, dhi, ghi, solar_zenith):
'''
Determine diffuse irradiance from the sky on a tilted surface using
Expand Down
5 changes: 3 additions & 2 deletions tests/test_irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ def test_reindl(irrad_data, ephem_data, dni_et):


def test_king(irrad_data, ephem_data):
result = irradiance.king(40, irrad_data['dhi'], irrad_data['ghi'],
ephem_data['apparent_zenith'])
with pytest.warns(pvlibDeprecationWarning, match='king'):
result = irradiance.king(40, irrad_data['dhi'], irrad_data['ghi'],
ephem_data['apparent_zenith'])
assert_allclose(result, [0, 44.629352, 115.182626, 79.719855], atol=1e-4)


Expand Down
Loading