From c4a9e8e7f59295d2ec526fbffd90bc5e2023654d Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:06:41 +0100 Subject: [PATCH] Add test skip for pandas<1.3.0 --- pvlib/iotools/solargis.py | 2 +- pvlib/tests/iotools/test_solargis.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pvlib/iotools/solargis.py b/pvlib/iotools/solargis.py index 12af063430..9894157da9 100644 --- a/pvlib/iotools/solargis.py +++ b/pvlib/iotools/solargis.py @@ -88,7 +88,7 @@ def get_solargis(latitude, longitude, start, end, variables, api_key, Notes ----- - Each XMl request is limited to retrieving 31 days of data. + Each XML request is limited to retrieving 31 days of data. The variable units depends on the time frequency, e.g., the unit for sub-hourly irradiance data is W/m^2, for hourly data it is Wh/m^2, and for diff --git a/pvlib/tests/iotools/test_solargis.py b/pvlib/tests/iotools/test_solargis.py index f60a1b2c89..27aaacad48 100644 --- a/pvlib/tests/iotools/test_solargis.py +++ b/pvlib/tests/iotools/test_solargis.py @@ -32,6 +32,8 @@ def hourly_dataframe(hourly_index): return pd.DataFrame(data={'ghi': ghi, 'dni': dni}, index=hourly_index) +@pytest.mark.skipif(pd.__version__ < '1.3.0', + reason='pd.read_xml is new as of 1.3.0') @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) def test_get_solargis(hourly_dataframe): @@ -43,6 +45,8 @@ def test_get_solargis(hourly_dataframe): assert_frame_equal(data, hourly_dataframe) +@pytest.mark.skipif(pd.__version__ < '1.3.0', + reason='pd.read_xml is new as of 1.3.0') @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) def test_get_solargis_utc_start_timestamp(hourly_index_start_utc): @@ -57,6 +61,8 @@ def test_get_solargis_utc_start_timestamp(hourly_index_start_utc): assert_index_equal(data.index, hourly_index_start_utc) +@pytest.mark.skipif(pd.__version__ < '1.3.0', + reason='pd.read_xml is new as of 1.3.0') @pytest.mark.remote_data @pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY) def test_get_solargis_http_error():