Missing factor keys for waste and biomass in carbon_intensity_per_source.json
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 323
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 12
Description
The Finnish and Danish bidding zones carry 11–32 % of their generation at factor zero when computed on carbon_intensity_per_source.json, because the table has no key for Waste or Biomass. The direction of the error is known: both types emit at the stack. Its size is not something the table can express.
The numbers. From ENTSO-E A75 for 2025 on your own factor table, unfactored types carried in the denominator at zero:
| Zone | Waste % | Biomass % | Coverage | CI on your table (our computation) |
|---|---|---|---|---|
| FI | 0.47 | 10.68 | 86.30 % | 47.8 |
| DK1 | 2.81 | 9.37 | 87.77 % | 89.6 |
| DK2 | 9.55 | 22.80 | 67.65 % | 117.9 |
| NO1–NO5 | 0.00–0.42 | 0.00 | 98.65–99.89 % | 25.8–51.7 |
The Norwegian and Swedish values you ship are barely affected; their coverage fields say so. Finland is affected materially — the one zone where biomass exceeds a tenth of generation.
How the code handles the absence today. In _global_energy_mix_to_emissions_rate (codecarbon/core/emissions.py:353-356) the field name is stripped of _TWh and looked up in the factor table, so biofuel_TWh resolves to biofuel, finds nothing, and is skipped from both the numerator and energy_sum_computed. Most countries never reach that path, since 212 of 213 entries in global_energy_mix.json carry carbon_intensity directly, but it is the path that defines what a missing key means. The nordic_emissions.json path handles the same absence differently: the type stays in the denominator at zero. Neither is a factor, and they do not agree.
What other products do. Electricity Maps carries a biomass key (0 direct, 230 lifecycle) but no waste key. Energinet publishes a Danish waste factor, 329.87 gCO2/kWh under its 125 % CHP allocation. Separately, Eurostat puts Danish waste generation at roughly 58 % non-renewable by energy (2023). Eurostat and Statistics Finland both split waste into renewable and non-renewable as separate codes. ENTSO-E does not.
That split is why we are asking rather than proposing: a single Waste number is not well defined without the fraction, and the fraction moves by country and year — 48.0 % non-renewable for Norway in 2023, 45.1 % Finland, 58.0 % Denmark.
The question: would you want keys for these two types at all, and if so, one value per type, or a scheme pricing only the non-renewable fraction of waste? We have not proposed values, and would rather hear the preferred shape first. Happy to bring the per-zone measurements if useful.
Disclosure: drafted with Anthropic Claude models (Opus 5 via Claude Code, Fable 5.1 in chat) under my direction. The measurements were computed with those tools from ENTSO-E and Eurostat primary data and checked by me; I am responsible for them and can walk through every number.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with codecarbon/core/emissions.py:353-356 and compare its missing-key behavior with the nordic_emissions.json path. Review carbon_intensity_per_source.json, global_energy_mix.json, and the cited ENTSO-E and Eurostat measurements. Done requires an agreed representation for Waste and Biomass, approved factor inputs, and consistent handling across both calculation paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100