Skip to content

v2.0.0: Documentation site, deprecation of (some) fetchers and more.

Latest
Compare
Choose a tag to compare
@Snailed Snailed released this 16 Sep 08:48
· 1 commit to master since this release

Features

📘 Documentation site is (almost) live!

We have set up a new documentation site on Github Pages using mkdocs and mkdocstrings. It will be available very soon.

🔧 Better type hints

Many of the classes and functions in Carbontracker now has type hinting for nicer IDE integration, automatic documentation and fewer type-related bugs. This has meant changing the return-types of some functions slightly, see ⚠️ Breaking Changes below.

🗺 Updated default intensity values and PUE

When Carbontracker cannot read intensity values from its API, it falls back to a national average value. These values were updated to the latest reports from Our World in Data. The PUE used for the computations were also updated using the latest global average from Uptime Institute.

⌨️ Added carbontracker --parse <log_dir> command

This command aggregates all logs in a folder for easier readability of ones total carbon emissions across multiple experiments.

⚠️ Breaking changes

❗️ Change of return types and parameters

As part of making better type hints, some internal functions were found to have inconsistent typing, where the decision was made to strengthen the parameter/return types.

  • The devices_by_pid parameter for components no longer accepts dictionaries
  • The power_usage function in handlers now always returns lists of floats

❗️ Change of monitor_epochs default value from 1 to -1

When using carbontracker.tracker.CarbonTracker, the default value of monitor_epochs meant that actual consumption would be printed after 1 epoch. This does not align with the most common use case of wanting the actual consumption after training has been completed.

❗ElectricityMaps is now the default fetcher for all regions.

This means that while EnergiDataService and CarbonIntensityGB still exists as modules, CarbonTracker and the CLI will now only use ElectricityMaps. In addition, a new warning will now appear whenever ElectricityMaps is missing an API key.

Minor internal changes and bug fixes

🐍 Set up testing across different Python versions

This runs both in our CI setup using Github Actions and locally using tox.
This also included fixing a few version-specific bugs on Python 3.7, 3.8, 3.11 and 3.12.

🐛 Log statements no longer go into overdrive on Jupyter Notebooks.

Originally posed as issue #70 (thanks @andreasgoethals !)
Before, for every new CarbonTracker object instantiated, new threads would be created. This is problematic in interactive computing environments like Jupyter Notebook where one might accidentally call tracker = CarbonTracker(...) many times. This was solved by fixing how Carbontracker identifies threads.

🪳 Fixed log parsing on logs generated by the CLI

Acknowledgements

This release was developed by @Snailed, @PedramBakh, @raghavian. A special thanks to @andreasgoethals and @jonathanwww for pinpointing bugs.