Skip to content
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

Remove read_srml_month_from_solardat #2061

Closed
wants to merge 1 commit into from
Closed
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: 0 additions & 1 deletion docs/sphinx/source/reference/iotools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/sphinx/source/whatsnew/v0.10.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down Expand Up @@ -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`)


Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/source/whatsnew/v0.6.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
1 change: 0 additions & 1 deletion pvlib/iotools/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
59 changes: 0 additions & 59 deletions pvlib/iotools/srml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
41 changes: 0 additions & 41 deletions pvlib/tests/iotools/test_srml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
Loading