Skip to content

Add food production equivalents to carbon dashboard#1077

Open
stuckvgn wants to merge 1 commit intomlco2:masterfrom
stuckvgn:feat/food-production-equivalents
Open

Add food production equivalents to carbon dashboard#1077
stuckvgn wants to merge 1 commit intomlco2:masterfrom
stuckvgn:feat/food-production-equivalents

Conversation

@stuckvgn
Copy link

Summary

Adds a "Food Production Equivalents" section to the carbonboard visualization, showing users how their compute emissions compare to the CO2 emitted by producing food. Displays a beef vs. lentils comparison — a 30x difference in emissions per kg that makes the climate impact of food choices tangible.

What it looks like

Below the existing car miles / TV time / household equivalents:

Food Production Equivalents
Equivalent CO2 emitted by producing:

X kg of beef (27.0 kg CO2e/kg) vs. Y kg of lentils (0.9 kg CO2e/kg)

Changes

  • codecarbon/viz/data.py: Added get_food_production_equivalent(), get_beef_equivalent(), and get_lentils_equivalent() methods with emission factors from Poore & Nemecek (2018)
  • codecarbon/viz/components.py: Added Food Production Equivalents UI section to the dashboard
  • codecarbon/viz/carbonboard.py and carbonboard_on_api.py: Wired up the new callbacks for both dashboard variants

Data source

Emission factors (kg CO2e per kg of product, global mean, farm to retail) from:

Poore, J. & Nemecek, T. "Reducing food's environmental impacts through producers and consumers." Science 360(6392), pp. 987-992 (2018). doi:10.1126/science.aaq0216

This is the most comprehensive meta-analysis of food system environmental impacts, covering ~38,700 farms and ~1,600 processors across 119 countries.

Adds beef vs. lentils production comparison to the Exemplary
Equivalents section of the carbonboard visualization. Shows users
how their compute emissions compare to the CO2 emitted by producing
equivalent masses of high-impact (beef, 27.0 kg CO2e/kg) vs.
low-impact (lentils, 0.9 kg CO2e/kg) foods.

Emission factors from Poore & Nemecek (2018), Science 360(6392).

Changes:
- data.py: add get_food_production_equivalent(), get_beef_equivalent(),
  get_lentils_equivalent() methods
- components.py: add Food Production Equivalents UI section
- carbonboard.py, carbonboard_on_api.py: wire up new callbacks
@stuckvgn stuckvgn requested a review from a team as a code owner February 25, 2026 13:52
@benoit-cty
Copy link
Contributor

Hello thanks for your contribution.

@stuckvgn
Copy link
Author

Thanks! Let me know if anything needs adjusting — happy to iterate on the emission factor sources or dashboard layout.

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

Successfully merging this pull request may close these issues.

2 participants