Skip to content

Commit efba304

Browse files
authored
Merge PVNet UK intraday and day-ahead (#372)
1 parent b1bc83f commit efba304

File tree

2 files changed

+3
-50
lines changed

2 files changed

+3
-50
lines changed

src/airflow_dags/dags/uk/forecast-gsp-dag.py

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,15 @@
2727
"max_active_tasks": 10,
2828
}
2929

30-
gsp_forecaster_args = dict( # noqa: C408
30+
gsp_forecaster = ContainerDefinition(
3131
name="forecast-pvnet",
3232
container_image="ghcr.io/openclimatefix/uk-pvnet-app",
33-
container_tag="2.6.18",
33+
container_tag="2.6.19",
3434
container_env={
3535
"LOGLEVEL": "INFO",
3636
"RAISE_MODEL_FAILURE": "critical",
3737
"ALLOW_ADJUSTER": "true",
3838
"ALLOW_SAVE_GSP_SUM": "true",
39-
"DAY_AHEAD_MODEL": "false",
4039
"SAVE_BATCHES_DIR": f"s3://uk-national-forecaster-models-{env}/pvnet_batches",
4140
"NWP_ECMWF_ZARR_PATH": f"s3://nowcasting-nwp-{env}/ecmwf/data/latest.zarr",
4241
"NWP_UKV_ZARR_PATH": f"s3://nowcasting-nwp-{env}/data-metoffice/latest.zarr",
@@ -51,8 +50,6 @@
5150
container_cpu=2048,
5251
container_memory=12288,
5352
)
54-
gsp_forecaster = ContainerDefinition(**gsp_forecaster_args)
55-
5653

5754
national_forecaster = ContainerDefinition(
5855
name="forecast-national",
@@ -169,7 +166,6 @@ def gsp_forecast_pvnet_dag() -> None:
169166
container_def=gsp_forecaster,
170167
env_overrides={
171168
"RUN_CRITICAL_MODELS_ONLY": str(env == "production").lower(),
172-
"DAY_AHEAD_MODEL": "false",
173169
"FILTER_BAD_FORECASTS": str(env == "production").lower(),
174170
},
175171
)
@@ -201,48 +197,6 @@ def gsp_forecast_pvnet_dag() -> None:
201197
latest_only_op >> forecast_gsps_op >> [blend_forecasts_op, check_forecasts_op]
202198

203199

204-
@dag(
205-
dag_id="uk-forecast-gsp-dayahead",
206-
description=__doc__,
207-
schedule="45 * * * *",
208-
start_date=dt.datetime(2025, 1, 1, tzinfo=dt.UTC),
209-
catchup=False,
210-
default_args=default_args,
211-
)
212-
def gsp_forecast_pvnet_dayahead_dag() -> None:
213-
"""DAG to forecast GSPs using PVNet."""
214-
latest_only_op = LatestOnlyOperator(task_id="latest_only")
215-
216-
forecast_pvnet_day_ahead_op = EcsAutoRegisterRunTaskOperator(
217-
airflow_task_id="forecast-dayahead-gsps",
218-
container_def=gsp_forecaster,
219-
max_active_tis_per_dag=10,
220-
on_failure_callback=slack_message_callback(
221-
f"❌🇬🇧 the {get_task_link()} failed. "
222-
"This would ideally be fixed for da actions at 09.00. "
223-
"Please see run book for appropriate actions.",
224-
),
225-
env_overrides={
226-
"DAY_AHEAD_MODEL": "true",
227-
"USE_OCF_DATA_SAMPLER": "true", # Note this setting is ignored by the dev image
228-
"FILTER_BAD_FORECASTS": str(env == "production").lower(),
229-
},
230-
)
231-
232-
blend_forecasts_op = EcsAutoRegisterRunTaskOperator(
233-
airflow_task_id="blend-forecasts",
234-
container_def=forecast_blender,
235-
max_active_tis_per_dag=10,
236-
on_failure_callback=slack_message_callback(
237-
f"❌🇬🇧 The {get_task_link()} failed. "
238-
"The blending of forecast has failed. "
239-
"Please see run book for appropriate actions. ",
240-
),
241-
)
242-
243-
latest_only_op >> forecast_pvnet_day_ahead_op >> blend_forecasts_op
244-
245-
246200
@dag(
247201
dag_id="uk-forecast-national",
248202
description=__doc__,
@@ -282,5 +236,4 @@ def national_forecast_dayahead_dag() -> None:
282236

283237

284238
gsp_forecast_pvnet_dag()
285-
gsp_forecast_pvnet_dayahead_dag()
286239
national_forecast_dayahead_dag()

tests/test_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_import_dags_without_errors(self) -> None:
1616
include_examples=False,
1717
dag_folder=str(files("airflow_dags").joinpath("dags")),
1818
)
19-
self.assertEqual(len(dag_bag.dags), 30)
19+
self.assertEqual(len(dag_bag.dags), 29)
2020
self.assertFalse(dag_bag.import_errors)
2121

2222
# Additional project-specific checks can be added here, e.g. to enforce each DAG has a tag

0 commit comments

Comments
 (0)