Skip to content

Commit 624572a

Browse files
authored
feat(TEC-3703): Update to NESO links (#2)
1 parent ec9ecae commit 624572a

File tree

3 files changed

+59
-55
lines changed

3 files changed

+59
-55
lines changed

pyngeso/pyngeso.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def query(
5353
limit: Optional[int] = None,
5454
) -> bytes:
5555

56-
url = "https://data.nationalgrideso.com/api/3/action/datastore_search_sql"
56+
url = "https://api.neso.energy/api/3/action/datastore_search_sql"
5757
sql = self.construct_sql(fields, date_col, start_date, end_date, filters, limit)
5858
params = {"sql": sql}
5959

pyngeso/resources.py

+51-51
Original file line numberDiff line numberDiff line change
@@ -3,203 +3,203 @@
33
api_resource_ids: Dict[str, Dict[str, str]] = {
44
"historic-day-ahead-demand-forecast": {
55
"id": "9847e7bb-986e-49be-8138-717b25933fbb",
6-
"url": "https://data.nationalgrideso.com/demand/1-day-ahead-demand-forecast/r/historic_day_ahead_demand_forecasts",
6+
"url": "https://www.neso.energy/data-portal/1-day-ahead-demand-forecast/historic_day_ahead_demand_forecasts",
77
},
88
"day-ahead-demand-forecast": {
99
"id": "aec5601a-7f3e-4c4c-bf56-d8e4184d3c5b",
10-
"url": "https://data.nationalgrideso.com/demand/1-day-ahead-demand-forecast/r/day_ahead_national_demand_forecast",
10+
"url": "https://www.neso.energy/data-portal/1-day-ahead-demand-forecast/day_ahead_national_demand_forecast",
1111
},
1212
"historic-2day-ahead-demand-forecast": {
1313
"id": "24abd271-5936-45c7-85f4-2a6b450ef6b7",
14-
"url": "https://data.nationalgrideso.com/demand/2-day-ahead-demand-forecast/r/historic_2_day_ahead_demand_forecasts",
14+
"url": "https://www.neso.energy/data-portal/2-day-ahead-demand-forecast/historic_2_day_ahead_demand_forecasts",
1515
},
1616
"2day-ahead-demand-forecast": {
1717
"id": "cda26f27-4bb6-4632-9fb5-2d029ca605e1",
18-
"url": "https://data.nationalgrideso.com/demand/2-day-ahead-demand-forecast/r/2_day_ahead_demand_forecast",
18+
"url": "https://www.neso.energy/data-portal/2-day-ahead-demand-forecast/2_day_ahead_demand_forecast",
1919
},
2020
"historic-2-14-days-ahead-demand-forecast": {
2121
"id": "4dd712a2-ee2c-455d-a9c0-9d3564c80fa0",
22-
"url": "https://data.nationalgrideso.com/demand/2-14-days-ahead-national-demand-forecast/r/historic_2-14_day_ahead_demand_forecasts",
22+
"url": "https://www.neso.energy/data-portal/2-14-days-ahead-national-demand-forecast/historic_2-14_day_ahead_demand_forecasts",
2323
},
2424
"historic-day-ahead-wind-forecast": {
2525
"id": "7524ec65-f782-4258-aaf8-5b926c17b966",
26-
"url": "https://data.nationalgrideso.com/demand/day-ahead-wind-forecast/r/historic_day_ahead_wind_forecasts",
26+
"url": "https://www.neso.energy/data-portal/day-ahead-wind-forecast/historic_day_ahead_wind_forecasts",
2727
},
2828
"day-ahead-wind-forecast": {
2929
"id": "b2f03146-f05d-4824-a663-3a4f36090c71",
30-
"url": "https://data.nationalgrideso.com/demand/day-ahead-wind-forecast/r/day_ahead_wind_forecast",
30+
"url": "https://www.neso.energy/data-portal/day-ahead-wind-forecast/day_ahead_wind_forecast",
3131
},
3232
"14-days-ahead-wind-forecast": {
3333
"id": "93c3048e-1dab-4057-a2a9-417540583929",
34-
"url": "https://data.nationalgrideso.com/demand/14-days-ahead-wind-forecasts/r/14_days_ahead_wind_forecast",
34+
"url": "https://www.neso.energy/data-portal/14-days-ahead-wind-forecasts/14_days_ahead_wind_forecast",
3535
},
3636
"embedded-solar-and-wind": {
3737
"id": "db6c038f-98af-4570-ab60-24d71ebd0ae5",
38-
"url": "https://data.nationalgrideso.com/generation/embedded-wind-and-solar-forecasts/r/embedded_solar_and_wind_forecast",
38+
"url": "https://www.neso.energy/data-portal/embedded-wind-and-solar-forecasts/embedded_solar_and_wind_forecast",
3939
},
4040
"demand-data-update": {
4141
"id": "177f6fa4-ae49-4182-81ea-0c6b35f26ca6",
42-
"url": "https://data.nationalgrideso.com/demand/daily-demand-update",
42+
"url": "https://www.neso.energy/data-portal/daily-demand-update",
4343
},
4444
"historic-demand-data-2022": {
4545
"id": "bb44a1b5-75b1-4db2-8491-257f23385006",
46-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2022",
46+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2022",
4747
},
4848
"historic-demand-data-2021": {
4949
"id": "18c69c42-f20d-46f0-84e9-e279045befc6",
50-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2021",
50+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2021",
5151
},
5252
"historic-demand-data-2020": {
5353
"id": "33ba6857-2a55-479f-9308-e5c4c53d4381",
54-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2020",
54+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2020",
5555
},
5656
"historic-demand-data-2019": {
5757
"id": "dd9de980-d724-415a-b344-d8ae11321432",
58-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2019",
58+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2019",
5959
},
6060
"historic-demand-data-2018": {
6161
"id": "fcb12133-0db0-4f27-a4a5-1669fd9f6d33",
62-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2018",
62+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2018",
6363
},
6464
"historic-demand-data-2017": {
6565
"id": "2f0f75b8-39c5-46ff-a914-ae38088ed022",
66-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2017",
66+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2017",
6767
},
6868
"historic-demand-data-2016": {
6969
"id": "3bb75a28-ab44-4a0b-9b1c-9be9715d3c44",
70-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2016",
70+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2016",
7171
},
7272
"historic-demand-data-2015": {
7373
"id": "cc505e45-65ae-4819-9b90-1fbb06880293",
74-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2015",
74+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2015",
7575
},
7676
"historic-demand-data-2014": {
7777
"id": "b9005225-49d3-40d1-921c-03ee2d83a2ff",
78-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2014",
78+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2014",
7979
},
8080
"historic-demand-data-2013": {
8181
"id": "2ff7aaff-8b42-4c1b-b234-9446573a1e27",
82-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2013",
82+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2013",
8383
},
8484
"historic-demand-data-2012": {
8585
"id": "4bf713a2-ea0c-44d3-a09a-63fc6a634b00",
86-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2012",
86+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2012",
8787
},
8888
"historic-demand-data-2011": {
8989
"id": "01522076-2691-4140-bfb8-c62284752efd",
90-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2011",
90+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2011",
9191
},
9292
"historic-demand-data-2010": {
9393
"id": "b3eae4a5-8c3c-4df1-b9de-7db243ac3a09",
94-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2010",
94+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2010",
9595
},
9696
"historic-demand-data-2009": {
9797
"id": "ed8a37cb-65ac-4581-8dbc-a3130780da3a",
98-
"url": "https://data.nationalgrideso.com/demand/historic-demand-data/r/historic_demand_data_2009",
98+
"url": "https://www.neso.energy/data-portal/historic-demand-data/historic_demand_data_2009",
9999
},
100100
"dc-results-summary": {
101101
"id": "888e5029-f786-41d2-bc15-cbfd1d285e96",
102-
"url": "https://data.nationalgrideso.com/ancillary-services/dynamic-containment-data/r/dc_results_summary_master_data_2021-2022",
102+
"url": "https://www.neso.energy/data-portal/dynamic-containment-data/dc_dr__dm_results_summary_master_data_2021-2023",
103103
},
104104
"dc-dr-dm-block-orders": {
105105
"id": "6fd8e042-be27-4c67-ad59-5acdd2a7b0fd",
106-
"url": "https://data.nationalgrideso.com/ancillary-services/dynamic-containment-data/r/dc,_dr_&_dm_block_orders_master_data_2021-2022",
106+
"url": "https://www.neso.energy/data-portal/dynamic-containment-data/dc_dr__dm_block_orders_master_data_2021-2023",
107107
},
108108
"dc-volume-forecast": {
109109
"id": "d5c3b48a-a0a9-4d57-a02a-ac0af09a6298",
110-
"url": "https://data.nationalgrideso.com/ancillary-services/dynamic-containment-4-day-forecast/r/dynamic_containment_4_day_forecast_-_history",
110+
"url": "https://www.neso.energy/data-portal/dynamic-containment-4-day-forecast/dynamic_containment_4_day_forecast_-_history",
111111
},
112112
"dc-dr-dm-linear-orders": {
113113
"id": "26aefbcc-fce0-403f-80e1-4a26af3fe84b",
114-
"url": "https://data.nationalgrideso.com/ancillary-services/dynamic-containment-data/r/dc_dr_dm_linear_orders_master_data_2021-2023",
114+
"url": "https://data.nationalgrideso.com/dynamic-containment-data/dc_dr_dm_linear_orders_master_data_2021-2023",
115115
},
116116
"historic-frequency-data-jan22": {
117117
"id": "43000c20-1208-4ca7-a419-712c7a1d375c",
118-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/january_2022_-_historic_frequency_data",
118+
"url": "https://www.neso.energy/data-portal/system-frequency-data/january_2022_-_historic_frequency_data",
119119
},
120120
"historic-frequency-data-dec21": {
121121
"id": "afe9895c-5937-4e78-8949-f0f026643666",
122-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/december_2021_-_historic_frequency_data",
122+
"url": "https://www.neso.energy/data-portal/system-frequency-data/december_2021_-_historic_frequency_data",
123123
},
124124
"historic-frequency-data-nov21": {
125125
"id": "9bc4746e-3152-4c6f-886e-58377ab88e0e",
126-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/november_2021_-_historic_frequency_data",
126+
"url": "https://www.neso.energy/data-portal/system-frequency-data/november_2021_-_historic_frequency_data",
127127
},
128128
"historic-frequency-data-oct21": {
129129
"id": "12291f14-95c3-4847-b2ef-3190eaa1193c",
130-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/october_2021_-_historic_frequency_data",
130+
"url": "https://www.neso.energy/data-portal/system-frequency-data/october_2021_-_historic_frequency_data",
131131
},
132132
"historic-frequency-data-sep21": {
133133
"id": "5cea7516-cbc3-416e-8dbf-162327c16b17",
134-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/september_2021_-_historic_frequency_data",
134+
"url": "https://www.neso.energy/data-portal/system-frequency-data/september_2021_-_historic_frequency_data",
135135
},
136136
"historic-frequency-data-aug21": {
137137
"id": "ae40912b-de8f-43b1-8eeb-c58e469f2365",
138-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/august_2021_-_historic_frequency_data",
138+
"url": "https://www.neso.energy/data-portal/system-frequency-data/august_2021_-_historic_frequency_data",
139139
},
140140
"historic-frequency-data-jul21": {
141141
"id": "94d95251-ccbb-4187-ae54-1b90ebf12b9f",
142-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/july_2021_-_historic_frequency_data",
142+
"url": "https://www.neso.energy/data-portal/system-frequency-data/july_2021_-_historic_frequency_data",
143143
},
144144
"historic-frequency-data-jun21": {
145145
"id": "bd754692-bce7-43b7-ba25-813921476391",
146-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/june_2021_-_historic_frequency_data",
146+
"url": "https://www.neso.energy/data-portal/system-frequency-data/june_2021_-_historic_frequency_data",
147147
},
148148
"historic-frequency-data-may21": {
149149
"id": "625597eb-7364-4ba8-a306-a7f59dcdc2a7",
150-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/may_2021_-_historic_frequency_data",
150+
"url": "https://www.neso.energy/data-portal/system-frequency-data/may_2021_-_historic_frequency_data",
151151
},
152152
"historic-frequency-data-apr21": {
153153
"id": "bd6e1b3f-1abb-452c-813c-397a41f7af8d",
154-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/april_2021_-_historic_frequency_data",
154+
"url": "https://www.neso.energy/data-portal/system-frequency-data/april_2021_-_historic_frequency_data",
155155
},
156156
"historic-frequency-data-mar21": {
157157
"id": "ac4e4031-0f86-48ff-8ecd-147d51ffbb81",
158-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/march_2021_-_historic_frequency_data",
158+
"url": "https://www.neso.energy/data-portal/system-frequency-data/march_2021_-_historic_frequency_data",
159159
},
160160
"historic-frequency-data-feb21": {
161161
"id": "53e2be31-c68c-40b3-bb83-7ae12240107c",
162-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/february_2021_-_historic_frequency_data",
162+
"url": "https://www.neso.energy/data-portal/system-frequency-data/february_2021_-_historic_frequency_data",
163163
},
164164
"historic-frequency-data-jan21": {
165165
"id": "fe2502b8-7fef-4027-8399-550a0c84f415",
166-
"url": "https://data.nationalgrideso.com/system/system-frequency-data/r/january_2021_-_historic_frequency_data",
166+
"url": "https://www.neso.energy/data-portal/system-frequency-data/january_2021_-_historic_frequency_data",
167167
},
168168
"carbon-intensity-forecast": {
169169
"id": "0e5fde43-2de7-4fb4-833d-c7bca3b658b0",
170-
"url": "https://data.nationalgrideso.com/carbon-intensity1/national-carbon-intensity-forecast/r/national_carbon_intensity_forecast",
170+
"url": "https://www.neso.energy/data-portal/national-carbon-intensity-forecast/national_carbon_intensity_forecast",
171171
},
172172
"transmission-entry-capacity-tec-register": {
173173
"id": "17becbab-e3e8-473f-b303-3806f43a6a10",
174-
"url": "https://data.nationalgrideso.com/connection-registers/transmission-entry-capacity-tec-register/r/tec_register",
174+
"url": "https://www.neso.energy/data-portal/transmission-entry-capacity-tec-register/tec_register",
175175
},
176176
"dx-eac-eso-results-summary": {
177177
"id": "596f29ac-0387-4ba4-a6d3-95c243140707",
178-
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
178+
"url": "https://api.neso.energy/api/3/action/datastore_search",
179179
},
180180
"dx-eac-eso-sell-orders": {
181181
"id": "13b511df-d6ec-4143-afb1-0ecc6fd19810",
182-
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
182+
"url": "https://api.neso.energy/api/3/action/datastore_search",
183183
},
184184
"dx-eac-eso-buy-orders": {
185185
"id": "1cf68f59-8eb8-4f1d-bccf-11b5a47b24e5",
186-
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
186+
"url": "https://api.neso.energy/api/3/action/datastore_search",
187187
},
188188
"br-eac-eso-results-summary": {
189189
"id": "1b3f2ee1-74a0-4939-a5a3-f01f19e663e4",
190-
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
190+
"url": "https://api.neso.energy/api/3/action/datastore_search",
191191
},
192192
"br-eac-eso-sell-orders": {
193193
"id": "3f53c38b-d287-41af-b4c8-769abb6e707a",
194-
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
194+
"url": "https://api.neso.energy/api/3/action/datastore_search",
195195
},
196196
"br-eac-eso-buy-orders": {
197197
"id": "8a549d29-52cd-4016-a04e-c01a3e31bd3a",
198-
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
198+
"url": "https://api.neso.energy/api/3/action/datastore_search",
199199
},
200200
"br-eac-eso-results-by-units": {
201201
"id": "5d8e47be-e262-4398-89b0-6f93f636faf6",
202-
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
202+
"url": "https://api.neso.energy/api/3/action/datastore_search",
203203
},
204204
}
205205

@@ -208,6 +208,6 @@
208208
"dataset_id": "88313ae5-94e4-4ddc-a790-593554d8c6b9",
209209
"resource_id": "f93d1835-75bc-43e5-84ad-12472b180a98",
210210
"filename": "df_fuel_ckan.csv",
211-
"url": "https://data.nationalgrideso.com/carbon-intensity1/historic-generation-mix",
211+
"url": "https://www.neso.energy/data-portal/historic-generation-mix/historic_gb_generation_mix",
212212
}
213213
}

tests/test_pyngeso.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def test_day_ahead_historic_forecast_missing_data_warning(caplog):
4343

4444
@pytest.mark.vcr
4545
def test_2day_ahead_historic_forecast():
46-
start_date = date(2018, 3, 30)
47-
end_date = date(2018, 3, 30)
46+
start_date = date(2024, 3, 30)
47+
end_date = date(2024, 3, 30)
4848
client = NgEso("historic-2day-ahead-demand-forecast")
4949
r = client.query(date_col="TARGETDATE", start_date=start_date, end_date=end_date)
5050

@@ -120,8 +120,11 @@ def test_historic_generation_mix():
120120
headers_row = next(c)
121121
first_row = next(c)
122122

123+
print(headers_row)
124+
print(first_row)
125+
123126
assert "DATETIME" in headers_row
124-
assert "2009-01-01 00:00:00+00:00" in first_row
127+
assert "2009-01-01 00:00:00+00" in first_row
125128
assert len(headers_row) == len(first_row)
126129

127130

@@ -349,6 +352,7 @@ def test_historic_demand_data(year: int):
349352

350353
@pytest.mark.vcr
351354
def test_dx_eac_eso_results_summary():
355+
352356
date_col = "deliveryStart"
353357
start_date = datetime(2023, 11, 2, 23)
354358
end_date = datetime(2023, 11, 3, 23)

0 commit comments

Comments
 (0)