forked from pvlib/pvlib-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_epw.py
More file actions
23 lines (15 loc) · 668 Bytes
/
test_epw.py
File metadata and controls
23 lines (15 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest
from pvlib.iotools import epw
from tests.conftest import TESTS_DATA_DIR, RERUNS, RERUNS_DELAY
epw_testfile = TESTS_DATA_DIR / 'NLD_Amsterdam062400_IWEC.epw'
def test_read_epw():
epw.read_epw(epw_testfile)
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
def test_read_epw_remote():
url = 'https://energyplus-weather.s3.amazonaws.com/europe_wmo_region_6/NLD/NLD_Amsterdam.062400_IWEC/NLD_Amsterdam.062400_IWEC.epw'
epw.read_epw(url)
def test_read_epw_coerce_year():
coerce_year = 1987
data, _ = epw.read_epw(epw_testfile, coerce_year=coerce_year)
assert (data.index.year == 1987).all()