diff --git a/docs/sphinx/source/reference/iotools.rst b/docs/sphinx/source/reference/iotools.rst index 3d5729935d..bd0661e762 100644 --- a/docs/sphinx/source/reference/iotools.rst +++ b/docs/sphinx/source/reference/iotools.rst @@ -54,7 +54,6 @@ clear-sky irradiance globally. iotools.get_cams iotools.read_cams - iotools.parse_cams NASA POWER @@ -152,7 +151,6 @@ long-wave radiation. iotools.get_bsrn iotools.read_bsrn - iotools.parse_bsrn SOLRAD @@ -269,7 +267,6 @@ Functions for reading irradiance/weather data files. iotools.read_tmy2 iotools.read_tmy3 iotools.read_epw - iotools.parse_epw iotools.read_panond 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 diff --git a/docs/sphinx/source/whatsnew/v0.16.0.rst b/docs/sphinx/source/whatsnew/v0.16.0.rst index 1316a7a9c1..fa04ae1ab7 100644 --- a/docs/sphinx/source/whatsnew/v0.16.0.rst +++ b/docs/sphinx/source/whatsnew/v0.16.0.rst @@ -16,7 +16,20 @@ Breaking Changes * Remove empty ``poa_horizon`` key from the ``diffuse_components`` output of :py:func:`pvlib.irradiance.haydavies`. (:pull:`2788`) - +* Removed private function :py:func:`pvlib.irradiance._liujordan`. + (:issue:`2764`, :pull:`2766`) +* Removed deprecated iotools aliases :py:func:`pvlib.iotools.parse_bsrn`, + :py:func:`pvlib.iotools.parse_epw`, and + :py:func:`pvlib.iotools.parse_cams`. Use + :py:func:`pvlib.iotools.read_bsrn`, :py:func:`pvlib.iotools.read_epw`, + and :py:func:`pvlib.iotools.read_cams` instead. + (:issue:`2767`, :pull:`2766`) +* Removed deprecated modelchain function + :py:func:`pvlib.modelchain.get_orientation`. + (:issue:`2767`, :pull:`2766`) +* Removed the deprecated ``server`` keyword argument from + :py:func:`pvlib.iotools.sodapro.get_cams`. Use ``url`` instead. + (:issue:`2767`, :pull:`2766`) Deprecations ~~~~~~~~~~~~ @@ -83,3 +96,4 @@ Contributors * Andrew Chen (:ghuser:`chuenchen309`) * Sai Asish Y (:ghuser:`SAY-5`) * Kevin Anderson (:ghuser:`kandersolar`) +* Johann Loux (:ghuser:`JoLo90`) diff --git a/pvlib/iotools/__init__.py b/pvlib/iotools/__init__.py index 28ff223554..5f9c7103b7 100644 --- a/pvlib/iotools/__init__.py +++ b/pvlib/iotools/__init__.py @@ -1,5 +1,5 @@ from pvlib.iotools.tmy import read_tmy2, read_tmy3 # noqa: F401 -from pvlib.iotools.epw import read_epw, parse_epw # noqa: F401 +from pvlib.iotools.epw import read_epw # noqa: F401 from pvlib.iotools.srml import read_srml # noqa: F401 from pvlib.iotools.srml import get_srml # noqa: F401 from pvlib.iotools.surfrad import read_surfrad # noqa: F401 @@ -22,10 +22,8 @@ from pvlib.iotools.pvgis import get_pvgis_horizon # noqa: F401 from pvlib.iotools.bsrn import get_bsrn # noqa: F401 from pvlib.iotools.bsrn import read_bsrn # noqa: F401 -from pvlib.iotools.bsrn import parse_bsrn # noqa: F401 from pvlib.iotools.sodapro import get_cams # noqa: F401 from pvlib.iotools.sodapro import read_cams # noqa: F401 -from pvlib.iotools.sodapro import parse_cams # noqa: F401 from pvlib.iotools.panond import read_panond # noqa: F401 from pvlib.iotools.acis import get_acis_prism # noqa: F401 from pvlib.iotools.acis import get_acis_nrcc # noqa: F401 diff --git a/pvlib/iotools/bsrn.py b/pvlib/iotools/bsrn.py index fff3f72614..7c02866e1c 100644 --- a/pvlib/iotools/bsrn.py +++ b/pvlib/iotools/bsrn.py @@ -10,7 +10,6 @@ import os from pvlib.tools import _file_context_manager -from pvlib._deprecation import deprecated BSRN_FTP_URL = "ftp.bsrn.awi.de" @@ -462,7 +461,3 @@ def read_bsrn(filename, logical_records=('0100',)): with open_func(filename, mode) as f: content = _parse_bsrn(f, logical_records) return content - - -parse_bsrn = deprecated(since="0.13.0", name="parse_bsrn", - alternative="read_bsrn")(read_bsrn) diff --git a/pvlib/iotools/epw.py b/pvlib/iotools/epw.py index 4355e7619f..01c87c180a 100644 --- a/pvlib/iotools/epw.py +++ b/pvlib/iotools/epw.py @@ -7,7 +7,6 @@ import pandas as pd from pvlib.tools import _file_context_manager -from pvlib._deprecation import deprecated def read_epw(filename, coerce_year=None): @@ -309,7 +308,3 @@ def _parse_epw(csvdata, coerce_year=None): data.index = idx return data, meta - - -parse_epw = deprecated(since="0.13.0", name="parse_epw", - alternative="read_epw")(read_epw) diff --git a/pvlib/iotools/sodapro.py b/pvlib/iotools/sodapro.py index be11dbf260..2e88590ddd 100644 --- a/pvlib/iotools/sodapro.py +++ b/pvlib/iotools/sodapro.py @@ -9,8 +9,6 @@ import warnings from pvlib import tools -from pvlib._deprecation import deprecated, renamed_kwarg_warning - URL = 'api.soda-solardata.com' CAMS_INTEGRATED_COLUMNS = [ @@ -45,11 +43,6 @@ '0 year 1 month 0 day 0 h 0 min 0 s': '1M'} -@renamed_kwarg_warning( - since='0.13.0', - old_param_name='server', - new_param_name='url', - removal="0.14.0") def get_cams(latitude, longitude, start, end, email, identifier='mcclear', altitude=None, time_step='1h', time_ref='UT', verbose=False, integrated=False, label=None, map_variables=True, @@ -357,7 +350,3 @@ def read_cams(filename, integrated=False, label=None, map_variables=True): data = data.rename(columns=VARIABLE_MAP) return data, metadata - - -parse_cams = deprecated(since="0.13.0", name="parse_cams", - alternative="read_cams")(read_cams) diff --git a/pvlib/irradiance.py b/pvlib/irradiance.py index 677cdba60f..9d6ddbe665 100644 --- a/pvlib/irradiance.py +++ b/pvlib/irradiance.py @@ -3234,64 +3234,6 @@ def campbell_norman(zenith, transmittance, pressure=101325.0, return irrads -def _liujordan(zenith, transmittance, airmass, dni_extra=1367.0): - ''' - Determine DNI, DHI, GHI from extraterrestrial flux, transmittance, - and optical air mass number. - - Liu and Jordan, 1960, developed a simplified direct radiation model. - DHI is from an empirical equation for diffuse radiation from Liu and - Jordan, 1960. - - Parameters - ---------- - zenith: pd.Series - True (not refraction-corrected) zenith angles in decimal - degrees. If Z is a vector it must be of the same size as all - other vector inputs. [°] - - transmittance: float - Atmospheric transmittance between 0 and 1. - - airmass: numeric - Optical air mass. [unitless] - - dni_extra: float, default 1367.0 - Direct irradiance incident at the top of the atmosphere. - - Returns - ------- - irradiance: DataFrame - Modeled direct normal irradiance, direct horizontal irradiance, - and global horizontal irradiance in Wm⁻² - - References - ---------- - .. [1] Campbell, G. S., J. M. Norman (1998) An Introduction to - Environmental Biophysics. 2nd Ed. New York: Springer. - - .. [2] Liu, B. Y., R. C. Jordan, (1960). "The interrelationship and - characteristic distribution of direct, diffuse, and total solar - radiation". Solar Energy 4:1-19 - ''' - - tau = transmittance - - dni = dni_extra*tau**airmass - dhi = 0.3 * (1.0 - tau**airmass) * dni_extra * np.cos(np.radians(zenith)) - ghi = dhi + dni * np.cos(np.radians(zenith)) - - irrads = OrderedDict() - irrads['ghi'] = ghi - irrads['dni'] = dni - irrads['dhi'] = dhi - - if isinstance(ghi, pd.Series): - irrads = pd.DataFrame(irrads) - - return irrads - - def _get_perez_coefficients(perezmodel): ''' Find coefficients for the Perez model diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py index cf7a5bf7e5..32af129fd7 100644 --- a/pvlib/modelchain.py +++ b/pvlib/modelchain.py @@ -18,8 +18,6 @@ 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 @@ -61,43 +59,6 @@ ) -@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 - using a named strategy. - - Parameters - ---------- - strategy: str - The orientation strategy. - Allowed strategies include 'flat', 'south_at_latitude_tilt'. - **kwargs: - Strategy-dependent keyword arguments. See code for details. - - Returns - ------- - surface_tilt, surface_azimuth - """ - if strategy == 'south_at_latitude_tilt': - surface_azimuth = 180 - surface_tilt = kwargs['latitude'] - elif strategy == 'flat': - surface_azimuth = 180 - surface_tilt = 0 - else: - raise ValueError('invalid orientation strategy. strategy must ' - 'be one of south_at_latitude_tilt, flat,') - - return surface_tilt, surface_azimuth - - def _getmcattr(self, attr): """ Helper for __repr__ methods, needed to avoid recursion in property diff --git a/pvlib/tracking.py b/pvlib/tracking.py index 69c679ef79..e234887cd0 100644 --- a/pvlib/tracking.py +++ b/pvlib/tracking.py @@ -1,7 +1,7 @@ import numpy as np import pandas as pd -from pvlib.tools import cosd, sind, tand, acosd, asind +from pvlib.tools import cosd, sind, tand, acosd from pvlib import irradiance from pvlib import shading from pvlib._deprecation import renamed_kwarg_warning diff --git a/tests/iotools/test_bsrn.py b/tests/iotools/test_bsrn.py index 5bb9434f47..6b5f356836 100644 --- a/tests/iotools/test_bsrn.py +++ b/tests/iotools/test_bsrn.py @@ -6,7 +6,7 @@ import pytest import os import tempfile -from pvlib.iotools import read_bsrn, get_bsrn, parse_bsrn +from pvlib.iotools import read_bsrn, get_bsrn from tests.conftest import ( TESTS_DATA_DIR, RERUNS, @@ -15,8 +15,6 @@ requires_bsrn_credentials, ) -from pvlib._deprecation import pvlibDeprecationWarning - @pytest.fixture(scope="module") def bsrn_credentials(): @@ -35,12 +33,6 @@ def expected_index(): tz='UTC') -def test_parse_bsrn_deprecated(): - with pytest.warns(pvlibDeprecationWarning, match='Use read_bsrn instead'): - with open(TESTS_DATA_DIR / 'bsrn-lr0100-pay0616.dat') as fbuf: - data, metadata = parse_bsrn(fbuf) - - @pytest.mark.parametrize('testfile', [ ('bsrn-pay0616.dat.gz'), ('bsrn-lr0100-pay0616.dat'), diff --git a/tests/iotools/test_epw.py b/tests/iotools/test_epw.py index a2c7883269..9f1dd48ff4 100644 --- a/tests/iotools/test_epw.py +++ b/tests/iotools/test_epw.py @@ -3,8 +3,6 @@ from pvlib.iotools import epw from tests.conftest import TESTS_DATA_DIR, RERUNS, RERUNS_DELAY -from pvlib._deprecation import pvlibDeprecationWarning - epw_testfile = TESTS_DATA_DIR / 'NLD_Amsterdam062400_IWEC.epw' @@ -23,15 +21,6 @@ def test_read_epw_buffer(): assert meta['latitude'] == 52.3 -def test_parse_epw_deprecated(): - with pytest.warns(pvlibDeprecationWarning, match='Use read_epw instead'): - with open(epw_testfile, 'r') as f: - df, meta = epw.parse_epw(f) - assert len(df) == 8760 - assert 'ghi' in df.columns - assert meta['latitude'] == 52.3 - - @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) def test_read_epw_remote(): diff --git a/tests/iotools/test_sodapro.py b/tests/iotools/test_sodapro.py index 4276b8826e..cf40c654a2 100644 --- a/tests/iotools/test_sodapro.py +++ b/tests/iotools/test_sodapro.py @@ -193,12 +193,6 @@ def test_read_cams_integrated_unmapped_label(): assert_frame_equal(out, expected, check_less_precise=True) -def test_parse_cams_deprecated(): - with pytest.warns(pvlibDeprecationWarning, match='Use read_cams instead'): - with open(testfile_radiation_verbose, mode="r") as fbuf: - _ = sodapro.parse_cams(fbuf) - - def test_read_cams_metadata(): _, metadata = sodapro.read_cams(testfile_mcclear_monthly, integrated=False) assert metadata['Time reference'] == 'Universal time (UT)' diff --git a/tests/test_clearsky.py b/tests/test_clearsky.py index 638dfb0bc5..ed1ce85c64 100644 --- a/tests/test_clearsky.py +++ b/tests/test_clearsky.py @@ -892,5 +892,6 @@ def test_bird(): # XXX: testdata starts at 1am so noon is at index = 11 np.allclose( [Eb3, Ebh3, Gh3, Dh3], - testdata2[['Direct Beam', 'Direct Hz', 'Global Hz', 'Dif Hz']].iloc[11], + testdata2[['Direct Beam', 'Direct Hz', + 'Global Hz', 'Dif Hz']].iloc[11], rtol=1e-3) diff --git a/tests/test_modelchain.py b/tests/test_modelchain.py index 6948e0f3bb..e15e155dbb 100644 --- a/tests/test_modelchain.py +++ b/tests/test_modelchain.py @@ -8,9 +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 @@ -1821,12 +1820,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.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, weather):