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

For the default UK grid intensity API - 'very high' needs to be supported #9

Open
mrchrisadams opened this issue Jan 12, 2024 · 1 comment

Comments

@mrchrisadams
Copy link
Member

This library when querying the UK grid intensity API assumes the value can be low, medium or high.

This looks like an assumption we need to update, based on the figure here:

{
  "data": [
    {
      "from": "2024-01-12T12:00Z",
      "to": "2024-01-12T12:30Z",
      "intensity": {
        "forecast": 284,
        "actual": 279,
        "index": "very high"
      }
    }
  ]
}

Why did we not see this before? It might be that it hasn't been this cold in a while, or that we just didn't see it before on branch.

The code in question is at the link below.

https://github.com/thegreenwebfoundation/grid-intensity/blob/main/src/index.test.js#L108-L145

The quickest fix would be to 'cast' a very high result to high.

The longer term fix would probably be to include this functionality in CO2.js, because only querying the UK grid intensity API has plent of shortcomings if you are not in the UK.

@mrchrisadams
Copy link
Member Author

LOL, now later in the year on a day where it's been particularly windy and sunny in the uk, we've had 'very low' which we need to cast to 'low' for the purposes of any branch-y designs using this libary.

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

1 participant