Skip to content

Commit 109d381

Browse files
authored
Merge pull request #3 from atsangarides/wind
Wind
2 parents a3b004b + 8bc3a98 commit 109d381

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ from pyngeso import NgEso
1616
resource = "historic-day-ahead-demand-forecast"
1717
date_col = "TARGETDATE"
1818
start_date = "2018-01-01"
19-
end_date = "2018-01-02"
19+
end_date = "2018-01-01"
2020

2121
client = NgEso(resource)
2222
# returns content of response
@@ -29,3 +29,5 @@ r: bytes = client.query(date_col=date_col, start_date=start_date, end_date=end_d
2929
* `day-ahead-demand-forecast`
3030
* `historic-2day-ahead-demand-forecast`
3131
* `2day-ahead-demand-forecast`
32+
* `historic-day-ahead-wind-forecast`
33+
* `day-ahead-wind-forecast`

pyngeso/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .pyngeso import NgEso
22

3-
__version__ = '0.2.0'
3+
__version__ = '0.2.1'

pyngeso/resources.py

+8
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,13 @@
1616
"2day-ahead-demand-forecast": {
1717
"id": "cda26f27-4bb6-4632-9fb5-2d029ca605e1",
1818
"url": "https://data.nationalgrideso.com/demand/2-day-ahead-demand-forecast/r/2_day_ahead_demand_forecast"
19+
},
20+
"historic-day-ahead-wind-forecast": {
21+
"id": "7524ec65-f782-4258-aaf8-5b926c17b966",
22+
"url": "https://data.nationalgrideso.com/demand/day-ahead-wind-forecast/r/historic_day_ahead_wind_forecasts"
23+
},
24+
"day-ahead-wind-forecast": {
25+
"id": "b2f03146-f05d-4824-a663-3a4f36090c71",
26+
"url": "https://data.nationalgrideso.com/demand/day-ahead-wind-forecast/r/day_ahead_wind_forecast"
1927
}
2028
}

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pyngeso"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "Simple python wrapper for the National Grid ESO Portal"
55
authors = ["atsangarides <[email protected]>"]
66
license = "MIT"

tests/test_pyngeso.py

+17
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,20 @@ def test_2day_ahead_historic_forecast():
5353
assert len(records) > 0
5454
unique_target_dates = set([record.get("TARGETDATE") for record in records])
5555
assert len(unique_target_dates) == 1
56+
57+
58+
@pytest.mark.vcr
59+
def test_historic_day_ahead_wind_forecast():
60+
date_col = "Date"
61+
start_date = "2018-04-17"
62+
end_date = "2018-04-17"
63+
client = NgEso("historic-day-ahead-wind-forecast")
64+
r = client.query(date_col=date_col, start_date=start_date, end_date=end_date)
65+
66+
assert isinstance(r, bytes)
67+
r_dict = json.loads(r)
68+
records = r_dict.get("result").get("records")
69+
assert isinstance(records, list)
70+
assert len(records) > 0
71+
unique_target_dates = set([record.get(date_col) for record in records])
72+
assert len(unique_target_dates) == 1

0 commit comments

Comments
 (0)