-
Notifications
You must be signed in to change notification settings - Fork 174
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
Is it right that the Carbon Intensity of Solar, Wind, ... is ignored in your calculations? #673
Comments
Hello, The function you mention is only used in the case of an error DataSourceException, which is not supposed to happen anymore. Our data came from our_world_in_data and you can see them in the file https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/global_energy_mix.json We could also use ElectricityMaps to get the energy mix in realtime. Let us know when your paper is out ! |
Is there a way for me to do something like I tried this code, but it didn't work:
My paper will be in german btw |
Hello, from codecarbon.input import DataSource
DataSource().get_global_energy_mix_data()["DEU"] {
"biofuel_TWh": 46.02,
"carbon_intensity": 380.95,
"coal_TWh": 135.35,
"country_name": "Germany",
"fossil_TWh": 231.48,
"gas_TWh": 76,
"hydroelectricity_TWh": 19.48,
"iso_code": "DEU",
"low_carbon_TWh": 273.31,
"nuclear_TWh": 8.75,
"oil_TWh": 20.13,
"other_renewable_TWh": 46.23,
"other_renewable_exc_biofuel_TWh": 0.21,
"per_capita_Wh": 6060.295,
"renewables_TWh": 264.56,
"solar_TWh": 61.56,
"total_TWh": 504.78999999999996,
"wind_TWh": 137.29,
"year": 2023
} If you what to use realtime data, look at CO2 Signal in CodeCarbon as it was the previous name of ElectricityMaps API. Even if it's in German it's always nice to see where and why CodeCarbon is used. |
Okay thank you, this helped me. But I still have a problem: this is the total energy consumption of one of my AI training runs: 5.4478812927977245kWh if I use the 380.95 carbon intensity, I get: 5.4478812927977245 * 380.95 = 2.07537037849129315kg so its a bit less. And where do these 380.95 come from? oil 20.13 -> 3.9878% of total Energy solar 61.56 -> 12.1952% CO2eq = 0.268131 * 995 + 0.039878 * 816 + 0.150558 * 743 + 0.03859 * 26 + 0.017334 * 29 + 0.121952 * 48 + 0.271974 * 26 = 425.626433 But even with this value, I get 5.4478812927977245 * 425.626433 = 2.318766kg CO2 If I calculate it backwards, the CO2eq should be: 5,4478812927977245 * CO2eq = 2,0995535235500222 ==> CO2eq = 385.3889 So is it an older energy mix used for that caluclation? Which would it be then, and how can I get the mix (like 10% Coal, 12% Solar, ...)? UPDATE: If I run your code, I get:
and 385.389 should actually be correct for the calculation. But I still don't know how 385.389 is calculated with this energy mix |
|
So, the computation formular on the mentioned website is nowhere used in your code? |
Yes, it was computed before, but now we read directly the |
okay thanks |
Wait, when I look at the Website OurWorldinData, it says:
so for the newest version, after mine (2.5.0), it should be correct using 380.95 for 2023. But my version said
for 2022, as you mentioned too. So it's different from what the website says currently. Or did the values of 2022 change this year on their site? |
Description
I am about to write a paper about sustainability of AI for my university. Therefore I wanted to know what Electricity mix (Percentages of Coal, Petroleum, Natural Gas, Solar, ...) your code is guessing and how it gets the values/where are the guessed values from?
Where can I get more current information about the german energy mix/Where did you get it from?
What I Did
I saw in
/codecarbon/core/emissions.py
that there is a function called_region_energy_mix_to_emissions_rate
which only uses coal, petroleum and natural gas. But on your website CodeCarbon there is also mentioned emissions for Solar, Wind, ...The text was updated successfully, but these errors were encountered: