/wind-curtailment

Primary LanguageJupyter Notebook

UK Wind Curtailment Monitor

Exploring the wind power that the UK is discarding due to transmission constraints

https://wind-curtailment-app-ahq7fucdyq-lz.a.run.app/

Methodology

By pulling data from Elexon, we combine FPNs, BOALS, and BOD to see the effects of wind curtilament

More details are here

Data

We use the Elexon API to get data. See scripts/fetch_data.py. This is saved to an SQLite DB. Note that raw data is also saved as feather files to ./data/PHYBM/raw.

Analysis

Run scripts/calculate_curtailment.py to run the analysis against the SQLite DB.

Notebooks

There's some old analysis in scripts and notebooks/curtailment.ipynb, mostly useful for identifying the right day to focus on.

Prototype is in notebooks/bidoffer.ipynb.

Might need to run export PYTHONPATH=${PYTHONPATH}:/lib to get the lib in to your python path

App

simple streamlit app can be run using streamlit run main.py

image

ETL

Fast API app that can be called to fetch data from Elexon and save to a database.

Deployment

App is deployed via GH Actions to GCP Cloud Run.

In the Github workflow

  • env/.env.prod file is made (DB_PASSWORD is saved in Secrets > Actions in Github)
  • the Docker image is built,
  • pushed to container registry,
  • a new cloud run revision is initialized against the updated image.
  • This is done for both the app and the etl

Depends upon a single deploy secret (GLOUD_AUTH) which is in Secrets > Actions in Github, and is a base64 encoded version of the default service account credentials in GCP.

FAQs

TODO