Skip to content

Commit 2e3f925

Browse files
committed
add more tmy tests
1 parent 537be43 commit 2e3f925

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

pvlib/test/test_tmy.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,27 @@
55
import os
66

77
test_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
8+
tmy3_testfile = os.path.join(test_dir, '../data/703165TY.csv')
9+
tmy2_testfile = os.path.join(test_dir, '../data/12839.tm2')
810

911
from pvlib import tmy
1012

1113

1214
def test_readtmy3():
13-
tmy.readtmy3(os.path.join(test_dir, '../data/703165TY.csv'))
15+
tmy.readtmy3(tmy3_testfile)
16+
17+
def test_readtmy3_remote():
18+
url = 'http://rredc.nrel.gov/solar/old_data/nsrdb/1991-2005/data/tmy3/703165TYA.CSV'
19+
tmy.readtmy3(url)
20+
21+
def test_readtmy3_recolumn():
22+
data, meta = tmy.readtmy3(tmy3_testfile)
23+
assert 'GHISource' in data.columns
24+
25+
def test_readtmy3_norecolumn():
26+
data, meta = tmy.readtmy3(tmy3_testfile, recolumn=False)
27+
assert 'GHI source' in data.columns
1428

1529
def test_readtmy2():
16-
tmy.readtmy2(os.path.join(test_dir, '../data/12839.tm2'))
30+
tmy.readtmy2(tmy2_testfile)
1731

0 commit comments

Comments
 (0)