Skip to content

Dynamic WUE / PUE / carbon intensity data #947

Description

@SaboniAmine

Is your feature request related to a problem? Please describe.
Currently, data used to estimate the carbon impact ouf of electrical consumption is stored in the package, stored manually.
CPU references & their TDP values are often requested by users, and must be integrated in a manual way.
Data center carbon impact & global energy mix values are updated at most yearly when we get the data, with heterogeneous sources.

Describe the solution you'd like
A clear process to update data, which can be applied to the following paramters :

  • Datacenter PUE, when available
  • Location-based energy mix
  • Country-based energy mix
  • Datacenter WUE
  • Processors TDP
  • Other ?

It could be exposed to the user via multiple ways :

  • Make it available through the public API, and make the OnlineTracker query it periodically
  • Export a new version of the datasets at each release, for a full offline fallback
  • Other ?

Both ways would require an ingestion task, which could be automated quite easily.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Could help solving following issues: #894, #513, #503, #435, #403 (with a better support / doc of electricitymaps), #384, #365, #336, #222, #138

What could be interesting data sources ?

Activity

  1. cianc commented on Oct 27, 2025

    @cianc
    Contributor

    https://github.com/Green-Software-Foundation/real-time-cloud/blob/main/Cloud_Region_Metadata.csv is maintained by the Green Software Foundation and contains some of this information for Azure, AWS, and GCP (and I think they are working on Oracle): PUE, WUE, and carbon intensity.
    If we want more data than they currently provide, it may be worth talking to them first to see if they would be interested in adding it.

  2. fletchapin commented on Oct 28, 2025

    @fletchapin

    For the United States, the Energy Information Administration (EIA) compiles hourly average emission factors by balancing authority. I was having trouble finding them on the EIA Hourly Electric Grid Monitor (it looks like maybe they were discontinued in 2023), but the data is available from other sources, like GridStatus. I believe GridStatus has an API, so integrating with their data should be doable. The data also includes hourly energy mix and average emission factor by fuel type in case that's helpful.

    There are other sources of data for outside the United States that I am less familiar with, such as WattTime for marginal emissions factors and Electricity Maps for average emission factors.

  3. brendamougang23-cell commented on Mar 26, 2026

    @brendamougang23-cell

    this projet is very good

  4. added a commit that references this issue on Jun 22, 2026
    1f8fda1
  5. sufirehman commented on Jun 22, 2026

    @sufirehman

    Hi, I'd like to contribute a data source for this. I've built a live UK National Grid ESO Carbon Intensity API integration (national_grid_eso_api.py), following the same pattern as the existing electricitymaps_api.py. It calls the free, public National Grid ESO API (api.carbonintensity.org.uk), preferring the actual measured intensity and falling back to forecast when actual isn't available yet for the current half-hour.

    This replaces the current static 2023 annual average for GBR (237.589 gCO2/kWh in global_energy_mix.json) with live, half-hourly data when available, while falling back gracefully to the existing behavior if the API is unreachable or the location isn't GB.

    I've wired it into the get_private_infra_emissions fallback chain in emissions.py, positioned after Electricity Maps (which is preferred when a token is configured, since it covers GB too) and before the static country average fallback. Included full unit tests (mocked, following the existing responses-based pattern) plus a skipped integration test for the live API, and verified it against the real live endpoint locally.

    Happy to open a PR if this approach looks right to you, or adjust based on any feedback first.

  6. added a commit that references this issue on Jun 23, 2026
    b4a7324
  7. guillermollopis commented on Oct 30, 2026

    @guillermollopis

    On the question of where to get this data: I publish an open dataset, SOMA AI Emission Factors, under CC BY 4.0 (concept DOI 10.5281/zenodo.20443585). Its cloud_regions.csv maps 143 AWS, Azure and Google Cloud regions to a country grid or US eGRID subregion, each with a confidence flag and a source link.

    impact.csv currently has 40 rows, all Google Cloud. Two things could help, both optional. 39 of those 40 rows have a matching region id, so differences would be easy to list as a cross-check. The AWS and Azure mappings could also be a starting point for rows that do not exist yet.

    The grid values are Ember 2023 lifecycle intensities, so they would need converting or labelling if CodeCarbon uses another basis. This is separate from the country refresh in #1468, and I am not suggesting replacing that.

    I am the author and can send a PR or just a comparison table, whichever you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions