8000 Add retrieval functions for daily precip, snow, and temperature data from NOAA RCC ACIS by kandersolar · Pull Request #1767 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Add retrieval functions for daily precip, snow, and temperature data from NOAA RCC ACIS #1767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jun 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
better tests
  • Loading branch information
kandersolar committed Jun 10, 2023
commit 14dd5982929091f0abb8b1dfe075ea479bde8f8f
20 changes: 14 additions & 6 deletions pvlib/tests/iotools/test_acis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@
from ..conftest import (RERUNS, RERUNS_DELAY, assert_series_equal)
from requests import HTTPError


@pytest.mark.parametrize('dataset,expected,lat,lon', [
(1, [0.76, 1.78, 1.52, 0.76, 0.0], 40.0, -80.0)
(2, [0.05, 2.74, 1.43, 0.92, 0.0], 40.0083, -79.9653)
(3, [0.0, 2.79, 1.52, 1.02, 0.0], 40.0, -80.0)
(21, [0.6, 1.8, 1.9, 1.2, 0.0], 40.0, -80.9)
])
@pytest.mark.remote_data
@pytest.mark.flaky(reruns=RERUNS, reruns_delay=RERUNS_DELAY)
def test_get_acis_precipitation():
precipitation, meta = get_acis_precipitation(40, -80, '2012-01-01',
'2012-01-05', 21)
idx = pd.date_range('2012-01-01', '2012-01-05', freq='d')
expected = pd.Series([0.6, 1.8, 1.9, 1.2, 0.0], index=idx,
name='precipitation')
def test_get_acis_precipitation(dataset, expected, lat, lon):
st = '2012-01-01'
ed = '2012-01-05'
precipitation, meta = get_acis_precipitation(40, -80, st, ed, dataset)
idx = pd.date_range(st, ed, freq='d')
expected = pd.Series(expected, index=idx, name='precipitation')
assert_series_equal(precipitation, expected)
assert meta == {'latitude': lat, 'longitude': lon}


@pytest.mark.remote_data
Expand Down
0