Add food production equivalents to carbon dashboard#1077
Open
stuckvgn wants to merge 1 commit intomlco2:masterfrom
Open
Add food production equivalents to carbon dashboard#1077stuckvgn wants to merge 1 commit intomlco2:masterfrom
stuckvgn wants to merge 1 commit intomlco2:masterfrom
Conversation
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
Contributor
|
Hello thanks for your contribution. |
Author
|
Thanks! Let me know if anything needs adjusting — happy to iterate on the emission factor sources or dashboard layout. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Changes
codecarbon/viz/data.py: Addedget_food_production_equivalent(),get_beef_equivalent(), andget_lentils_equivalent()methods with emission factors from Poore & Nemecek (2018)codecarbon/viz/components.py: Added Food Production Equivalents UI section to the dashboardcodecarbon/viz/carbonboard.pyandcarbonboard_on_api.py: Wired up the new callbacks for both dashboard variantsData source
Emission factors (kg CO2e per kg of product, global mean, farm to retail) from:
This is the most comprehensive meta-analysis of food system environmental impacts, covering ~38,700 farms and ~1,600 processors across 119 countries.