Skip to content

Commit 010a2ad

Browse files
Bump minimum pandas version to 0.22.0, switch from pd.util.testing to pd.testing (#1003)
* switch to pd.testing and pd._testing * remove network decorator * increase minimum pandas to 0.22.0 * Update docs/sphinx/source/whatsnew/v0.8.0.rst Co-authored-by: Will Holmgren <[email protected]> Co-authored-by: Will Holmgren <[email protected]>
1 parent 6108043 commit 010a2ad

24 files changed

+22
-54
lines changed

ci/requirements-py35-min.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ dependencies:
1414
- requests
1515
- pip:
1616
- numpy==1.12.0
17-
- pandas==0.18.1
17+
- pandas==0.22.0
1818
- pytest-rerunfailures # conda version is >3.6
1919
- pytest-remotedata # conda package is 0.3.0, needs > 0.3.1

docs/sphinx/source/whatsnew/v0.8.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Documentation
5757

5858
Requirements
5959
~~~~~~~~~~~~
60+
* Minimum pandas version increased to v0.22.0, released Dec 31, 2017. (:pull:`1003`)
6061

6162
Contributors
6263
~~~~~~~~~~~~

pvlib/tests/conftest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ def numpy_1_10():
8484
not numpy_1_10(), reason='requires numpy 1.10 or greater')
8585

8686

87-
def pandas_0_22():
88-
return parse_version(pd.__version__) >= parse_version('0.22.0')
89-
90-
91-
needs_pandas_0_22 = pytest.mark.skipif(
92-
not pandas_0_22(), reason='requires pandas 0.22 or greater')
93-
94-
9587
def has_spa_c():
9688
try:
9789
from pvlib.spa_c_files.spa_py import spa_calc

pvlib/tests/iotools/test_crn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pandas as pd
2-
from pandas.util.testing import assert_frame_equal
2+
from pandas.testing import assert_frame_equal
33
import numpy as np
44
from numpy import dtype, nan
55
import pytest

pvlib/tests/iotools/test_epw.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from pandas.util.testing import network
21
import pytest
32

43
from pvlib.iotools import epw
@@ -11,7 +10,6 @@ def test_read_epw():
1110
epw.read_epw(epw_testfile)
1211

1312

14-
@network
1513
@pytest.mark.remote_data
1614
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
1715
def test_read_epw_remote():

pvlib/tests/iotools/test_midc.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pandas as pd
2-
from pandas.util.testing import network
32
import pytest
43
import pytz
54

@@ -64,7 +63,6 @@ def test_read_midc_var_mapping_as_arg(test_mapping):
6463
assert 'temp_air' in data.columns
6564

6665

67-
@network
6866
@pytest.mark.remote_data
6967
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
7068
def test_read_midc_raw_data_from_nrel():

pvlib/tests/iotools/test_solrad.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pandas as pd
2-
from pandas.util.testing import assert_frame_equal
2+
from pandas.testing import assert_frame_equal
33
import numpy as np
44
from numpy import nan
55

pvlib/tests/iotools/test_srml.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from numpy import isnan
22
import pandas as pd
3-
from pandas.util.testing import network
43
import pytest
54

65
from pvlib.iotools import srml
@@ -13,7 +12,6 @@ def test_read_srml():
1312
srml.read_srml(srml_testfile)
1413

1514

16-
@network
1715
@pytest.mark.remote_data
1816
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
1917
def test_read_srml_remote():
@@ -66,7 +64,6 @@ def test_map_columns(column, expected):
6664
assert srml.map_columns(column) == expected
6765

6866

69-
@network
7067
@pytest.mark.remote_data
7168
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
7269
def test_read_srml_month_from_solardat():
@@ -76,7 +73,6 @@ def test_read_srml_month_from_solardat():
7673
assert file_data.equals(requested)
7774

7875

79-
@network
8076
@pytest.mark.remote_data
8177
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
8278
def test_15_minute_dt_index():
@@ -90,7 +86,6 @@ def test_15_minute_dt_index():
9086
assert (data.index[3::4].minute == 45).all()
9187

9288

93-
@network
9489
@pytest.mark.remote_data
9590
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
9691
def test_hourly_dt_index():

pvlib/tests/iotools/test_surfrad.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pandas as pd
2-
from pandas.util.testing import network
32
import pytest
43

54
from pvlib.iotools import surfrad
@@ -10,7 +9,6 @@
109
'Alamosa_CO/2016/slv16001.dat')
1110

1211

13-
@network
1412
@pytest.mark.remote_data
1513
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
1614
def test_read_surfrad_network():

pvlib/tests/iotools/test_tmy.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from pandas.util.testing import network
21
import numpy as np
32
import pandas as pd
43
import pytest
@@ -17,7 +16,6 @@ def test_read_tmy3():
1716
tmy.read_tmy3(TMY3_TESTFILE)
1817

1918

20-
@network
2119
@pytest.mark.remote_data
2220
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
2321
def test_read_tmy3_remote():

pvlib/tests/test_atmosphere.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from numpy import nan
55
from numpy.testing import assert_allclose
66
import pandas as pd
7-
from pandas.util.testing import assert_series_equal
7+
from pandas.testing import assert_series_equal
88
import pytest
99

1010
from pvlib import atmosphere

pvlib/tests/test_clearsky.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import pytest
99
from numpy.testing import assert_allclose
10-
from pandas.util.testing import assert_frame_equal, assert_series_equal
10+
from pandas.testing import assert_frame_equal, assert_series_equal
1111

1212
from pvlib.location import Location
1313
from pvlib import clearsky

pvlib/tests/test_iam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pandas as pd
1010

1111
import pytest
12-
from pandas.util.testing import assert_series_equal
12+
from pandas.testing import assert_series_equal
1313
from numpy.testing import assert_allclose
1414

1515
from pvlib import iam as _iam

pvlib/tests/test_inverter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
import pandas as pd
55

6-
from pandas.util.testing import assert_series_equal
6+
from pandas.testing import assert_series_equal
77
from numpy.testing import assert_allclose
88

99
from pvlib import inverter

pvlib/tests/test_irradiance.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
import pytest
1010
from numpy.testing import assert_almost_equal, assert_allclose
1111

12-
from pandas.util.testing import assert_frame_equal, assert_series_equal
12+
from pandas.testing import assert_frame_equal, assert_series_equal
1313

1414
from pvlib import irradiance
1515

16-
from conftest import (needs_numpy_1_10, pandas_0_22,
17-
requires_ephem, requires_numba)
16+
from conftest import (needs_numpy_1_10, requires_ephem, requires_numba)
1817

1918

2019
# fixtures create realistic test input data
@@ -237,11 +236,8 @@ def test_perez_components(irrad_data, ephem_data, dni_et, relative_airmass):
237236
columns=['sky_diffuse', 'isotropic', 'circumsolar', 'horizon'],
238237
index=irrad_data.index
239238
)
240-
if pandas_0_22():
241-
expected_for_sum = expected['sky_diffuse'].copy()
242-
expected_for_sum.iloc[2] = 0
243-
else:
244-
expected_for_sum = expected['sky_diffuse']
239+
expected_for_sum = expected['sky_diffuse'].copy()
240+
expected_for_sum.iloc[2] = 0
245241
sum_components = out.iloc[:, 1:].sum(axis=1)
246242
sum_components.name = 'sky_diffuse'
247243

pvlib/tests/test_location.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55
from numpy import nan
66
import pandas as pd
7-
from pandas.util.testing import assert_frame_equal, assert_index_equal
7+
from pandas.testing import assert_frame_equal, assert_index_equal
88

99
import pytest
1010

pvlib/tests/test_modelchain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from pvlib.location import Location
1111
from pvlib._deprecation import pvlibDeprecationWarning
1212

13-
from pandas.util.testing import assert_series_equal
13+
from pandas.testing import assert_series_equal
1414
import pytest
1515

1616
from conftest import fail_on_pvlib_version, requires_scipy, requires_tables

pvlib/tests/test_pvsystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pandas as pd
66

77
import pytest
8-
from pandas.util.testing import assert_series_equal, assert_frame_equal
8+
from pandas.testing import assert_series_equal, assert_frame_equal
99
from numpy.testing import assert_allclose
1010

1111
from pvlib import inverter, pvsystem

pvlib/tests/test_snow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import pandas as pd
33

4-
from pandas.util.testing import assert_series_equal
4+
from pandas.testing import assert_series_equal
55

66
from pvlib import snow
77
from pvlib.tools import sind

pvlib/tests/test_soiling.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
import datetime
55
import numpy as np
66
import pandas as pd
7-
from pandas.util.testing import assert_series_equal
7+
from pandas.testing import assert_series_equal
88
from pvlib.soiling import hsu, kimber
99
from pvlib.iotools import read_tmy3
10-
from conftest import (
11-
requires_scipy, needs_pandas_0_22, DATA_DIR)
10+
from conftest import requires_scipy, DATA_DIR
1211
import pytest
1312

1413

@@ -66,7 +65,6 @@ def rainfall_input():
6665

6766

6867
@requires_scipy
69-
@needs_pandas_0_22
7068
def test_hsu_no_cleaning(rainfall_input, expected_output):
7169
"""Test Soiling HSU function"""
7270

@@ -84,7 +82,6 @@ def test_hsu_no_cleaning(rainfall_input, expected_output):
8482

8583

8684
@requires_scipy
87-
@needs_pandas_0_22
8885
def test_hsu(rainfall_input, expected_output_2):
8986
"""Test Soiling HSU function with cleanings"""
9087

@@ -103,7 +100,6 @@ def test_hsu(rainfall_input, expected_output_2):
103100

104101

105102
@requires_scipy
106-
@needs_pandas_0_22
107103
def test_hsu_defaults(rainfall_input, expected_output_1):
108104
"""
109105
Test Soiling HSU function with default deposition velocity and default rain
@@ -129,7 +125,6 @@ def expected_kimber_nowash():
129125
parse_dates=True, index_col='timestamp')
130126

131127

132-
@needs_pandas_0_22
133128
def test_kimber_nowash(greensboro_rain, expected_kimber_nowash):
134129
"""Test Kimber soiling model with no manual washes"""
135130
# Greensboro typical expected annual rainfall is 8345mm
@@ -147,7 +142,6 @@ def expected_kimber_manwash():
147142
parse_dates=True, index_col='timestamp')
148143

149144

150-
@needs_pandas_0_22
151145
def test_kimber_manwash(greensboro_rain, expected_kimber_manwash):
152146
"""Test Kimber soiling model with a manual wash"""
153147
# a manual wash date
@@ -171,7 +165,6 @@ def expected_kimber_norain():
171165
return np.where(norain > max_loss_rate, max_loss_rate, norain)
172166

173167

174-
@needs_pandas_0_22
175168
def test_kimber_norain(greensboro_rain, expected_kimber_norain):
176169
"""Test Kimber soiling model with no rain"""
177170
# a year with no rain
@@ -193,7 +186,6 @@ def expected_kimber_initial_soil():
193186
return np.where(norain > max_loss_rate, max_loss_rate, norain)
194187

195188

196-
@needs_pandas_0_22
197189
def test_kimber_initial_soil(greensboro_rain, expected_kimber_initial_soil):
198190
"""Test Kimber soiling model with initial soiling"""
199191
# a year with no rain

pvlib/tests/test_solarposition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy as np
66
import pandas as pd
77

8-
from pandas.util.testing import assert_frame_equal, assert_series_equal
8+
from pandas.testing import assert_frame_equal, assert_series_equal
99
from numpy.testing import assert_allclose
1010
import pytest
1111

pvlib/tests/test_temperature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import numpy as np
33

44
import pytest
5-
from pandas.util.testing import assert_series_equal
5+
from pandas.testing import assert_series_equal
66
from numpy.testing import assert_allclose
77

88
from pvlib import temperature

pvlib/tests/test_tracking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pandas as pd
44

55
import pytest
6-
from pandas.util.testing import assert_frame_equal
6+
from pandas.testing import assert_frame_equal
77
from numpy.testing import assert_allclose
88

99
from pvlib.location import Location

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
URL = 'https://github.com/pvlib/pvlib-python'
3939

4040
INSTALL_REQUIRES = ['numpy >= 1.12.0',
41-
'pandas >= 0.18.1',
41+
'pandas >= 0.22.0',
4242
'pytz',
4343
'requests']
4444
TESTS_REQUIRE = ['nose', 'pytest', 'pytest-cov', 'pytest-mock',

0 commit comments

Comments
 (0)