GreenScheduler / cats

CATS: the Climate-Aware Task Scheduler :cat2: :tiger2: :leopard:
https://greenscheduler.github.io/cats/
MIT License
52 stars 9 forks source link

Multinational support: research electricity grid APIs for other countries #22

Open sadielbartholomew opened 1 year ago

sadielbartholomew commented 1 year ago

From a Twitter thread relating to cats, some folk were enquiring as to whether it works or could work for locations outside of the UK (see original quotes given below for the context, if useful). I agree that it would be nice to provide support for countries not in Britain, assuming of course we can find and use APIs for other national electricity system grids comparable to the National Grid ESO API we have made use of so far.

The first step would be to research whether there are other such APIs we could make use of. Then we can get a feel for how multi-national in scope cats could be. Alternatively, we could decide to limit our scope solely to the UK, to avoid the complications. What do people think? It would be especially useful to hear from those with more knowledge of electricity systems than I (I have very little!).

Either way, we should clarify the location scope of cats in the documentation. Since our README doesn't mention explicitly that it only works for places in GB, we should add some brief text to clarify that straight away (to be updated if we eventually wider our location scope in line with this Issue). (I'll do that shortly in a commit.)

Twitter thread background

(See also the link above for original source.)

Does it work outside the U.S. ? I mean because of the grid data it depends on ?

It uses the UK @NationalGridESO API, but presumably other countries have equivalent ones?

Sorry for assuming U.S. was the default 😉. Probably, there's something equivalent elsewhere, too. Would be cool to add some resources to the http://README.md

Yeah, people from other countries should definitely raise issues with info for their grid.

colinsauze commented 1 year ago

I've added some extra text to the README clarifying it is currently UK only and welcoming links to APIs from other countries.

colinsauze commented 1 year ago

One thought is that there is the EPEX Spot website which manages the electricity market for most of Western Europe. They let you get the wholesale price of electricity for the next 24 hours. Price is often a proxy for carbon intensity but doesn't match perfectly.

abhidg commented 1 year ago

https://transparency.entsoe.eu/dashboard/show also has breakdown by generation source for Europe, maybe that can be used to predict carbon intensity?

andreww commented 1 year ago

What about calculations that have two end-points. For example a data download from the EU?

colinsauze commented 1 year ago

We will need to accept location information in a different way to deal with other countries. Not everywhere has postcode. Perhaps we can take a longitude and latitude as well or a city name. We might need to look at geocoding APIs.

AnneHartebrodt commented 1 year ago

I am researching a similar topic. I think what you are looking for is called electricitymaps/CO2signal API (https://app.electricitymaps.com/map). They provide real time and forecasted CO2 intensity by country. The US has Watttime, but I am not sure if there is a community version.

Postcode is difficult though, because the EU report are only by bidding zone/grid tenant.

andreww commented 1 year ago

Thanks @AnneHartebrodt - that looks like the most useful source we've seen so far. From a quick look, it seems the forecast carbon intensity data we need is only provided via the paid (or 30 day free trial) API. Probably not the end of the world but we would need to enable users to configure their own API key as well as finding an alternative location descriptor. I think we are fairly well set up to enable multiple data sources to be configured so this would basically come down to adding a new data source.

AnneHartebrodt commented 1 year ago

Hi @andreww, I know, we are working on an API, which ideally should provide this for free and for a longer time horizon. We are training forecast models, but the data is sketchy and heterogeneous. In my personal opinion 24h is a bit short for bioinformatics applications and ML.

At the moment we can offer an API that gives you an optimal computation time given the percentage of wind and solar forecast in the next 24h/until 18h every day based on reporting data from the EU (same data as ElectricityMaps). The forecast is similar to what you do, but without the scheduling part.

Maybe we should get in touch so that we work on complimentary problems rather than the same thing.