Skip to content

Commit

Permalink
Update SRML test url and re-enable tests (#1988)
Browse files Browse the repository at this point in the history
* Update test_srml.py

* Update v0.10.4.rst
  • Loading branch information
AdamRJensen authored Mar 12, 2024
1 parent 407687f commit ee9b24a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.10.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Bug fixes
* Fixed incorrect unit conversion of precipitable water used for the Solcast iotools functions.
* :py:class:`~pvlib.modelchain.ModelChain.infer_temperature_model` now raises a more useful error when
the temperature model cannot be inferred (:issue:`1946`)
* The default URL for retrieving irradiance data from the SRML network was updated in
:py:func:`~pvlib.iotools.get_srml` (:pull:`1957`, :issue:`1922`)

Testing
~~~~~~~
Expand Down
21 changes: 7 additions & 14 deletions pvlib/tests/iotools/test_srml.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ def test_read_srml():
srml.read_srml(srml_testfile)


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
def test_read_srml_remote():
srml.read_srml('http://solardat.uoregon.edu/download/Archive/EUPO1801.txt')
srml.read_srml(
'http://solardata.uoregon.edu/download/Archive/EUPO1801.txt'
)


def test_read_srml_columns_exist():
Expand Down Expand Up @@ -47,11 +48,10 @@ def test_read_srml_nans_exist():
assert data['dni_0_flag'].iloc[1119] == 99


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@pytest.mark.parametrize('url,year,month', [
('http://solardat.uoregon.edu/download/Archive/EUPO1801.txt',
('http://solardata.uoregon.edu/download/Archive/EUPO1801.txt',
2018, 1),
('http://solardat.uoregon.edu/download/Archive/EUPO1612.txt',
('http://solardata.uoregon.edu/download/Archive/EUPO1612.txt',
2016, 12),
])
@pytest.mark.remote_data
Expand All @@ -78,30 +78,27 @@ def test__map_columns(column, expected):
assert srml._map_columns(column) == expected


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
def test_get_srml():
url = 'http://solardat.uoregon.edu/download/Archive/EUPO1801.txt'
url = 'http://solardata.uoregon.edu/download/Archive/EUPO1801.txt'
file_data = srml.read_srml(url)
requested, _ = srml.get_srml(station='EU', start='2018-01-01',
end='2018-01-31')
assert_frame_equal(file_data, requested)


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@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://solardat.uoregon.edu/download/Archive/EUPO1801.txt'
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)


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@fail_on_pvlib_version('0.11')
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
Expand All @@ -117,7 +114,6 @@ def test_15_minute_dt_index():
assert (data.index[3::4].minute == 45).all()


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@fail_on_pvlib_version('0.11')
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
Expand All @@ -133,7 +129,6 @@ def test_hourly_dt_index():
assert (data.index.minute == 0).all()


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
def test_get_srml_hourly():
Expand All @@ -144,7 +139,6 @@ def test_get_srml_hourly():
assert_index_equal(data.index, expected_index)


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
def test_get_srml_minute():
Expand All @@ -162,7 +156,6 @@ def test_get_srml_minute():
assert meta['filenames'] == ['EUPO1801.txt']


@pytest.mark.skip(reason="SRML server is undergoing maintenance as of 12-2023")
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
def test_get_srml_nonexisting_month_warning():
Expand Down

0 comments on commit ee9b24a

Please sign in to comment.