From bdae60ec9745c1330f4d64f46a078444b277407e Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Tue, 24 Jan 2023 09:47:39 -0500 Subject: [PATCH 1/2] appease a few test warnings --- .github/workflows/pytest-remote-data.yml | 2 +- .github/workflows/pytest.yml | 2 +- pvlib/tests/test_atmosphere.py | 1 - pvlib/tests/test_clearsky.py | 1 - pvlib/tests/test_solarposition.py | 4 ++-- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pytest-remote-data.yml b/.github/workflows/pytest-remote-data.yml index 06adfb1807..b84134858c 100644 --- a/.github/workflows/pytest-remote-data.yml +++ b/.github/workflows/pytest-remote-data.yml @@ -104,7 +104,7 @@ jobs: - name: Upload coverage to Codecov if: matrix.python-version == 3.7 && matrix.suffix == '' - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: fail_ci_if_error: true verbose: true diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 31d4c117c5..170b3323f6 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -81,7 +81,7 @@ jobs: - name: Upload coverage to Codecov if: matrix.python-version == 3.7 && matrix.suffix == '' && matrix.os == 'ubuntu-latest' && matrix.environment-type == 'conda' - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: fail_ci_if_error: true verbose: true diff --git a/pvlib/tests/test_atmosphere.py b/pvlib/tests/test_atmosphere.py index 69bb3215dc..5cda3b811d 100644 --- a/pvlib/tests/test_atmosphere.py +++ b/pvlib/tests/test_atmosphere.py @@ -169,7 +169,6 @@ def test_kasten96_lt(): ) lt = atmosphere.kasten96_lt(*np.meshgrid(amp, pwat, aod_bb)) assert np.allclose(lt, lt_expected, 1e-3) - return lt def test_angstrom_aod(): diff --git a/pvlib/tests/test_clearsky.py b/pvlib/tests/test_clearsky.py index 6e620f3c79..37b95dcdf9 100644 --- a/pvlib/tests/test_clearsky.py +++ b/pvlib/tests/test_clearsky.py @@ -808,4 +808,3 @@ def test_bird(): [Eb3, Ebh3, Gh3, Dh3], testdata2[['Direct Beam', 'Direct Hz', 'Global Hz', 'Dif Hz']].iloc[11], rtol=1e-3) - return pd.DataFrame({'Eb': Eb, 'Ebh': Ebh, 'Gh': Gh, 'Dh': Dh}, index=times) diff --git a/pvlib/tests/test_solarposition.py b/pvlib/tests/test_solarposition.py index 7578506561..73530c592f 100644 --- a/pvlib/tests/test_solarposition.py +++ b/pvlib/tests/test_solarposition.py @@ -163,7 +163,7 @@ def test_sun_rise_set_transit_spa(expected_rise_set_spa, golden): result_rounded = pd.DataFrame(index=result.index) # need to iterate because to_datetime does not accept 2D data # the rounding fails on pandas < 0.17 - for col, data in result.iteritems(): + for col, data in result.items(): result_rounded[col] = data.dt.round('1s') assert_frame_equal(frame, result_rounded) @@ -176,7 +176,7 @@ def test_sun_rise_set_transit_spa(expected_rise_set_spa, golden): # round to nearest minute result_rounded = pd.DataFrame(index=result.index) # need to iterate because to_datetime does not accept 2D data - for col, data in result.iteritems(): + for col, data in result.items(): result_rounded[col] = data.dt.round('s').tz_convert('MST') assert_frame_equal(expected_rise_set_spa, result_rounded) From aba232317fd0b1f5cee5acc43e67f8bab35717b1 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Tue, 24 Jan 2023 12:22:31 -0500 Subject: [PATCH 2/2] missed a bunch of these first time around --- pvlib/tests/test_solarposition.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pvlib/tests/test_solarposition.py b/pvlib/tests/test_solarposition.py index 73530c592f..36af6afff0 100644 --- a/pvlib/tests/test_solarposition.py +++ b/pvlib/tests/test_solarposition.py @@ -191,7 +191,7 @@ def test_sun_rise_set_transit_ephem(expected_rise_set_ephem, golden): temperature=11, horizon='-0:34') # round to nearest minute result_rounded = pd.DataFrame(index=result.index) - for col, data in result.iteritems(): + for col, data in result.items(): result_rounded[col] = data.dt.round('min').tz_convert('MST') assert_frame_equal(expected_rise_set_ephem, result_rounded) @@ -227,7 +227,7 @@ def test_sun_rise_set_transit_ephem(expected_rise_set_ephem, golden): horizon='-0:34') # round to nearest minute result_rounded = pd.DataFrame(index=result.index) - for col, data in result.iteritems(): + for col, data in result.items(): result_rounded[col] = data.dt.round('min').tz_convert('MST') assert_frame_equal(expected, result_rounded) @@ -259,14 +259,14 @@ def test_sun_rise_set_transit_ephem(expected_rise_set_ephem, golden): altitude=golden.altitude, pressure=0, temperature=11, horizon='-0:34') # round to nearest minute result_rounded = pd.DataFrame(index=result.index) - for col, data in result.iteritems(): + for col, data in result.items(): result_rounded[col] = data.dt.round('min').tz_convert('MST') assert_frame_equal(expected, result_rounded) # test with different timezone times = times.tz_convert('UTC') expected = expected.tz_convert('UTC') # resuse result from previous - for col, data in expected.iteritems(): + for col, data in expected.items(): expected[col] = data.dt.tz_convert('UTC') result = solarposition.sun_rise_set_transit_ephem( times, @@ -274,7 +274,7 @@ def test_sun_rise_set_transit_ephem(expected_rise_set_ephem, golden): altitude=golden.altitude, pressure=0, temperature=11, horizon='-0:34') # round to nearest minute result_rounded = pd.DataFrame(index=result.index) - for col, data in result.iteritems(): + for col, data in result.items(): result_rounded[col] = data.dt.round('min').tz_convert(times.tz) assert_frame_equal(expected, result_rounded)