Skip to content

Commit 9f51566

Browse files
committed
Added Dynamic Containment cleared volumes/prices
1 parent 069261a commit 9f51566

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Diff for: pyngeso/resources.py

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
"demand-data-update": {
2929
"id": "177f6fa4-ae49-4182-81ea-0c6b35f26ca6",
3030
"url": "https://data.nationalgrideso.com/demand/daily-demand-update"
31+
},
32+
"dc-results-summary": {
33+
"id": "888e5029-f786-41d2-bc15-cbfd1d285e96",
34+
"url": "https://data.nationalgrideso.com/ancillary-services/dynamic-containment-data/r/dc_results_summary_master_data_2021-2022"
3135
}
3236
}
3337

Diff for: tests/test_pyngeso.py

+20
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,23 @@ def test_demand_data_update_with_filter():
127127
unique_target_dates = set([record.get(date_col) for record in records])
128128
assert len(unique_target_dates) == 1
129129
assert len(records) == 48
130+
131+
132+
@pytest.mark.vcr
133+
def test_dc_results_summary():
134+
date_col = "EFA Date"
135+
start_date = "2021-09-16"
136+
end_date = "2021-09-16"
137+
filter_condition = "\"Service\" = 'DCH'"
138+
client = NgEso("dc-results-summary")
139+
r = client.query(date_col=date_col, start_date=start_date, end_date=end_date,
140+
filters=[filter_condition])
141+
142+
assert isinstance(r, bytes)
143+
r_dict = json.loads(r)
144+
records = r_dict.get("result").get("records")
145+
assert isinstance(records, list)
146+
assert len(records) > 0
147+
unique_target_dates = set([record.get(date_col) for record in records])
148+
assert len(unique_target_dates) == 1
149+
assert len(records) == 6

0 commit comments

Comments
 (0)