diff --git a/docs/sphinx/source/reference/iotools.rst b/docs/sphinx/source/reference/iotools.rst index 5f405d7536..cc9cf5d7f3 100644 --- a/docs/sphinx/source/reference/iotools.rst +++ b/docs/sphinx/source/reference/iotools.rst @@ -19,7 +19,6 @@ of sources and file formats relevant to solar energy modeling. iotools.read_epw iotools.parse_epw iotools.read_srml - iotools.read_srml_month_from_solardat iotools.get_srml iotools.read_surfrad iotools.read_midc diff --git a/docs/sphinx/source/whatsnew/v0.10.0.rst b/docs/sphinx/source/whatsnew/v0.10.0.rst index e7816020bd..7f86137407 100644 --- a/docs/sphinx/source/whatsnew/v0.10.0.rst +++ b/docs/sphinx/source/whatsnew/v0.10.0.rst @@ -28,7 +28,7 @@ Breaking changes (:issue:`1718`, :pull:`1719`) * Map wind direction to ``'wind_direction'`` instead of ``'wind_dir'`` in :py:func:`pvlib.iotools.read_srml` and - :py:func:`pvlib.iotools.read_srml_month_from_solardat` (:pull:`1773`) + ``pvlib.iotools.read_srml_month_from_solardat`` (:pull:`1773`) * :func:`~pvlib.iotools.get_pvgis_tmy` and :func:`~pvlib.iotools.read_pvgis_tmy` now rename columns to standard pvlib names by default (``map_variables=True``) (:pull:`1772`) @@ -66,7 +66,7 @@ Deprecations TMY3 column names to nonstandard alternatives, is now deprecated. We encourage using ``map_variables`` (which produces standard pvlib names) instead. (:issue:`1517`, :pull:`1623`) -* :py:func:`pvlib.iotools.read_srml_month_from_solardat` is deprecated and replaced by +* ``pvlib.iotools.read_srml_month_from_solardat`` is deprecated and replaced by :py:func:`pvlib.iotools.get_srml`. (:pull:`1779`) @@ -79,9 +79,9 @@ Enhancements :py:func:`pvlib.pvsystem.calcparams_pvsyst` are all numeric types and have the same Python type as the ``effective_irradiance`` and ``temp_cell`` parameters. (:issue:`1626`, :pull:`1700`) * Added ``map_variables`` parameter to :py:func:`pvlib.iotools.read_tmy3` (:issue:`1517`, :pull:`1623`), - :py:func:`pvlib.iotools.read_srml`, and :py:func:`pvlib.iotools.read_srml_month_from_solardat` (:pull:`1773`). + :py:func:`pvlib.iotools.read_srml`, and ``pvlib.iotools.read_srml_month_from_solardat`` (:pull:`1773`). * Added :func:`pvlib.iotools.get_srml` that is similar to - :func:`pvlib.iotools.read_srml_month_from_solardat` but is able to fetch multiple months + ``pvlib.iotools.read_srml_month_from_solardat`` but is able to fetch multiple months of data using the ``start`` and ``end`` parameters. (:pull:`1779`) * Allow passing keyword arguments to :py:func:`scipy:scipy.optimize.brentq` and diff --git a/docs/sphinx/source/whatsnew/v0.6.1.rst b/docs/sphinx/source/whatsnew/v0.6.1.rst index 27d8d9ead6..9c20106c46 100644 --- a/docs/sphinx/source/whatsnew/v0.6.1.rst +++ b/docs/sphinx/source/whatsnew/v0.6.1.rst @@ -46,7 +46,7 @@ Enhancements :func:`~pvlib.solarposition.sun_rise_set_transit_geometric` (:issue:`114`) * Add `Location` class method :py:func:`~pvlib.location.Location.get_sun_rise_set_transit` * Created :py:func:`pvlib.iotools.read_srml` and - :py:func:`pvlib.iotools.read_srml_month_from_solardat` to read University of + ``pvlib.iotools.read_srml_month_from_solardat`` to read University of Oregon Solar Radiation Monitoring Laboratory data. (:issue:`589`) * Created :py:func:`pvlib.iotools.read_surfrad` to read NOAA SURFRAD data. (:issue:`590`) * Created :py:func:`pvlib.iotools.read_midc` and :py:func:`pvlib.iotools.read_midc_raw_data_from_nrel` diff --git a/pvlib/iotools/__init__.py b/pvlib/iotools/__init__.py index 96259ecc24..ad12ed89c1 100644 --- a/pvlib/iotools/__init__.py +++ b/pvlib/iotools/__init__.py @@ -1,7 +1,6 @@ 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.srml import read_srml # noqa: F401 -from pvlib.iotools.srml import read_srml_month_from_solardat # noqa: F401 from pvlib.iotools.srml import get_srml # noqa: F401 from pvlib.iotools.surfrad import read_surfrad # noqa: F401 from pvlib.iotools.midc import read_midc # noqa: F401 diff --git a/pvlib/iotools/srml.py b/pvlib/iotools/srml.py index 204107cd29..5ab21404d8 100644 --- a/pvlib/iotools/srml.py +++ b/pvlib/iotools/srml.py @@ -172,65 +172,6 @@ def _format_index(df): return df -@deprecated('0.10.0', alternative='pvlib.iotools.get_srml', removal='0.11.0') -def read_srml_month_from_solardat(station, year, month, filetype='PO', - map_variables=True): - """ - Request a month of SRML data and read it into a Dataframe. - - The SRML is described in [1]_. - - Parameters - ---------- - station: str - The name of the SRML station to request. - year: int - Year to request data for - month: int - Month to request data for. - filetype: string - SRML file type to gather. See notes for explanation. - map_variables: bool, default: True - When true, renames columns of the DataFrame to pvlib variable names - where applicable. See variable :const:`VARIABLE_MAP`. - - Returns - ------- - data: pd.DataFrame - One month of data from SRML. - - Notes - ----- - File types designate the time interval of a file and if it contains - raw or processed data. For instance, `RO` designates raw, one minute - data and `PO` designates processed one minute data. The availability - of file types varies between sites. Below is a table of file types - and their time intervals. See [1] for site information. - - ============= ============ ================== - time interval raw filetype processed filetype - ============= ============ ================== - 1 minute RO PO - 5 minute RF PF - 15 minute RQ PQ - hourly RH PH - ============= ============ ================== - - References - ---------- - .. [1] University of Oregon Solar Radiation Measurement Laboratory - http://solardata.uoregon.edu/ - """ - file_name = "{station}{filetype}{year:02d}{month:02d}.txt".format( - station=station, - filetype=filetype, - year=year % 100, - month=month) - url = "http://solardata.uoregon.edu/download/Archive/" - data = read_srml(url + file_name, map_variables=map_variables) - return data - - def get_srml(station, start, end, filetype='PO', map_variables=True, url="http://solardata.uoregon.edu/download/Archive/"): """Request data from UoO SRML and read it into a Dataframe. diff --git a/pvlib/tests/iotools/test_srml.py b/pvlib/tests/iotools/test_srml.py index fb0839e15c..d1f658228e 100644 --- a/pvlib/tests/iotools/test_srml.py +++ b/pvlib/tests/iotools/test_srml.py @@ -88,47 +88,6 @@ def test_get_srml(): assert_frame_equal(file_data, requested) -@fail_on_pvlib_version('0.11') -@pytest.mark.remote_data -@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_read_srml_month_from_solardat(): - url = 'http://solardata.uoregon.edu/download/Archive/EUPO1801.txt' - file_data = srml.read_srml(url) - with pytest.warns(pvlibDeprecationWarning, match='get_srml instead'): - requested = srml.read_srml_month_from_solardat('EU', 2018, 1) - assert file_data.equals(requested) - - -@fail_on_pvlib_version('0.11') -@pytest.mark.remote_data -@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_15_minute_dt_index(): - with pytest.warns(pvlibDeprecationWarning, match='get_srml instead'): - data = srml.read_srml_month_from_solardat('TW', 2019, 4, 'RQ') - start = pd.Timestamp('20190401 00:00') - start = start.tz_localize('Etc/GMT+8') - end = pd.Timestamp('20190430 23:45') - end = end.tz_localize('Etc/GMT+8') - assert data.index[0] == start - assert data.index[-1] == end - assert (data.index[3::4].minute == 45).all() - - -@fail_on_pvlib_version('0.11') -@pytest.mark.remote_data -@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) -def test_hourly_dt_index(): - with pytest.warns(pvlibDeprecationWarning, match='get_srml instead'): - data = srml.read_srml_month_from_solardat('CD', 1986, 4, 'PH') - start = pd.Timestamp('19860401 00:00') - start = start.tz_localize('Etc/GMT+8') - end = pd.Timestamp('19860430 23:00') - end = end.tz_localize('Etc/GMT+8') - assert data.index[0] == start - assert data.index[-1] == end - assert (data.index.minute == 0).all() - - @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) def test_get_srml_hourly():