Skip to content

Commit f76bfeb

Browse files
committed
make tables a required dep, remove requires_tables test decorator
1 parent 238146d commit f76bfeb

File tree

5 files changed

+6
-26
lines changed

5 files changed

+6
-26
lines changed

pvlib/tests/conftest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,6 @@ def assert_frame_equal(left, right, **kwargs):
105105
not has_statsmodels, reason='requires statsmodels')
106106

107107

108-
try:
109-
import tables
110-
has_tables = True
111-
except ImportError:
112-
has_tables = False
113-
114-
requires_tables = pytest.mark.skipif(not has_tables, reason='requires tables')
115-
116-
117108
try:
118109
import ephem
119110
has_ephem = True

pvlib/tests/test_clearsky.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from pvlib import atmosphere
1717
from pvlib import irradiance
1818

19-
from .conftest import requires_tables, DATA_DIR
19+
from .conftest import DATA_DIR
2020

2121

2222
def test_ineichen_series():
@@ -189,7 +189,6 @@ def test_ineichen_altitude():
189189
assert_frame_equal(expected, out)
190190

191191

192-
@requires_tables
193192
def test_lookup_linke_turbidity():
194193
times = pd.date_range(start='2014-06-24', end='2014-06-25',
195194
freq='12h', tz='America/Phoenix')
@@ -202,7 +201,6 @@ def test_lookup_linke_turbidity():
202201
assert_series_equal(expected, out)
203202

204203

205-
@requires_tables
206204
def test_lookup_linke_turbidity_leapyear():
207205
times = pd.date_range(start='2016-06-24', end='2016-06-25',
208206
freq='12h', tz='America/Phoenix')
@@ -215,7 +213,6 @@ def test_lookup_linke_turbidity_leapyear():
215213
assert_series_equal(expected, out)
216214

217215

218-
@requires_tables
219216
def test_lookup_linke_turbidity_nointerp():
220217
times = pd.date_range(start='2014-06-24', end='2014-06-25',
221218
freq='12h', tz='America/Phoenix')
@@ -226,7 +223,6 @@ def test_lookup_linke_turbidity_nointerp():
226223
assert_series_equal(expected, out)
227224

228225

229-
@requires_tables
230226
def test_lookup_linke_turbidity_months():
231227
times = pd.date_range(start='2014-04-01', end='2014-07-01',
232228
freq='1M', tz='America/Phoenix')
@@ -237,7 +233,6 @@ def test_lookup_linke_turbidity_months():
237233
assert_series_equal(expected, out)
238234

239235

240-
@requires_tables
241236
def test_lookup_linke_turbidity_months_leapyear():
242237
times = pd.date_range(start='2016-04-01', end='2016-07-01',
243238
freq='1M', tz='America/Phoenix')
@@ -248,7 +243,6 @@ def test_lookup_linke_turbidity_months_leapyear():
248243
assert_series_equal(expected, out)
249244

250245

251-
@requires_tables
252246
def test_lookup_linke_turbidity_nointerp_months():
253247
times = pd.date_range(start='2014-04-10', end='2014-07-10',
254248
freq='1M', tz='America/Phoenix')
@@ -480,7 +474,6 @@ def test_simplified_solis_nans_series():
480474
assert_frame_equal(expected, out)
481475

482476

483-
@requires_tables
484477
def test_linke_turbidity_corners():
485478
"""Test Linke turbidity corners out of bounds."""
486479
months = pd.DatetimeIndex('%d/1/2016' % (m + 1) for m in range(12))

pvlib/tests/test_location.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from pvlib.location import Location
1616
from pvlib.solarposition import declination_spencer71
1717
from pvlib.solarposition import equation_of_time_spencer71
18-
from .conftest import requires_ephem, requires_tables
18+
from .conftest import requires_ephem
1919

2020

2121
def test_location_required():
@@ -77,7 +77,6 @@ def times():
7777
freq='3H')
7878

7979

80-
@requires_tables
8180
def test_get_clearsky(mocker, times):
8281
tus = Location(32.2, -111, 'US/Arizona', 700, 'Tucson')
8382
m = mocker.spy(pvlib.clearsky, 'ineichen')

pvlib/tests/test_modelchain.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .conftest import assert_series_equal, assert_frame_equal
1414
import pytest
1515

16-
from .conftest import fail_on_pvlib_version, requires_tables
16+
from .conftest import fail_on_pvlib_version
1717

1818

1919
@pytest.fixture(scope='function')
@@ -1788,7 +1788,6 @@ def test_ModelChain_attributes_deprecated_10(sapm_dc_snl_ac_system, location):
17881788
mc.aoi = 5
17891789

17901790

1791-
@requires_tables
17921791
def test_basic_chain_alt_az(sam_data, cec_inverter_parameters,
17931792
sapm_temperature_cs5p_220m):
17941793
times = pd.date_range(start='20160101 1200-0700',
@@ -1810,7 +1809,6 @@ def test_basic_chain_alt_az(sam_data, cec_inverter_parameters,
18101809
assert_series_equal(ac, expected)
18111810

18121811

1813-
@requires_tables
18141812
def test_basic_chain_altitude_pressure(sam_data, cec_inverter_parameters,
18151813
sapm_temperature_cs5p_220m):
18161814
times = pd.date_range(start='20160101 1200-0700',
@@ -1861,7 +1859,6 @@ def test_complete_irradiance_clean_run(sapm_dc_snl_ac_system, location):
18611859
pd.Series([9, 5], index=times, name='ghi'))
18621860

18631861

1864-
@requires_tables
18651862
def test_complete_irradiance(sapm_dc_snl_ac_system, location):
18661863
"""Check calculations"""
18671864
mc = ModelChain(sapm_dc_snl_ac_system, location)
@@ -1890,7 +1887,6 @@ def test_complete_irradiance(sapm_dc_snl_ac_system, location):
18901887

18911888
@pytest.mark.filterwarnings("ignore:This function is not safe at the moment")
18921889
@pytest.mark.parametrize("input_type", [tuple, list])
1893-
@requires_tables
18941890
def test_complete_irradiance_arrays(
18951891
sapm_dc_snl_ac_system_same_arrays, location, input_type):
18961892
"""ModelChain.complete_irradiance can accept a tuple of weather

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
'pandas >= 0.22.0',
4343
'pytz',
4444
'requests',
45-
'scipy >= 1.2.0']
45+
'scipy >= 1.2.0',
46+
'tables']
4647

4748
# include dataclasses as a dependency only on python 3.6
4849
if sys.version_info.major == 3 and sys.version_info.minor == 6:
@@ -53,7 +54,7 @@
5354
'pytest-remotedata']
5455
EXTRAS_REQUIRE = {
5556
'optional': ['cython', 'ephem', 'netcdf4', 'nrel-pysam', 'numba',
56-
'pvfactors', 'siphon', 'statsmodels', 'tables',
57+
'pvfactors', 'siphon', 'statsmodels',
5758
'cftime >= 1.1.1'],
5859
'doc': ['ipython', 'matplotlib', 'sphinx == 3.1.2',
5960
'sphinx_rtd_theme==0.5.0', 'sphinx-gallery', 'docutils == 0.15.2',

0 commit comments

Comments
 (0)