lfwa / carbontracker

Track and predict the energy consumption and carbon footprint of training deep learning models.
MIT License
352 stars 26 forks source link

Update default carbon intensity values to be country specific #49

Closed lfwa closed 1 year ago

lfwa commented 1 year ago

This PR includes the following changes:

  1. Updated default/fallback value for when live carbon intensity cannot be fetched. We now use the latest average for the specific country detected using data from https://ourworldindata.org/grapher/carbon-intensity-electricity.
  2. If above fails, default to world wide average carbon intensity for 2019 of 475 gCO2eq/kWh instead.
  3. Include script to generate small csv file used in 1. from larger csv file from https://ourworldindata.org/grapher/carbon-intensity-electricity.
  4. Update .gitignore with GitHub's Python template (+ VS code and macOS specifics)

The update requires thepkg_resources import, which should be available through setuptools but it might not be available in Python <3.7. Might want to consider dropping support for Python 3.6 (see also https://github.com/lfwa/carbontracker/issues/48).

Testing is recommended.