Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day-ahead and other forecast functions in CLI #13

Open
mrchrisadams opened this issue Jun 8, 2022 · 3 comments
Open

Day-ahead and other forecast functions in CLI #13

mrchrisadams opened this issue Jun 8, 2022 · 3 comments

Comments

@mrchrisadams
Copy link
Member

mrchrisadams commented Jun 8, 2022

I'm putting @mrchrisadams's original work here, so we don't lose it, as it has some really cool ideas in it, that some API providers support but some don't.

Call the grid-intensity binary to get an idea of the current carbon intensity of electricity, on the machine you're calling it on.

You'll receive an estimated figure for your location.

$ grid-intensity # get data back as formatted JSON

### estimated carbon intensity for compute will be low on this machine for next 30 mins, until HH-MM:00

You can also use this to get an idea of the expected intensity of the next 24 hours. This allows your job scheduler to account for this in allocating jobs your cluster(s).

$ grid-intensity 

### estimated carbon intensity for compute will be low on this machine for next 24 hours, but peak between 7 and 10pm today

Append --json for a machine readable version of the same data, consumable by other services in your cluster.

@mrchrisadams mrchrisadams changed the title Future CLI forecast functions Day-ahead and other forecast functions in CLI Jun 8, 2022
@ofpiyush
Copy link
Collaborator

ofpiyush commented Jun 9, 2022

Oii it was you!
fbc0059

Spiderman

I removed it from the readme and copy pasted it into an issue because we hadn't implemented it at the time 😄

@mrchrisadams
Copy link
Member Author

hahah! Oops, I totally forgot about that. thank for clearing that up. Also, top quality good meme-age 👍

@rossf7
Copy link
Contributor

rossf7 commented Sep 21, 2023

Hey @mrchrisadams like I mentioned in DM I'd like to have a go at this.

I think we could implement getting the 24h ahead forecast for all existing providers except Ember.

For the CLI the 2 best options I can see are

  • A - Add a forecast flag to the root command e.g. grid-intensity --provider WattTime --location ES --forecast
  • B - Add a new forecast command e.g. grid-intensity forecast --provider WattTime --location ES

My preference would be option A as I think its simpler. What do you both think?

For the Go library I'd propose adding this method to the interface.

GetForecast(ctx context.Context, location string) ([]CarbonIntensity, error)

The exporter is tricky as I can't see a good way of exposing the forecast as prometheus metrics. So I'd propose leaving this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants