diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12fddaf3..2517ab91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,33 +4,34 @@ -- [ Have a Question?](#have-a-question) -- [ Found a Bug?](#found-a-bug) -- [ Have a Feature Request?](#have-a-feature-request) -- [ Ready to Contribute!](#ready-to-contribute) - * [ Create an issue](#create-an-issue) - * [Installation](#installation) - * [Some Hatch commands](#some-hatch-commands) - * [Tests](#tests) - * [Stress your computer](#stress-your-computer) - * [Update all dependancies](#update-all-dependancies) - * [Branching and Pull Requests](#branching-and-pull-requests) - * [Debug in VS Code](#debug-in-vs-code) - * [ Local deployment](#local-deployment) -- [CSV Dashboard](#csv-dashboard) -- [API Dashboard](#api-dashboard) - * [API](#api) - * [Test the API](#test-the-api) - * [Coding style && Linting](#coding-style-linting) - * [Dependencies management](#dependencies-management) - * [Alternative ways of contributing](#alternative-ways-of-contributing) - * [Build Documentation πŸ–¨οΈ](#build-documentation-) - * [Release process](#release-process) - + [Restore database from a production Backup](#restore-database-from-a-production-backup) - + [Deployment](#deployment) - - [API](#api-1) - - [Dashboard](#dashboard) - * [License](#license) +- [Contributing to Code Carbon](#contributing-to-code-carbon) + - [ Have a Question?](#-have-a-question) + - [ Found a Bug?](#-found-a-bug) + - [ Have a Feature Request?](#-have-a-feature-request) + - [ Ready to Contribute!](#-ready-to-contribute) + - [ Create an issue](#-create-an-issue) + - [Installation](#installation) + - [Some Hatch commands](#some-hatch-commands) + - [Tests](#tests) + - [Stress your computer](#stress-your-computer) + - [Update all dependancies](#update-all-dependancies) + - [Branching and Pull Requests](#branching-and-pull-requests) + - [Debug in VS Code](#debug-in-vs-code) + - [ Local deployment](#-local-deployment) + - [CSV Dashboard](#csv-dashboard) + - [API Dashboard](#api-dashboard) + - [API](#api) + - [Test the API](#test-the-api) + - [Coding style \&\& Linting](#coding-style--linting) + - [Dependencies management](#dependencies-management) + - [Alternative ways of contributing](#alternative-ways-of-contributing) + - [Build Documentation πŸ–¨οΈ](#build-documentation-️) + - [Release process](#release-process) + - [Restore database from a production Backup](#restore-database-from-a-production-backup) + - [Deployment](#deployment) + - [API](#api-1) + - [Dashboard](#dashboard) + - [License](#license) @@ -106,10 +107,10 @@ View the options of CodeCarbon environments: β”‚ β”‚ β”‚ β”‚ sphinx-rtd-theme β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ dev β”‚ pip-compile β”‚ β”‚ black β”‚ format β”‚ -β”‚ β”‚ β”‚ β”‚ mypy β”‚ lint β”‚ -β”‚ β”‚ β”‚ β”‚ pre-commit β”‚ mypy-check β”‚ -β”‚ β”‚ β”‚ β”‚ ruff β”‚ precommit β”‚ -β”‚ β”‚ β”‚ β”‚ β”‚ precommit-install β”‚ +β”‚ β”‚ β”‚ β”‚ bumpver β”‚ lint β”‚ +β”‚ β”‚ β”‚ β”‚ mypy β”‚ mypy-check β”‚ +β”‚ β”‚ β”‚ β”‚ pre-commit β”‚ precommit β”‚ +β”‚ β”‚ β”‚ β”‚ ruff β”‚ precommit-install β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ precommit-update β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ dashboard β”‚ pip-compile β”‚ β”‚ dash-bootstrap-components β”‚ run β”‚ @@ -117,16 +118,18 @@ View the options of CodeCarbon environments: β”‚ β”‚ β”‚ β”‚ plotly>=5.6.0 β”‚ β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ api β”‚ pip-compile β”‚ β”‚ alembic<2.0.0 β”‚ docker β”‚ -β”‚ β”‚ β”‚ β”‚ bcrypt<5.0.0 β”‚ local β”‚ -β”‚ β”‚ β”‚ β”‚ dependency-injector<5.0.0 β”‚ server-ci β”‚ -β”‚ β”‚ β”‚ β”‚ fastapi-pagination<1.0.0 β”‚ setup-db β”‚ -β”‚ β”‚ β”‚ β”‚ fastapi<1.0.0 β”‚ test-integ β”‚ +β”‚ β”‚ β”‚ β”‚ bcrypt<5.0.0 β”‚ downgrade-db β”‚ +β”‚ β”‚ β”‚ β”‚ dependency-injector<5.0.0 β”‚ local β”‚ +β”‚ β”‚ β”‚ β”‚ fastapi-pagination<1.0.0 β”‚ server-ci β”‚ +β”‚ β”‚ β”‚ β”‚ fastapi<1.0.0 β”‚ setup-db β”‚ +β”‚ β”‚ β”‚ β”‚ fief-client[fastapi] β”‚ test-integ β”‚ β”‚ β”‚ β”‚ β”‚ httpx β”‚ test-unit β”‚ β”‚ β”‚ β”‚ β”‚ mock β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ numpy β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ psutil β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ psycopg2-binary<3.0.0 β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ pydantic[email]<2.0.0 β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ pyjwt β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ pytest β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ python-dateutil<3.0.0 β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ rapidfuzz β”‚ β”‚ @@ -136,18 +139,20 @@ View the options of CodeCarbon environments: β”‚ β”‚ β”‚ β”‚ sqlalchemy<2.0.0 β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ uvicorn[standard]<1.0.0 β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ - Matrices -┏━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ -┃ Name ┃ Type ┃ Envs ┃ Features ┃ Dependencies ┃ Scripts ┃ -┑━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ -β”‚ test β”‚ pip-compile β”‚ test.py3.8 β”‚ viz β”‚ mock β”‚ package β”‚ -β”‚ β”‚ β”‚ test.py3.9 β”‚ β”‚ numpy β”‚ package-integ β”‚ -β”‚ β”‚ β”‚ test.py3.10 β”‚ β”‚ psutil β”‚ β”‚ -β”‚ β”‚ β”‚ test.py3.11 β”‚ β”‚ pytest β”‚ β”‚ -β”‚ β”‚ β”‚ test.py3.12 β”‚ β”‚ rapidfuzz β”‚ β”‚ -β”‚ β”‚ β”‚ β”‚ β”‚ requests-mock β”‚ β”‚ -β”‚ β”‚ β”‚ β”‚ β”‚ responses β”‚ β”‚ -β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ + Matrices +┏━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓ +┃ Name ┃ Type ┃ Envs ┃ Features ┃ Dependencies ┃ Scripts ┃ +┑━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩ +β”‚ test β”‚ pip-compile β”‚ test.py3.8 β”‚ viz β”‚ importlib-resources; python_version < '3.9' β”‚ package β”‚ +β”‚ β”‚ β”‚ test.py3.9 β”‚ β”‚ mock β”‚ package-integ β”‚ +β”‚ β”‚ β”‚ test.py3.10 β”‚ β”‚ numpy; python_version >= '3.9' β”‚ β”‚ +β”‚ β”‚ β”‚ test.py3.11 β”‚ β”‚ numpy<2.0.0; python_version < '3.9' β”‚ β”‚ +β”‚ β”‚ β”‚ test.py3.12 β”‚ β”‚ psutil β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ β”‚ pytest β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ β”‚ rapidfuzz β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ β”‚ requests-mock β”‚ β”‚ +β”‚ β”‚ β”‚ β”‚ β”‚ responses β”‚ β”‚ +β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` To know the path of a env : diff --git a/codecarbon/_version.py b/codecarbon/_version.py index 2614ce9d..7a38ae06 100644 --- a/codecarbon/_version.py +++ b/codecarbon/_version.py @@ -1 +1 @@ -__version__ = "2.7.0" +__version__ = "2.7.1" diff --git a/codecarbon/emissions_tracker.py b/codecarbon/emissions_tracker.py index 6a6af7d2..62f8cc9d 100644 --- a/codecarbon/emissions_tracker.py +++ b/codecarbon/emissions_tracker.py @@ -507,7 +507,7 @@ def _init_output_methods(self, api_key): self._output_handlers.append(LogfireOutput()) def service_shutdown(self, signum, frame): - print("Caught signal %d" % signum) + logger.warning("service_shutdown - Caught signal %d" % signum) self.stop() @suppress(Exception) diff --git a/codecarbon/input.py b/codecarbon/input.py index 9f9197fd..efcecf66 100644 --- a/codecarbon/input.py +++ b/codecarbon/input.py @@ -40,7 +40,6 @@ def get_ressource_path(package: str, filepath: str): file_manager = ExitStack() atexit.register(file_manager.close) ref = importlib_resources_files(package).joinpath(filepath) - print("ref:", ref) path = file_manager.enter_context(importlib_resources_as_file(ref)) return path diff --git a/docs/.buildinfo b/docs/.buildinfo index c53223f7..1da2e731 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 55a78136b12ee4b880cbead1cbeeb85c +config: 55fdda7a695bdf5582bdb6db957b2ebf tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/_static/basic.css b/docs/_static/basic.css index f316efcb..cfc60b86 100644 --- a/docs/_static/basic.css +++ b/docs/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -237,10 +237,6 @@ a.headerlink { visibility: hidden; } -a:visited { - color: #551A8B; -} - h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js index 4d67807d..d06a71d7 100644 --- a/docs/_static/doctools.js +++ b/docs/_static/doctools.js @@ -4,7 +4,7 @@ * * Base JavaScript utilities for all Sphinx HTML documentation. * - * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js index 53a4abc6..986d7ba1 100644 --- a/docs/_static/documentation_options.js +++ b/docs/_static/documentation_options.js @@ -1,5 +1,6 @@ -const DOCUMENTATION_OPTIONS = { - VERSION: '2.7.0', +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '2.7.1', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js index 367b8ed8..250f5665 100644 --- a/docs/_static/language_data.js +++ b/docs/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,7 +13,7 @@ var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; -/* Non-minified version is copied as a separate JS file, if available */ +/* Non-minified version is copied as a separate JS file, is available */ /** * Porter Stemmer diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js index b08d58c9..97d56a74 100644 --- a/docs/_static/searchtools.js +++ b/docs/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -57,12 +57,12 @@ const _removeChildren = (element) => { const _escapeRegExp = (string) => string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string -const _displayItem = (item, searchTerms, highlightTerms) => { +const _displayItem = (item, searchTerms) => { const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT; const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; - const contentRoot = document.documentElement.dataset.content_root; const [docName, title, anchor, descr, score, _filename] = item; @@ -75,35 +75,28 @@ const _displayItem = (item, searchTerms, highlightTerms) => { if (dirname.match(/\/index\/$/)) dirname = dirname.substring(0, dirname.length - 6); else if (dirname === "index/") dirname = ""; - requestUrl = contentRoot + dirname; + requestUrl = docUrlRoot + dirname; linkUrl = requestUrl; } else { // normal html builders - requestUrl = contentRoot + docName + docFileSuffix; + requestUrl = docUrlRoot + docName + docFileSuffix; linkUrl = docName + docLinkSuffix; } let linkEl = listItem.appendChild(document.createElement("a")); linkEl.href = linkUrl + anchor; linkEl.dataset.score = score; linkEl.innerHTML = title; - if (descr) { + if (descr) listItem.appendChild(document.createElement("span")).innerHTML = " (" + descr + ")"; - // highlight search terms in the description - if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js - highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); - } else if (showSearchSummary) fetch(requestUrl) .then((responseData) => responseData.text()) .then((data) => { if (data) listItem.appendChild( - Search.makeSearchSummary(data, searchTerms, anchor) + Search.makeSearchSummary(data, searchTerms) ); - // highlight search terms in the summary - if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js - highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); }); Search.output.appendChild(listItem); }; @@ -116,43 +109,26 @@ const _finishSearch = (resultCount) => { ); else Search.status.innerText = _( - "Search finished, found ${resultCount} page(s) matching the search query." - ).replace('${resultCount}', resultCount); + `Search finished, found ${resultCount} page(s) matching the search query.` + ); }; const _displayNextItem = ( results, resultCount, - searchTerms, - highlightTerms, + searchTerms ) => { // results left, load the summary and display it // this is intended to be dynamic (don't sub resultsCount) if (results.length) { - _displayItem(results.pop(), searchTerms, highlightTerms); + _displayItem(results.pop(), searchTerms); setTimeout( - () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + () => _displayNextItem(results, resultCount, searchTerms), 5 ); } // search finished, update title and status message else _finishSearch(resultCount); }; -// Helper function used by query() to order search results. -// Each input is an array of [docname, title, anchor, descr, score, filename]. -// Order the results by score (in opposite order of appearance, since the -// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. -const _orderResultsByScoreThenName = (a, b) => { - const leftScore = a[4]; - const rightScore = b[4]; - if (leftScore === rightScore) { - // same score: sort alphabetically - const leftTitle = a[1].toLowerCase(); - const rightTitle = b[1].toLowerCase(); - if (leftTitle === rightTitle) return 0; - return leftTitle > rightTitle ? -1 : 1; // inverted is intentional - } - return leftScore > rightScore ? 1 : -1; -}; /** * Default splitQuery function. Can be overridden in ``sphinx.search`` with a @@ -176,26 +152,13 @@ const Search = { _queued_query: null, _pulse_status: -1, - htmlToText: (htmlString, anchor) => { + htmlToText: (htmlString) => { const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); - for (const removalQuery of [".headerlink", "script", "style"]) { - htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); - } - if (anchor) { - const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); - if (anchorContent) return anchorContent.textContent; - - console.warn( - `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` - ); - } - - // if anchor not specified or not found, fall back to main content + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); const docContent = htmlElement.querySelector('[role="main"]'); - if (docContent) return docContent.textContent; - + if (docContent !== undefined) return docContent.textContent; console.warn( - "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." + "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." ); return ""; }, @@ -268,7 +231,16 @@ const Search = { else Search.deferQuery(query); }, - _parseQuery: (query) => { + /** + * execute search (requires search index to be loaded) + */ + query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + // stem the search terms and add them to the correct list const stemmer = new Stemmer(); const searchTerms = new Set(); @@ -304,38 +276,21 @@ const Search = { // console.info("required: ", [...searchTerms]); // console.info("excluded: ", [...excludedTerms]); - return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; - }, - - /** - * execute search (requires search index to be loaded) - */ - _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { - const filenames = Search._index.filenames; - const docNames = Search._index.docnames; - const titles = Search._index.titles; - const allTitles = Search._index.alltitles; - const indexEntries = Search._index.indexentries; - - // Collect multiple result groups to be sorted separately and then ordered. - // Each is an array of [docname, title, anchor, descr, score, filename]. - const normalResults = []; - const nonMainIndexResults = []; - + // array of [docname, title, anchor, descr, score, filename] + let results = []; _removeChildren(document.getElementById("search-progress")); - const queryLower = query.toLowerCase().trim(); + const queryLower = query.toLowerCase(); for (const [title, foundTitles] of Object.entries(allTitles)) { - if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { for (const [file, id] of foundTitles) { - const score = Math.round(Scorer.title * queryLower.length / title.length); - const boost = titles[file] === title ? 1 : 0; // add a boost for document titles - normalResults.push([ + let score = Math.round(100 * queryLower.length / title.length) + results.push([ docNames[file], titles[file] !== title ? `${titles[file]} > ${title}` : title, id !== null ? "#" + id : "", null, - score + boost, + score, filenames[file], ]); } @@ -345,47 +300,46 @@ const Search = { // search for explicit entries in index directives for (const [entry, foundEntries] of Object.entries(indexEntries)) { if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { - for (const [file, id, isMain] of foundEntries) { - const score = Math.round(100 * queryLower.length / entry.length); - const result = [ + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ docNames[file], titles[file], id ? "#" + id : "", null, score, filenames[file], - ]; - if (isMain) { - normalResults.push(result); - } else { - nonMainIndexResults.push(result); - } + ]); } } } // lookup as object objectTerms.forEach((term) => - normalResults.push(...Search.performObjectSearch(term, objectTerms)) + results.push(...Search.performObjectSearch(term, objectTerms)) ); // lookup as search terms in fulltext - normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); // let the scorer override scores with a custom scoring function - if (Scorer.score) { - normalResults.forEach((item) => (item[4] = Scorer.score(item))); - nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); - } - - // Sort each group of results by score and then alphabetically by name. - normalResults.sort(_orderResultsByScoreThenName); - nonMainIndexResults.sort(_orderResultsByScoreThenName); - - // Combine the result groups in (reverse) order. - // Non-main index entries are typically arbitrary cross-references, - // so display them after other results. - let results = [...nonMainIndexResults, ...normalResults]; + if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort((a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; + }); // remove duplicate search results // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept @@ -399,19 +353,14 @@ const Search = { return acc; }, []); - return results.reverse(); - }, - - query: (query) => { - const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); - const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); + results = results.reverse(); // for debugging //Search.lastresults = results.slice(); // a copy // console.info("search results:", Search.lastresults); // print the results - _displayNextItem(results, results.length, searchTerms, highlightTerms); + _displayNextItem(results, results.length, searchTerms); }, /** @@ -509,18 +458,14 @@ const Search = { // add support for partial matches if (word.length > 2) { const escapedWord = _escapeRegExp(word); - if (!terms.hasOwnProperty(word)) { - Object.keys(terms).forEach((term) => { - if (term.match(escapedWord)) - arr.push({ files: terms[term], score: Scorer.partialTerm }); - }); - } - if (!titleTerms.hasOwnProperty(word)) { - Object.keys(titleTerms).forEach((term) => { - if (term.match(escapedWord)) - arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); - }); - } + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord) && !terms[word]) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord) && !titleTerms[word]) + arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); + }); } // no match but word was a required one @@ -543,8 +488,9 @@ const Search = { // create the mapping files.forEach((file) => { - if (!fileMap.has(file)) fileMap.set(file, [word]); - else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); + if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + else fileMap.set(file, [word]); }); }); @@ -595,8 +541,8 @@ const Search = { * search summary for a given text. keywords is a list * of stemmed words. */ - makeSearchSummary: (htmlText, keywords, anchor) => { - const text = Search.htmlToText(htmlText, anchor); + makeSearchSummary: (htmlText, keywords) => { + const text = Search.htmlToText(htmlText); if (text === "") return null; const textLower = text.toLowerCase(); diff --git a/docs/_static/sphinx_highlight.js b/docs/_static/sphinx_highlight.js index 8a96c69a..aae669d7 100644 --- a/docs/_static/sphinx_highlight.js +++ b/docs/_static/sphinx_highlight.js @@ -29,19 +29,14 @@ const _highlight = (node, addItems, text, className) => { } span.appendChild(document.createTextNode(val.substr(pos, text.length))); - const rest = document.createTextNode(val.substr(pos + text.length)); parent.insertBefore( span, parent.insertBefore( - rest, + document.createTextNode(val.substr(pos + text.length)), node.nextSibling ) ); node.nodeValue = val.substr(0, pos); - /* There may be more occurrences of search term in this node. So call this - * function recursively on the remaining fragment. - */ - _highlight(rest, addItems, text, className); if (isInSVG) { const rect = document.createElementNS( @@ -145,10 +140,5 @@ const SphinxHighlight = { }, }; -_ready(() => { - /* Do not call highlightSearchWords() when we are on the search page. - * It will highlight words from the *previous* search query. - */ - if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); - SphinxHighlight.initEscapeListener(); -}); +_ready(SphinxHighlight.highlightSearchWords); +_ready(SphinxHighlight.initEscapeListener); diff --git a/docs/api.html b/docs/api.html index 9cf978c4..b47e0847 100644 --- a/docs/api.html +++ b/docs/api.html @@ -1,10 +1,10 @@ - + - CodeCarbon API — CodeCarbon 2.7.0 documentation + CodeCarbon API — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -96,9 +96,9 @@
-

CodeCarbon API

+

CodeCarbon API

-

CodeCarbon API

+

CodeCarbon API

Warning

This mode use the CodeCarbon API to upload the timeseries of your emissions on a central server. All data will be public!

diff --git a/docs/comet.html b/docs/comet.html index 187798fe..5410c4c6 100644 --- a/docs/comet.html +++ b/docs/comet.html @@ -1,10 +1,10 @@ - + - Comet Integration — CodeCarbon 2.7.0 documentation + Comet Integration — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -93,7 +93,7 @@
-

Comet Integration

+

Comet Integration

CodeCarbon can be automatically integrated with Comet for experiment tracking and visualization. Comet provides data scientists with powerful tools to track, compare, explain, and reproduce their experiments. Now, with CodeCarbon you can easily track the carbon footprint of your jobs along with your training metrics, hyperparameters, dataset samples, artifacts, and more.

Summary

To get started with the Comet-CodeCarbon integration, make sure you have comet-ml installed:

diff --git a/docs/edit/conf.py b/docs/edit/conf.py index 86db6873..e8d469b2 100644 --- a/docs/edit/conf.py +++ b/docs/edit/conf.py @@ -23,7 +23,7 @@ author = "BCG GAMMA, Comet.ml, Haverford College, MILA, Data For Good" # The full version, including alpha/beta/rc tags -release = "2.7.0" +release = "2.7.1" # -- General configuration --------------------------------------------------- diff --git a/docs/examples.html b/docs/examples.html index 14e1b8c8..4de12d50 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -1,10 +1,10 @@ - + - Examples — CodeCarbon 2.7.0 documentation + Examples — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -98,10 +98,10 @@
-

Examples

+

Examples

Following are examples to train a Deep Learning model on MNIST Data to recognize digits in images using TensorFlow.

-

Using the Explicit Object

+

Using the Explicit Object

import tensorflow as tf
 
 from codecarbon import EmissionsTracker
@@ -134,7 +134,7 @@ 

Using the Explicit Object -

Using the Context Manager

+

Using the Context Manager

import tensorflow as tf
 
 from codecarbon import EmissionsTracker
@@ -163,7 +163,7 @@ 

Using the Context Manager -

Using the Decorator

+

Using the Decorator

import tensorflow as tf
 
 from codecarbon import track_emissions
diff --git a/docs/faq.html b/docs/faq.html
index ef18dc9c..1256f85d 100644
--- a/docs/faq.html
+++ b/docs/faq.html
@@ -1,10 +1,10 @@
 
-
+
 
   
 
   
-  Frequently Asked Questions — CodeCarbon 2.7.0 documentation
+  Frequently Asked Questions — CodeCarbon 2.7.1 documentation
       
       
 
@@ -15,9 +15,9 @@
   
         
         
-        
-        
-        
+        
+        
+        
     
     
     
@@ -93,7 +93,7 @@
            
-

Frequently Asked Questions

+

Frequently Asked Questions

  • How accurate are your estimations?

    It is hard to quantify the entirety of computing emissions, because there are many factors in play, notably the life-cycle emissions of computing infrastructure. We therefore only focus on the direct emissions produced by running the actual code, but recognize that there is much work to be done to improve this estimation.

    diff --git a/docs/genindex.html b/docs/genindex.html index 88908891..810f4edf 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -1,9 +1,9 @@ - + - Index — CodeCarbon 2.7.0 documentation + Index — CodeCarbon 2.7.1 documentation @@ -14,9 +14,9 @@ - - - + + + diff --git a/docs/index.html b/docs/index.html index 2a9825b5..1b91f917 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,10 +1,10 @@ - + - CodeCarbon — CodeCarbon 2.7.0 documentation + CodeCarbon — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -92,7 +92,7 @@
    -

    CodeCarbon

    +

    CodeCarbon

    Banner

    Introduction

    @@ -176,7 +176,7 @@

    CodeCarbon -

    Indices and tables

    +

    Indices and tables

    • Index

    • Module Index

    • diff --git a/docs/installation.html b/docs/installation.html index ad2be25b..7147420e 100644 --- a/docs/installation.html +++ b/docs/installation.html @@ -1,10 +1,10 @@ - + - Installing CodeCarbon — CodeCarbon 2.7.0 documentation + Installing CodeCarbon — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -98,7 +98,7 @@
      -

      Installing CodeCarbon

      +

      Installing CodeCarbon

      Create a virtual environment using conda for easier management of dependencies and packages. For installing conda, follow the instructions on the official conda website

      @@ -107,7 +107,7 @@
-

From PyPi repository

+

From PyPi repository

The package is hosted on the pip repository here.

To install the package, run the following command in your terminal.

pip install codecarbon
@@ -115,7 +115,7 @@ 

From PyPi repository

-

From conda repository

+

From conda repository

The package is hosted on the conda repository here.

To install the package, run the following command in your terminal.

conda install -c codecarbon -c conda-forge codecarbon
@@ -127,7 +127,7 @@ 

From conda repository

-

Dependencies

+

Dependencies

The following packages are used by the CodeCarbon package, and will be installed along with the package itself:

arrow
 pandas
diff --git a/docs/methodology.html b/docs/methodology.html
index d1e35867..9a07af79 100644
--- a/docs/methodology.html
+++ b/docs/methodology.html
@@ -1,10 +1,10 @@
 
-
+
 
   
 
   
-  Methodology — CodeCarbon 2.7.0 documentation
+  Methodology — CodeCarbon 2.7.1 documentation
       
       
 
@@ -15,9 +15,9 @@
   
         
         
-        
-        
-        
+        
+        
+        
     
     
     
@@ -107,7 +107,7 @@
            
-

Methodology

+

Methodology

Carbon dioxide (COβ‚‚) emissions, expressed as kilograms of COβ‚‚-equivalents [COβ‚‚eq], are the product of two main factors :

C = Carbon Intensity of the electricity consumed for computation: quantified as g of COβ‚‚ emitted per kilowatt-hour of electricity.
 
@@ -116,14 +116,14 @@
 

Carbon dioxide emissions (COβ‚‚eq) can then be calculated as C * E

-

Carbon Intensity

+

Carbon Intensity

Carbon Intensity of the consumed electricity is calculated as a weighted average of the emissions from the different energy sources that are used to generate electricity, including fossil fuels and renewables. In this toolkit, the fossil fuels coal, petroleum, and natural gas are associated with specific carbon intensities: a known amount of carbon dioxide is emitted for each kilowatt-hour of electricity generated. Renewable or low-carbon fuels include solar power, hydroelectricity, biomass, geothermal, and more. The nearby energy grid contains a mixture of fossil fuels and low-carbon energy sources, called the Energy Mix. Based on the mix of energy sources in the local grid, this package calculates the Carbon Intensity of the electricity consumed.

Grid Energy Mix

When available, CodeCarbon uses global carbon intensity of electricity per cloud provider ( here ) or per country ( here ).

If we don’t have the global carbon intensity or electricity of a country, but we have its electricity mix, we compute the carbon intensity of electricity using this table:

- +@@ -175,28 +175,28 @@

Carbon Intensity -

Power Usage

+

Power Usage

Power supply to the underlying hardware is tracked at frequent time intervals. This is a configurable parameter measure_power_secs, with default value 15 seconds, that can be passed when instantiating the emissions’ tracker.

Currently, the package supports the following hardware infrastructure.

-

GPU

+

GPU

Tracks Nvidia GPUs energy consumption using pynvml library (installed with the package).

-

RAM

+

RAM

CodeCarbon uses a 3 Watts for 8 GB ratio source . This measure is not satisfying and if ever you have an idea how to enhance it please do not hesitate to contribute.

-

CPU

+

CPU

  • On Windows or Mac (Intel)

Tracks Intel processors energy consumption using the Intel Power Gadget. You need to install it yourself from this source .

-

Apple Silicon Chips (M1, M2)

+

Apple Silicon Chips (M1, M2)

Apple Silicon Chips contain both the CPU and the GPU.

Codecarbon tracks Apple Silicon Chip energy consumption using powermetrics. It should be available natively on any mac. However, this tool is only usable with sudo rights and to our current knowledge, there are no other options to track the energy consumption of the Apple Silicon Chip without administrative rights @@ -229,10 +229,10 @@

Apple Silicon Chips (M1, M2) -

References

+

References

Energy Usage Reports: Environmental awareness as part of algorithmic accountability

-

How CodeCarbon Works

+

How CodeCarbon Works

CodeCarbon uses a scheduler that, by default, calls for a measure every 15 seconds, so it has no significant overhead.

The measure itself is fast and CodeCarbon is designed to be as light as possible with a small memory footprint.

The scheduler is started when the first start method is called and stopped when stop method is called.

diff --git a/docs/model_examples.html b/docs/model_examples.html index 9ca864e0..49875af3 100644 --- a/docs/model_examples.html +++ b/docs/model_examples.html @@ -1,10 +1,10 @@ - + - Model Comparisons — CodeCarbon 2.7.0 documentation + Model Comparisons — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -98,10 +98,10 @@
-

Model Comparisons

+

Model Comparisons

The following table shows the different electricity consumption of popular NLP and Computer visions models

Carbon Intensity Across Energy SourcesCarbon Intensity Across Energy Sources
- +@@ -174,7 +174,7 @@
Electricity consumption of AI cloud instanceElectricity consumption of AI cloud instance
-

Impact of time of year and region

+

Impact of time of year and region

Carbon emissions that would be emitted from training BERT (language modeling on 8 V100s for 36 hours) in different locations:

Models emissions comparison

In this case study, time of year might not be relevant in most cases, but localisation can have a great impact on carbon emissions.

@@ -182,7 +182,7 @@

Impact of time of year and region -

Comparisons

+

Comparisons

Emissions for the 11 described models can be displayed as below:

Models emissions comparison

The black line represents the average emissions (across regions and time of year). @@ -191,7 +191,7 @@

Comparisons -

References

+

References

Measuring the Carbon intensity of AI in Cloud Instance

Another source comparing models carbon intensity: Energy and Policy Considerations for Deep Learning in NLP

diff --git a/docs/motivation.html b/docs/motivation.html index c70ed925..3ed4faf6 100644 --- a/docs/motivation.html +++ b/docs/motivation.html @@ -1,10 +1,10 @@ - + - Motivation — CodeCarbon 2.7.0 documentation + Motivation — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -93,7 +93,7 @@
-

Motivation

+

Motivation

In recent years, Artificial Intelligence, and more specifically Machine Learning, has become remarkably efficient at performing human-level tasks: recognizing objects and faces in images, driving cars, and playing sophisticated games like chess and Go.

In order to achieve these incredible levels of performance, current approaches leverage vast amounts of data to learn underlying patterns and features. Thus, state-of-the-art Machine Learning models leverage significant amounts of computing power, training on advanced processors for weeks or months, consequently consuming enormous amounts of energy. Depending on the energy grid used during this process, this can entail the emission of large amounts of greenhouse gases such as COβ‚‚.

With AI models becoming more ubiquitous and deployed across different sectors and industries, AI’s environmental impact is also growing. For this reason, it is important to estimate and curtail both the energy used and the emissions produced by training and deploying AI models. This package enables developers to track carbon dioxide (COβ‚‚) emissions across machine learning experiments or other programs.

diff --git a/docs/objects.inv b/docs/objects.inv index 3ca2bac6..18b6d21c 100644 Binary files a/docs/objects.inv and b/docs/objects.inv differ diff --git a/docs/output.html b/docs/output.html index 8805fad7..b767e589 100644 --- a/docs/output.html +++ b/docs/output.html @@ -1,10 +1,10 @@ - + - Output — CodeCarbon 2.7.0 documentation + Output — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -109,13 +109,13 @@
-

Output

+

Output

-

CSV

+

CSV

The package has an in-built logger that logs data into a CSV file named emissions.csv in the output_dir, provided as an input parameter (defaults to the current directory), for each experiment tracked across projects.

- +@@ -238,15 +238,15 @@

CSV
-

Prometheus

+

Prometheus

-

Using CodeCarbon with prometheus

+

Using CodeCarbon with prometheus

Prometheus is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts when specified conditions are observed.

CodeCarbon exposes all its metrics with the suffix codecarbon_.

Current version uses pushgateway mode. If your pushgateway server needs auth, set your environment values PROMETHEUS_USERNAME and PROMETHEUS_PASSWORD so codecarbon is able to push the metrics.

-

How to test in local

+

How to test in local

Deploy a local version of Prometheus + Prometheus Pushgateway

docker-compose up
 
@@ -267,14 +267,14 @@

How to test in local

-

Logfire

+

Logfire

-

Using CodeCarbon with logfire

+

Using CodeCarbon with logfire

Logfire is an observability platform.

CodeCarbon exposes all its metrics with the suffix codecarbon_.

-

How to use it

+

How to use it

Run your EmissionTracker as usual, but with the parameter save_to_logfire as True. e.g.

...
@@ -291,15 +291,15 @@ 

How to use it -

HTTP Output

+

HTTP Output

The HTTP Output allow the call of a webhook with emission data when the tracker is stopped.

-

CodeCarbon API

+

CodeCarbon API

You can send all the data to the CodeCarbon API. So you have all your historical data in one place. By default, nothing is sent to the API.

-

Logger Output

+

Logger Output

See Collecting emissions to a logger.

diff --git a/docs/parameters.html b/docs/parameters.html index c974287a..1300b1f7 100644 --- a/docs/parameters.html +++ b/docs/parameters.html @@ -1,10 +1,10 @@ - + - Parameters — CodeCarbon 2.7.0 documentation + Parameters — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -99,12 +99,12 @@
-

Parameters

+

Parameters

A set of parameters are supported by API to help users provide additional details per project.

-

Input Parameters

+

Input Parameters

Data Fields Logged for Each ExperimentData Fields Logged for Each Experiment
- +@@ -159,9 +159,9 @@

Input Parameters -

Output parameters

+

Output parameters

Input ParametersInput Parameters
- +@@ -244,9 +244,9 @@

Output parameters -

Specific parameters for offline mode

+

Specific parameters for offline mode

Output ParametersOutput Parameters
- +@@ -297,10 +297,10 @@

Specific parameters for offline mode -

@track_emissions

+

@track_emissions

Decorator track_emissions in addition to standard arguments, requires the following parameters:

Input Parameters to OfflineEmissionsTrackerInput Parameters to OfflineEmissionsTracker
- +diff --git a/docs/search.html b/docs/search.html index 77cdef37..d4c2e03f 100644 --- a/docs/search.html +++ b/docs/search.html @@ -1,9 +1,9 @@ - + - Search — CodeCarbon 2.7.0 documentation + Search — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + diff --git a/docs/searchindex.js b/docs/searchindex.js index 6f134c2f..0a01fd06 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles": {"@track_emissions": [[10, "track-emissions"]], "Access internet through proxy server": [[12, "access-internet-through-proxy-server"]], "Apple Silicon Chips (M1, M2)": [[6, "apple-silicon-chips-m1-m2"]], "Authentication": [[11, "authentication"]], "CPU": [[6, "cpu"]], "CSV": [[9, "csv"]], "Carbon Intensity": [[6, "carbon-intensity"]], "Carbon Intensity Across Energy Sources": [[6, "id5"]], "Cloud Regions": [[13, "cloud-regions"]], "CodeCarbon": [[4, null]], "CodeCarbon API": [[0, null], [0, "id1"], [9, "codecarbon-api"]], "Collecting emissions to a logger": [[11, null]], "Comet Integration": [[1, null]], "Command line": [[12, "command-line"]], "Comparisons": [[7, "comparisons"]], "Configuration": [[12, "configuration"]], "Configuration priority": [[12, "configuration-priority"]], "Context manager": [[12, "context-manager"], [12, "id2"]], "Create a logger": [[11, "create-a-logger"]], "Create an EmissionTracker": [[11, "create-an-emissiontracker"]], "Data Fields Logged for Each Experiment": [[9, "id4"]], "Decorator": [[12, "decorator"], [12, "id3"]], "Dependencies": [[5, "dependencies"]], "Electricity consumption of AI cloud instance": [[7, "id1"]], "Electricity production carbon intensity per country": [[13, "electricity-production-carbon-intensity-per-country"]], "Example": [[11, "example"]], "Examples": [[2, null]], "Explicit Object": [[12, "explicit-object"], [12, "id1"]], "Frequently Asked Questions": [[3, null]], "From PyPi repository": [[5, "from-pypi-repository"]], "From conda repository": [[5, "from-conda-repository"]], "GPU": [[6, "gpu"]], "Getting Started": [[4, null]], "Google Cloud Logging": [[11, "google-cloud-logging"]], "HTTP Output": [[9, "http-output"]], "How CodeCarbon Works": [[6, "how-codecarbon-works"]], "How to test in local": [[9, "how-to-test-in-local"]], "How to use it": [[9, "how-to-use-it"]], "Impact of time of year and region": [[7, "impact-of-time-of-year-and-region"]], "Indices and tables": [[4, "indices-and-tables"]], "Input Parameters": [[10, "input-parameters"], [10, "id4"]], "Input Parameters to @track_emissions": [[10, "id7"]], "Input Parameters to OfflineEmissionsTracker": [[10, "id6"]], "Installing CodeCarbon": [[5, null]], "Introduction": [[4, null]], "Logfire": [[9, "logfire"]], "Logger Output": [[9, "logger-output"]], "Logging": [[4, null]], "Methodology": [[6, null]], "Model Comparisons": [[7, null]], "Motivation": [[8, null]], "Offline": [[13, "offline"]], "Offline Mode": [[12, "offline-mode"]], "Online (Beta)": [[13, "online-beta"]], "Online Mode": [[12, "online-mode"]], "Output": [[9, null]], "Output Parameters": [[10, "id5"]], "Output parameters": [[10, "output-parameters"]], "Parameters": [[10, null]], "Power Usage": [[6, "power-usage"]], "Prometheus": [[9, "prometheus"]], "Python logger": [[11, "python-logger"]], "Quickstart": [[12, null]], "RAM": [[6, "ram"]], "References": [[6, "references"], [7, "references"]], "Regional Comparisons": [[13, "regional-comparisons"]], "Specific parameters for offline mode": [[10, "specific-parameters-for-offline-mode"]], "Summary and Equivalents": [[13, "summary-and-equivalents"]], "Using CodeCarbon with logfire": [[9, "using-codecarbon-with-logfire"]], "Using CodeCarbon with prometheus": [[9, "using-codecarbon-with-prometheus"]], "Using the Context Manager": [[2, "using-the-context-manager"]], "Using the Decorator": [[2, "using-the-decorator"]], "Using the Explicit Object": [[2, "using-the-explicit-object"]], "Visualize": [[13, null]], "detailed": [[13, "detailed"]], "from global\u2026": [[13, "from-global"]], "to more and more\u2026": [[13, "to-more-and-more"]]}, "docnames": ["api", "comet", "examples", "faq", "index", "installation", "methodology", "model_examples", "motivation", "output", "parameters", "to_logger", "usage", "visualize"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["api.rst", "comet.rst", "examples.rst", "faq.rst", "index.rst", "installation.rst", "methodology.rst", "model_examples.rst", "motivation.rst", "output.rst", "parameters.rst", "to_logger.rst", "usage.rst", "visualize.rst"], "indexentries": {}, "objects": {}, "objnames": {}, "objtypes": {}, "terms": {"": [1, 6, 8, 9, 10, 12, 13], "0": [2, 6, 7, 9, 12], "0000": 12, "02": 7, "03": 7, "04": 7, "1": [7, 9, 10, 12], "10": [2, 9, 12], "1065g7": 9, "1080": 9, "11": [7, 9], "121": 7, "123": 9, "128": 2, "13": 7, "14": 6, "15": [6, 10], "169": 7, "19": 7, "19044": 9, "192": 7, "2": [1, 2, 7, 9, 10], "2000": 6, "201": 7, "21": 7, "216": 7, "235b1da5": 12, "237": 7, "25": 6, "255": 2, "256": 7, "26": 6, "28": 2, "29": 6, "3": [1, 5, 6, 7, 9, 10, 12], "30": 0, "30ghz": 9, "32": 13, "3333": 13, "35": 6, "36": 7, "37": 7, "38": 6, "4": [0, 7, 12], "475": [3, 6], "48": 6, "50": 6, "59": 6, "6": 7, "6b": 7, "7": [5, 7], "731": 6, "743": 6, "7777": 12, "8": [6, 7, 9, 10], "8008": 12, "8050": 13, "812": 7, "816": 6, "893681599d2c": 12, "90": 7, "9090": 9, "93": 7, "995": 6, "A": [10, 11, 12, 13], "And": [0, 1], "As": [6, 8], "But": 3, "By": 9, "For": [3, 5, 8, 9, 10, 12], "IT": 3, "If": [3, 6, 9, 12, 13], "In": [0, 1, 6, 7, 8, 11, 12], "It": [0, 3, 6, 9, 11, 12], "On": [6, 7], "One": 9, "Or": [0, 12], "The": [0, 5, 6, 7, 9, 10, 11, 12, 13], "Then": [0, 6], "There": 3, "To": [1, 5, 6], "With": 8, "_": 12, "__main__": [0, 2], "__name__": [0, 2], "_channel": 11, "_logger": 11, "a100": 7, "aaaa": 12, "abl": [1, 9], "about": [3, 12], "abov": [5, 6], "absenc": 12, "access": 4, "account": [1, 6], "accur": [3, 6], "accuraci": 2, "achiev": 8, "across": [7, 8, 9, 13], "activ": [2, 5, 13], "actual": 3, "adam": 2, "add": [1, 3, 6, 10, 11], "addhandl": 11, "addit": [10, 12], "administr": 6, "advanc": 8, "after": 11, "agenc": 7, "ai": 8, "alert": 9, "algorithm": 6, "all": [0, 3, 6, 9, 12, 13], "allow": [9, 11, 12], "along": [1, 5, 12], "alongsid": 1, "alphabet": [9, 12], "also": [8, 11, 12, 13], "although": 3, "amazon": 3, "amd": 6, "american": 13, "amount": [6, 8, 13], "an": [0, 1, 3, 6, 9, 12, 13], "analyz": 3, "ani": [3, 6, 12], "anoth": [7, 13], "api": [1, 4, 10, 12, 13], "api_call_interv": [0, 10, 12], "api_endpoint": 10, "api_kei": [1, 10], "app": 13, "appear": 9, "append": 10, "appli": 6, "approach": 8, "approxim": 6, "ar": [2, 3, 5, 6, 7, 8, 9, 10, 11, 13], "argument": [10, 13], "arrow": 5, "art": 8, "artifact": [1, 10], "artifici": 8, "asia": 9, "ask": [4, 9], "associ": 6, "assum": 6, "attribut": 12, "auth": 9, "automat": 1, "avail": [2, 3, 6, 9, 10, 11, 12, 13], "averag": [3, 6, 7, 13], "aw": 9, "awar": [6, 12], "azur": [7, 9], "back": [1, 6], "bar": 13, "barchart": 13, "base": [6, 7, 9, 11, 12], "baseoutput": 9, "becaus": [3, 12], "becom": 8, "befor": 0, "begin": 12, "being": [10, 13], "below": [7, 13], "benchmark": 13, "bert": 7, "bert_infer": 12, "best": 3, "beta": [4, 10], "better": 13, "between": [6, 10], "bin": 6, "biomass": 6, "black": 7, "blob": 10, "block": 12, "blue": 7, "boolean": 10, "both": [6, 8, 12], "brazilsouth": 9, "broader": 8, "bubbl": 13, "build": [11, 12], "build_model": 12, "built": [9, 13], "c": [5, 6, 12], "calcul": [3, 6], "california": 10, "call": [6, 9, 10, 12], "can": [0, 1, 3, 6, 7, 8, 9, 11, 12, 13], "canada": 10, "car": 8, "carbon": [1, 3, 4, 7, 8, 12], "carbonboard": 13, "case": [3, 7, 9, 12, 13], "cell": 12, "center": 10, "central": [0, 11], "chart": 13, "chess": 8, "choic": 3, "choos": [3, 10], "chose": 13, "citi": [9, 10], "class": [6, 9, 11], "cli": [12, 13], "click": [1, 5, 13], "client": 11, "cloud": [3, 6, 9, 10], "cloud_provid": [9, 10], "cloud_region": [9, 10], "co2": 12, "co2_signal_api_token": [10, 12], "co2sign": 10, "coal": 6, "code": [0, 1, 3, 9, 10, 12], "codecarbon": [1, 2, 3, 7, 10, 11, 12, 13], "codecarbon_": [9, 12], "codecarbon_gpu_id": 12, "codecarbon_log_level": 12, "collect": [4, 9], "collector": 11, "com": [3, 10], "combust": 8, "come": [12, 13], "comet": 4, "comet_ml": 1, "command": [5, 6, 13], "commun": 3, "compar": [1, 7, 13], "comparison": 4, "compil": 2, "complet": 12, "compos": [9, 12], "comput": [3, 6, 7, 8, 9, 12], "concern": 13, "conda": 4, "condit": 9, "config": [0, 12], "configpars": 12, "configur": [4, 6, 9], "connect": [11, 13], "consequ": 8, "consider": 7, "constant": 6, "consum": [6, 8, 13], "consumpt": [6, 10, 13], "contain": [6, 13], "context": 4, "contribut": 6, "copi": 1, "core": 9, "correspond": [6, 10, 12], "could": [0, 6, 7, 10, 12], "count": 3, "countri": [3, 6, 9, 10, 12], "country_2letter_iso_cod": 10, "country_iso_cod": [9, 10, 12], "country_nam": 9, "cover": 3, "co\u2082": [6, 8, 9], "co\u2082eq": [6, 8, 9], "cpu": 9, "cpu_count": 9, "cpu_energi": 9, "cpu_model": 9, "cpu_pow": 9, "cpuinfo": 5, "creat": [0, 1, 4, 5, 12], "critic": [10, 11], "csv": [4, 10, 12, 13], "ctrl": 12, "current": [6, 8, 9, 10, 12, 13], "curtail": 8, "custom": 9, "cycl": 3, "daili": 13, "dash": 13, "dashboard": 0, "data": [0, 1, 2, 3, 6, 8, 10, 11, 13], "databas": 9, "datacent": 3, "dataset": [1, 2, 12], "debug": [10, 11, 12], "decent": 6, "decor": [4, 10], "dedic": [10, 11], "deep": [2, 7], "def": [0, 2, 12], "default": [0, 1, 3, 6, 9, 10, 11, 12, 13], "definit": 1, "demonstr": 11, "dens": [2, 7], "depend": [4, 8, 12], "deploi": [8, 9], "deriv": 9, "describ": 7, "descript": [9, 10], "design": 6, "detail": [1, 10, 12], "detect": 6, "develop": [7, 8, 9, 12], "devic": 9, "did": 3, "differ": [3, 6, 7, 8, 13], "digit": 2, "dioxid": [6, 8], "direct": 3, "directori": [6, 9, 10, 12], "disk": 12, "displai": [7, 9, 13], "distinct": 11, "dive": 13, "divid": [9, 13], "do": [0, 3, 6, 12], "docker": [9, 12], "document": [11, 12], "doe": 3, "don": 6, "done": [3, 9], "drive": 8, "driven": 13, "dropout": 2, "dt": 9, "durat": 9, "dure": [6, 8], "e": [6, 9], "each": [6, 12, 13], "easier": 5, "easili": 1, "east": 9, "east1": 9, "eco": 13, "effect": 10, "effici": 8, "electr": [3, 6, 8, 12], "electricitymap": 10, "els": 1, "emiss": [0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13], "emissions_endpoint": 12, "emissions_r": 9, "emissionstrack": [1, 2, 11, 12], "emissiontrack": 9, "emit": [6, 7, 8], "empir": 6, "enabl": [8, 12], "encapsul": 10, "end": [6, 10], "endpoint": [10, 12], "energi": [3, 7, 8, 9, 13], "energy_consum": 9, "enhanc": [6, 9], "enorm": 8, "entail": 8, "enter": 6, "enterpris": 3, "entir": 10, "entireti": 3, "entri": 12, "environ": [1, 5, 9, 12], "environment": [6, 7, 8], "epoch": 2, "eq": [3, 6], "equival": [6, 7, 8, 9], "eras": 10, "error": 10, "estim": [3, 6, 7, 8, 10], "etc": 11, "evalu": 9, "even": 3, "ever": [6, 13], "everi": [1, 6, 10], "everyth": [1, 12], "exampl": [1, 4, 6, 8, 9, 10, 12, 13], "execut": 13, "exemplari": 13, "exist": [3, 6, 10, 12, 13], "experi": [0, 1, 8, 10, 12, 13], "experiment_id": [0, 10, 12], "explain": 1, "explicit": 4, "explor": 13, "export": 12, "expos": 9, "express": [6, 8, 9], "face": 8, "fact": 8, "factor": [3, 6, 10], "fall": 6, "fallback": 6, "fals": [10, 12], "fast": 6, "featur": 8, "fetch": 12, "file": [0, 1, 6, 9, 10, 11, 12, 13], "filehandl": 11, "filepath": 13, "filter": 11, "final": 12, "find": [3, 6], "fintetun": 7, "first": [6, 7, 9, 11, 12], "fit": 2, "flatten": 2, "float": [2, 11], "flush": [10, 12], "fn": 10, "focu": 3, "folder": 12, "follow": [2, 3, 5, 6, 7, 9, 10, 12, 13], "footprint": [1, 3, 6, 8], "forbid": 11, "forg": 5, "format": 9, "former": 10, "fossil": [6, 8], "found": [1, 6, 12], "fourth": 7, "framework": 12, "free": [1, 10], "frequent": [4, 6], "friendli": 13, "from": [0, 1, 2, 3, 4, 6, 7, 9, 10, 11, 12], "from_logit": 2, "fuel": [6, 8], "function": [3, 10, 12], "g": [6, 9], "ga": 6, "gadget": 6, "galleri": 1, "game": 8, "gase": 8, "gb": 6, "gco2": [3, 6], "gcp": 9, "geforc": 9, "gener": [6, 8, 12, 13], "geograph": 9, "geotherm": 6, "get": [0, 1, 10, 12, 13], "getlogg": 11, "github": [2, 10], "give": 6, "given": 9, "global": [3, 6, 8, 10, 12], "global_energy_mix": 10, "globalpetrolpric": 3, "go": [1, 8, 9], "goe": [0, 12], "gold": 3, "good": [3, 6, 9], "googl": [3, 10], "google_project_nam": 11, "googlecloudloggeroutput": 11, "gpu": [0, 7, 9, 10, 12], "gpu_count": 9, "gpu_energi": 9, "gpu_id": [10, 12], "gpu_model": 9, "gpu_pow": 9, "graph": [1, 7], "great": 7, "greater": 3, "green": 10, "greenhous": 8, "grid": [6, 8, 13], "grow": 8, "gtx": 9, "h": [7, 9], "ha": [3, 6, 7, 8, 9, 12, 13], "habit": 3, "hand": 13, "handler": 11, "happen": 13, "hard": 3, "hardwar": [6, 10], "have": [0, 1, 3, 6, 7, 8, 9, 10, 12], "header": 12, "help": [3, 6, 10], "here": [0, 3, 5, 6, 7, 11, 12], "hesit": 6, "hi": 10, "hierarch": 12, "histor": 9, "home": 12, "hood": 12, "host": [5, 9, 10, 12, 13], "hour": [6, 7, 8], "household": 13, "how": [3, 12], "howev": [6, 12], "http": [4, 10, 12], "http_proxi": 12, "https_proxi": 12, "huge": 7, "human": 8, "hydroelectr": 6, "hyperparamet": 1, "i": [3, 5, 6, 8, 9, 10, 11, 12, 13], "i7": 9, "id": [0, 9, 10], "idea": 6, "iea": 3, "illustr": 13, "imag": [2, 8], "imdb": 12, "imdb_emiss": 12, "impact": [4, 8, 10], "implement": [9, 12], "import": [0, 2, 8, 11, 12], "improv": [3, 6], "inch": 13, "includ": [6, 10], "incred": 8, "index": 4, "indic": 10, "industri": 8, "infer": 12, "info": [10, 11], "inform": [3, 12, 13], "infra": 3, "infrastructur": [3, 6, 9, 10, 12, 13], "ini": 12, "init": 0, "initi": [3, 12], "input": [4, 9], "input_shap": 2, "instal": [1, 4, 6], "instanc": 12, "instanti": [6, 12], "instruct": 5, "integr": 4, "intel": [6, 9], "intellig": 8, "intens": [0, 3, 4, 7, 10, 12], "interfac": [0, 9], "interfer": 12, "intern": 12, "internet": 4, "interv": [6, 9, 10], "io": 10, "iso": [9, 10, 12], "isol": 10, "issu": [3, 6], "its": [3, 6, 7, 9, 11, 13], "itself": [5, 6], "job": 1, "json": 10, "jupyt": 12, "just": 12, "keep": [3, 12], "kei": [1, 10], "kera": 2, "kg": [6, 9], "kgco\u2082": 6, "kilogram": [6, 8], "kilowatt": [6, 8], "km": 9, "km\u00b2": 9, "know": 6, "knowledg": 6, "known": [6, 10], "kwh": [3, 6, 7, 9], "lack": 11, "languag": 7, "larg": [7, 8], "last": 12, "latest": 5, "latitud": 9, "layer": 2, "lcd": 13, "learn": [2, 7, 8], "left": [1, 13], "let": 3, "letter": [9, 10, 12], "level": [8, 10, 11, 13], "leverag": [8, 11], "librari": [6, 12], "life": [3, 13], "light": [6, 7], "like": [8, 12], "line": [6, 7], "link": 1, "linux": 6, "list": [5, 6, 10, 12], "ll": 1, "load": 12, "load_data": 2, "load_dataset": 12, "local": [3, 6, 11, 12], "localhost": [9, 12], "localis": 7, "locat": [7, 10], "log": [7, 10, 13], "log_level": [10, 12], "log_nam": 11, "logfir": 4, "logger": [4, 10, 13], "logger_preambl": 10, "loggeroutput": [10, 11], "logging_demo": 11, "logging_logg": [10, 11], "longitud": 9, "loss": 2, "loss_fn": 2, "low": [6, 10], "m": 9, "mac": 6, "machin": [0, 8, 9, 10], "made": 3, "mai": 11, "main": 6, "major": 9, "make": [1, 3, 6], "manag": [4, 5], "mandatori": 10, "mani": 3, "manner": 12, "manual": [10, 12], "map": 6, "master": 10, "matter": 8, "measur": [6, 7, 8, 10, 12], "measure_power_sec": [0, 6, 10, 12], "memori": 6, "mention": 6, "messag": [10, 11], "metadata": 13, "method": 6, "methodologi": 4, "metric": [1, 2, 9], "microsoft": [3, 7], "might": 7, "mile": 13, "mind": 3, "minim": 12, "miss": 3, "mix": [3, 6, 13], "mixtur": 6, "ml": 1, "mlco2": 10, "mnist": [1, 2], "mode": [0, 4, 6, 9], "model": [2, 4, 8, 12], "model_emiss": 12, "modifi": [6, 12], "modul": 4, "monitor": [0, 9, 12], "month": 8, "monthli": 3, "more": [0, 1, 6, 8, 12], "most": [7, 13], "motiv": 4, "much": 3, "multipl": 10, "multipli": 3, "must": 12, "mwh": 6, "my": 3, "my_logg": 11, "n": 9, "name": [5, 9, 10, 11, 12], "nativ": 6, "natur": 6, "nb": 7, "nearbi": 6, "need": [0, 1, 6, 9, 11, 12, 13], "neither": [3, 6], "net": [6, 13], "network": 11, "new": 10, "nice": 0, "nlp": 7, "none": [6, 10], "nopasswd": 6, "nor": 6, "normal": 12, "notabl": 3, "note": [6, 12, 13], "notebook": 12, "noth": 9, "now": [1, 13], "nuclear": 6, "number": [9, 10, 13], "nvidia": [6, 9], "o": [9, 12], "object": [1, 4, 8, 10], "observ": 9, "offici": 5, "offlin": 4, "offlineemissionstrack": [9, 12], "offlineemissiontrack": 11, "offset": 3, "often": 3, "old": 10, "on_cloud": 9, "on_csv_writ": 10, "onc": [1, 9], "one": [0, 3, 9, 10, 11, 13], "onli": [3, 6, 10], "onlin": 4, "open": [3, 6], "openapi": 0, "optim": 2, "option": [0, 3, 6, 10, 11, 12, 13], "order": [8, 10, 11], "org": 10, "organ": 0, "organis": 13, "other": [2, 3, 6, 8, 11], "otherwis": 11, "our": [3, 6], "ourworld": 3, "out": 3, "output": [4, 11], "output_dir": [9, 10, 12], "output_fil": 10, "overhead": [6, 12], "overrid": 12, "overwrit": 12, "own": [0, 7], "p40": 7, "packag": [1, 3, 5, 6, 8, 9, 11, 13], "page": [1, 4], "panda": 5, "panel": 1, "parallel": 11, "param": 12, "paramet": [4, 6, 9, 12], "part": [6, 8], "particular": 13, "pass": [6, 12], "password": 6, "path": [6, 10, 13], "pattern": 8, "per": [6, 8, 9, 10], "perform": 8, "person": 1, "petroleum": 6, "piec": 12, "pip": [1, 5], "place": 9, "placehold": 1, "plai": [3, 8], "platform": [3, 9], "pleas": [3, 5, 6, 11, 12], "point": [7, 12, 13], "polici": 7, "popular": 7, "port": 13, "possibl": 6, "potenti": 8, "power": [1, 4, 8, 9, 10, 11, 13], "powercap": 6, "powermetr": 6, "precis": 9, "present": 7, "pretrain": 7, "prevent": 12, "preview": 13, "price": 3, "print": 2, "prioriti": [3, 4], "privaci": 9, "privat": [3, 9, 11, 12], "process": [8, 9, 10, 11, 12, 13], "processor": [6, 8], "produc": [3, 8, 13], "product": 6, "program": 8, "project": [0, 2, 3, 9, 10, 11, 13], "project_nam": [2, 9, 10, 12], "prometheu": 4, "prometheus_cli": 5, "prometheus_password": 9, "prometheus_usernam": 9, "prompt": 12, "propos": 6, "protect": [7, 9], "provid": [1, 6, 9, 10, 11, 12, 13], "provinc": [9, 10], "proxi": 4, "psutil": 5, "public": [0, 1, 3, 12, 13], "publish": 3, "pue": 10, "purpos": 8, "push": 9, "pushgatewai": 9, "py": [1, 5, 9, 11], "pynvml": [5, 6], "pypi": 4, "python": [5, 12], "python_vers": 9, "quantifi": [3, 6], "quartil": 7, "question": 4, "quickstart": 4, "r": 9, "ram": 9, "ram_energi": 9, "ram_pow": 9, "ram_total_s": 9, "rang": 9, "rapidfuzz": 5, "rapl": 6, "ratio": 6, "re": 12, "read": 12, "reason": 8, "recent": 8, "recogn": [2, 3, 8], "recommend": [3, 5, 12, 13], "record": 12, "recur": 3, "reduc": [3, 9], "refer": [4, 5, 11, 12], "region": [3, 4, 9, 10, 12], "relationship": 6, "releas": 3, "relev": 7, "reli": 12, "relu": 2, "remain": 12, "remark": 8, "render": 1, "renew": 6, "replac": 1, "repo": 3, "report": [6, 11], "repositori": [2, 4], "repres": 7, "reproduc": 1, "request": [5, 12], "requir": [9, 10, 12], "research": [1, 3], "resourc": 6, "respect": [9, 12], "restrict": 12, "result": [7, 9, 12], "return": [2, 12], "right": [6, 7, 13], "room": 6, "root": 6, "row": 10, "rule": 9, "run": [0, 1, 3, 5, 9, 10, 12, 13], "run_id": 10, "runtim": 13, "same": 12, "sampl": 1, "satisfi": 6, "save": [0, 1, 11, 12], "save_to_api": [0, 10, 12], "save_to_fil": [10, 12], "save_to_logfir": 9, "save_to_logg": [10, 11], "save_to_prometheu": 9, "scale": 7, "schedul": [6, 12], "scheme": 3, "scientist": 1, "script": 12, "sdk": 11, "search": [1, 4, 9], "second": [6, 9, 10], "section": 12, "sector": 8, "see": [1, 6, 9, 10, 11, 12, 13], "self": 9, "send": [9, 10, 11, 12], "sent": [9, 13], "sequenti": 2, "seri": 13, "server": [0, 4, 9], "servic": 9, "set": [0, 1, 9, 10, 11, 12], "setlevel": 11, "setup": 5, "sever": 13, "share": 13, "shell": 12, "shot": 3, "should": [3, 6, 10], "show": [6, 7, 13], "shown": 13, "side": [7, 13], "sidebar": 1, "sign": 10, "signific": [6, 8], "singl": [3, 12], "small": [6, 7, 12], "so": [0, 3, 6, 9, 10, 12], "solar": 6, "solut": 6, "some": [11, 12], "soon": 12, "sophist": 8, "sourc": [3, 7], "sp0": 9, "sparsecategoricalcrossentropi": 2, "specif": [4, 6, 8, 11, 12], "specifi": [0, 9, 10, 11], "split": 12, "standard": [3, 8, 10], "start": [1, 2, 6, 9, 11, 12], "start_task": 12, "state": [8, 9, 10], "statist": 6, "stdout": 1, "still": [6, 11], "stop": [2, 6, 9, 11, 12], "stop_task": 12, "stream": 11, "string": 10, "structur": 12, "studi": 7, "subclass": 11, "subscript": 3, "success": 3, "sudo": 6, "sudoer": 6, "suffix": 9, "sum": 9, "suppli": 6, "support": [6, 10, 11, 12], "sure": 1, "sustain": 3, "switch": [6, 13], "sy": 6, "syntax": 12, "system": [1, 9, 11], "systemat": 10, "t": [6, 12], "tab": 1, "tabl": [6, 7], "taken": 1, "target": 9, "task": [8, 12], "tdp": 6, "team": 0, "tell": 0, "tensorflow": 2, "termin": 5, "test": [6, 12], "tf": 2, "than": 11, "them": 3, "therefor": 3, "thermal": 6, "thi": [0, 3, 6, 7, 8, 9, 10, 11, 12, 13], "those": 13, "through": 4, "thu": 8, "ti": 9, "time": [1, 4, 6, 9, 12, 13], "timeseri": 0, "timestamp": 9, "tini": 7, "tm": 9, "token": [10, 12], "tool": [1, 6, 7, 12], "toolkit": 6, "top": 13, "total": [9, 13], "track": [1, 6, 8, 9, 10, 11, 12], "track_emiss": [0, 2, 4, 12], "tracker": [2, 6, 9, 10, 11, 12], "tracking_mod": [9, 10, 12], "train": [0, 1, 2, 7, 8, 12], "train_model": [0, 2], "training_loop": 12, "transf": 7, "trigger": [9, 11], "true": [0, 2, 9, 10, 11, 12], "try": [3, 6, 10, 12], "tv": 13, "two": [0, 6, 12], "typic": 11, "u": [6, 7, 9, 10], "ubiquit": 8, "ui": 1, "unchang": 12, "under": 12, "underli": [6, 8], "understand": 13, "unfortun": 3, "up": [9, 10, 12], "updat": 10, "upload": 0, "url": 10, "us": [0, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13], "usa": 9, "usabl": [6, 11], "usag": [4, 10], "user": [6, 10, 12, 13], "usernam": 6, "usr": 6, "usual": 9, "uuid": 12, "v100": 7, "v3": 10, "valid": 11, "valu": [6, 9, 12], "variabl": [10, 12], "variou": [8, 11, 13], "vast": 8, "ve": 1, "verbos": 10, "version": [9, 12], "via": [3, 8], "victor": 12, "view": [1, 3], "virtual": 5, "vision": 7, "visual": [1, 4], "visudo": 6, "vit": 7, "voil\u00e0": 1, "w": 9, "wai": 12, "want": [6, 12], "warm": 8, "warn": [10, 12], "watch": 13, "watt": 6, "we": [3, 5, 6, 8, 12], "web": [0, 12], "webhook": 9, "websit": [1, 5], "week": 8, "weekli": 13, "weight": 6, "welcom": 6, "well": 3, "what": 3, "when": [1, 3, 6, 9, 10, 12], "where": [9, 10, 12], "which": [6, 8, 10, 12], "who": 13, "wikipedia": 12, "wind": 6, "window": [6, 9], "within": 12, "without": [6, 12], "wonder": 12, "work": [3, 8, 12], "world": [3, 6], "would": [7, 8], "wrap": 12, "wren": 3, "write": 12, "written": [10, 12], "x": 9, "x_test": 2, "x_train": 2, "y": 9, "y_test": 2, "y_train": 2, "year": [4, 8], "yet": 12, "yield": 12, "york": 10, "you": [0, 1, 3, 6, 9, 12, 13], "your": [0, 1, 3, 5, 6, 9, 12, 13], "yourself": 6, "zone": 10}, "titles": ["CodeCarbon API", "Comet Integration", "Examples", "Frequently Asked Questions", "CodeCarbon", "Installing CodeCarbon", "Methodology", "Model Comparisons", "Motivation", "Output", "Parameters", "Collecting emissions to a logger", "Quickstart", "Visualize"], "titleterms": {"access": 12, "across": 6, "ai": 7, "an": 11, "api": [0, 9], "appl": 6, "ask": 3, "authent": 11, "beta": 13, "carbon": [6, 13], "chip": 6, "cloud": [7, 11, 13], "codecarbon": [0, 4, 5, 6, 9], "collect": 11, "comet": 1, "command": 12, "comparison": [7, 13], "conda": 5, "configur": 12, "consumpt": 7, "context": [2, 12], "countri": 13, "cpu": 6, "creat": 11, "csv": 9, "data": 9, "decor": [2, 12], "depend": 5, "detail": 13, "each": 9, "electr": [7, 13], "emiss": 11, "emissiontrack": 11, "energi": 6, "equival": 13, "exampl": [2, 11], "experi": 9, "explicit": [2, 12], "field": 9, "frequent": 3, "from": [5, 13], "get": 4, "global": 13, "googl": 11, "gpu": 6, "how": [6, 9], "http": 9, "impact": 7, "indic": 4, "input": 10, "instal": 5, "instanc": 7, "integr": 1, "intens": [6, 13], "internet": 12, "introduct": 4, "line": 12, "local": 9, "log": [4, 9, 11], "logfir": 9, "logger": [9, 11], "m1": 6, "m2": 6, "manag": [2, 12], "methodologi": 6, "mode": [10, 12], "model": 7, "more": 13, "motiv": 8, "object": [2, 12], "offlin": [10, 12, 13], "offlineemissionstrack": 10, "onlin": [12, 13], "output": [9, 10], "paramet": 10, "per": 13, "power": 6, "prioriti": 12, "product": 13, "prometheu": 9, "proxi": 12, "pypi": 5, "python": 11, "question": 3, "quickstart": 12, "ram": 6, "refer": [6, 7], "region": [7, 13], "repositori": 5, "server": 12, "silicon": 6, "sourc": 6, "specif": 10, "start": 4, "summari": 13, "tabl": 4, "test": 9, "through": 12, "time": 7, "track_emiss": 10, "us": [2, 9], "usag": 6, "visual": 13, "work": 6, "year": 7}}) \ No newline at end of file +Search.setIndex({"docnames": [".venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/LICENSE", ".venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/LICENSE", ".venv/lib/python3.11/site-packages/alabaster-0.7.16.dist-info/LICENSE", ".venv/lib/python3.11/site-packages/imagesize-1.4.1.dist-info/LICENSE", ".venv/lib/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/base", ".venv/lib/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/class", ".venv/lib/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/module", ".venv/lib64/python3.11/site-packages/Jinja2-3.1.3.dist-info/LICENSE", ".venv/lib64/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/LICENSE", ".venv/lib64/python3.11/site-packages/alabaster-0.7.16.dist-info/LICENSE", ".venv/lib64/python3.11/site-packages/imagesize-1.4.1.dist-info/LICENSE", ".venv/lib64/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/base", ".venv/lib64/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/class", ".venv/lib64/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/module", "api", "comet", "examples", "faq", "index", "installation", "methodology", "model_examples", "motivation", "output", "parameters", "to_logger", "usage", "visualize"], "filenames": [".venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/LICENSE.rst", ".venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/LICENSE.rst", ".venv/lib/python3.11/site-packages/alabaster-0.7.16.dist-info/LICENSE.rst", ".venv/lib/python3.11/site-packages/imagesize-1.4.1.dist-info/LICENSE.rst", ".venv/lib/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/base.rst", ".venv/lib/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/class.rst", ".venv/lib/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/module.rst", ".venv/lib64/python3.11/site-packages/Jinja2-3.1.3.dist-info/LICENSE.rst", ".venv/lib64/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/LICENSE.rst", ".venv/lib64/python3.11/site-packages/alabaster-0.7.16.dist-info/LICENSE.rst", ".venv/lib64/python3.11/site-packages/imagesize-1.4.1.dist-info/LICENSE.rst", ".venv/lib64/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/base.rst", ".venv/lib64/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/class.rst", ".venv/lib64/python3.11/site-packages/sphinx/ext/autosummary/templates/autosummary/module.rst", "api.rst", "comet.rst", "examples.rst", "faq.rst", "index.rst", "installation.rst", "methodology.rst", "model_examples.rst", "motivation.rst", "output.rst", "parameters.rst", "to_logger.rst", "usage.rst", "visualize.rst"], "titles": ["<no title>", "<no title>", "<no title>", "The MIT License (MIT)", "<no title>", "<no title>", "<no title>", "<no title>", "<no title>", "<no title>", "The MIT License (MIT)", "<no title>", "<no title>", "<no title>", "CodeCarbon API", "Comet Integration", "Examples", "Frequently Asked Questions", "CodeCarbon", "Installing CodeCarbon", "Methodology", "Model Comparisons", "Motivation", "Output", "Parameters", "Collecting emissions to a logger", "Quickstart", "Visualize"], "terms": {"copyright": [0, 1, 2, 3, 7, 8, 9, 10], "2007": [0, 7], "pallet": [0, 1, 7, 8], "redistribut": [0, 1, 2, 7, 8, 9], "us": [0, 1, 2, 3, 7, 8, 9, 10, 14, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27], "sourc": [0, 1, 2, 7, 8, 9, 17, 21], "binari": [0, 1, 2, 7, 8, 9], "form": [0, 1, 2, 7, 8, 9], "without": [0, 1, 2, 3, 7, 8, 9, 10, 20, 26], "modif": [0, 1, 2, 7, 8, 9], "ar": [0, 1, 2, 7, 8, 9, 16, 17, 19, 20, 21, 22, 23, 24, 25, 27], "permit": [0, 1, 2, 3, 7, 8, 9, 10], "provid": [0, 1, 2, 3, 7, 8, 9, 10, 15, 20, 23, 24, 25, 26, 27], "follow": [0, 1, 2, 3, 7, 8, 9, 10, 16, 17, 19, 20, 21, 23, 24, 26, 27], "condit": [0, 1, 2, 3, 7, 8, 9, 10, 23], "met": [0, 1, 2, 7, 8, 9], "code": [0, 1, 2, 7, 8, 9, 14, 15, 17, 23, 24, 26], "must": [0, 1, 2, 7, 8, 9, 26], "retain": [0, 1, 2, 7, 8, 9], "abov": [0, 1, 2, 3, 7, 8, 9, 10, 19, 20], "notic": [0, 1, 2, 3, 7, 8, 9, 10], "thi": [0, 1, 2, 3, 7, 8, 9, 10, 14, 17, 20, 21, 22, 23, 24, 25, 26, 27], "list": [0, 1, 2, 7, 8, 9, 19, 20, 24, 26], "disclaim": [0, 1, 2, 7, 8, 9], "reproduc": [0, 1, 2, 7, 8, 9, 15], "document": [0, 1, 2, 3, 7, 8, 9, 10, 25, 26], "other": [0, 1, 2, 3, 7, 8, 9, 10, 16, 17, 20, 22, 25], "materi": [0, 1, 2, 7, 8, 9], "distribut": [0, 1, 2, 3, 7, 8, 9, 10], "neither": [0, 1, 7, 8, 17, 20], "name": [0, 1, 2, 7, 8, 9, 19, 23, 24, 25, 26], "holder": [0, 1, 2, 3, 7, 8, 9, 10], "nor": [0, 1, 7, 8, 20], "its": [0, 1, 7, 8, 17, 20, 21, 23, 25, 27], "contributor": [0, 1, 2, 7, 8, 9], "mai": [0, 1, 2, 7, 8, 9, 25], "endors": [0, 1, 2, 7, 8, 9], "promot": [0, 1, 2, 7, 8, 9], "product": [0, 1, 2, 7, 8, 9, 20], "deriv": [0, 1, 2, 7, 8, 9, 23], "from": [0, 1, 2, 3, 7, 8, 9, 10, 14, 15, 16, 17, 18, 20, 21, 23, 24, 25, 26], "softwar": [0, 1, 2, 3, 7, 8, 9, 10], "specif": [0, 1, 2, 7, 8, 9, 18, 20, 22, 25, 26], "prior": [0, 1, 2, 7, 8, 9], "written": [0, 1, 2, 7, 8, 9, 24, 26], "permiss": [0, 1, 2, 3, 7, 8, 9, 10], "i": [0, 1, 2, 3, 7, 8, 9, 10, 17, 19, 20, 22, 23, 24, 25, 26, 27], "BY": [0, 1, 2, 7, 8, 9], "THE": [0, 1, 2, 3, 7, 8, 9, 10], "AND": [0, 1, 2, 3, 7, 8, 9, 10], "AS": [0, 1, 2, 3, 7, 8, 9, 10], "ani": [0, 1, 2, 3, 7, 8, 9, 10, 17, 20, 26], "express": [0, 1, 2, 3, 7, 8, 9, 10, 20, 22, 23], "OR": [0, 1, 2, 3, 7, 8, 9, 10], "impli": [0, 1, 2, 3, 7, 8, 9, 10], "warranti": [0, 1, 2, 3, 7, 8, 9, 10], "includ": [0, 1, 2, 3, 7, 8, 9, 10, 20, 24], "BUT": [0, 1, 2, 3, 7, 8, 9, 10], "NOT": [0, 1, 2, 3, 7, 8, 9, 10], "limit": [0, 1, 2, 3, 7, 8, 9, 10], "TO": [0, 1, 2, 3, 7, 8, 9, 10], "OF": [0, 1, 2, 3, 7, 8, 9, 10], "merchant": [0, 1, 2, 3, 7, 8, 9, 10], "fit": [0, 1, 2, 3, 7, 8, 9, 10, 16], "FOR": [0, 1, 2, 3, 7, 8, 9, 10], "A": [0, 1, 2, 3, 7, 8, 9, 10, 24, 25, 26, 27], "particular": [0, 1, 2, 3, 7, 8, 9, 10, 27], "purpos": [0, 1, 2, 3, 7, 8, 9, 10, 22], "IN": [0, 1, 2, 3, 7, 8, 9, 10], "NO": [0, 1, 2, 3, 7, 8, 9, 10], "event": [0, 1, 2, 3, 7, 8, 9, 10], "shall": [0, 1, 2, 3, 7, 8, 9, 10], "BE": [0, 1, 2, 3, 7, 8, 9, 10], "liabl": [0, 1, 2, 3, 7, 8, 9, 10], "direct": [0, 1, 2, 7, 8, 9, 17], "indirect": [0, 1, 2, 7, 8, 9], "incident": [0, 1, 2, 7, 8, 9], "special": [0, 1, 2, 7, 8, 9], "exemplari": [0, 1, 2, 7, 8, 9, 27], "consequenti": [0, 1, 2, 7, 8, 9], "damag": [0, 1, 2, 3, 7, 8, 9, 10], "procur": [0, 1, 2, 7, 8, 9], "substitut": [0, 1, 2, 7, 8, 9], "good": [0, 1, 2, 7, 8, 9, 17, 20, 23], "servic": [0, 1, 2, 7, 8, 9, 23], "loss": [0, 1, 2, 7, 8, 9, 16], "data": [0, 1, 2, 7, 8, 9, 14, 15, 16, 17, 20, 22, 24, 25, 27], "profit": [0, 1, 2, 7, 8, 9], "busi": [0, 1, 2, 7, 8, 9], "interrupt": [0, 1, 2, 7, 8, 9], "howev": [0, 1, 2, 7, 8, 9, 20, 26], "caus": [0, 1, 2, 7, 8, 9], "ON": [0, 1, 2, 7, 8, 9], "theori": [0, 1, 2, 7, 8, 9], "liabil": [0, 1, 2, 3, 7, 8, 9, 10], "whether": [0, 1, 2, 3, 7, 8, 9, 10], "contract": [0, 1, 2, 3, 7, 8, 9, 10], "strict": [0, 1, 2, 7, 8, 9], "tort": [0, 1, 2, 3, 7, 8, 9, 10], "neglig": [0, 1, 2, 7, 8, 9], "otherwis": [0, 1, 2, 3, 7, 8, 9, 10, 25], "aris": [0, 1, 2, 3, 7, 8, 9, 10], "wai": [0, 1, 2, 7, 8, 9, 26], "out": [0, 1, 2, 3, 7, 8, 9, 10, 17], "even": [0, 1, 2, 7, 8, 9, 17], "IF": [0, 1, 2, 7, 8, 9], "advis": [0, 1, 2, 7, 8, 9], "possibl": [0, 1, 2, 7, 8, 9, 20], "SUCH": [0, 1, 2, 7, 8, 9], "2010": [1, 2, 8, 9], "c": [2, 9, 19, 20, 26], "2020": [2, 9], "jeff": [2, 9], "forcier": [2, 9], "base": [2, 9, 20, 21, 23, 25, 26], "origin": [2, 9], "work": [2, 9, 17, 22, 26], "2011": [2, 9], "kenneth": [2, 9], "reitz": [2, 9], "armin": [2, 9], "ronach": [2, 9], "some": [2, 9, 25, 26], "right": [2, 3, 9, 10, 20, 21, 27], "reserv": [2, 9], "theme": [2, 9], "The": [2, 9, 14, 19, 20, 21, 23, 24, 25, 26, 27], "owner": [2, 9], "2016": [3, 10], "yoshiki": [3, 10], "shibukawa": [3, 10], "herebi": [3, 10], "grant": [3, 10], "free": [3, 10, 15, 24], "charg": [3, 10], "person": [3, 10, 15], "obtain": [3, 10], "copi": [3, 10, 15], "associ": [3, 10, 20], "file": [3, 10, 14, 15, 20, 23, 24, 25, 26, 27], "deal": [3, 10], "restrict": [3, 10, 26], "modifi": [3, 10, 20, 26], "merg": [3, 10], "publish": [3, 10, 17], "sublicens": [3, 10], "sell": [3, 10], "whom": [3, 10], "furnish": [3, 10], "do": [3, 10, 14, 17, 20, 26], "so": [3, 10, 14, 17, 20, 23, 24, 26], "subject": [3, 10], "all": [3, 10, 14, 17, 20, 23, 26, 27], "substanti": [3, 10], "portion": [3, 10], "kind": [3, 10], "noninfring": [3, 10], "author": [3, 10], "claim": [3, 10], "an": [3, 10, 14, 15, 17, 20, 23, 26, 27], "action": [3, 10], "connect": [3, 10, 25, 27], "WITH": [3, 10], "fullnam": [4, 5, 6, 11, 12, 13], "escap": [4, 5, 6, 11, 12, 13], "underlin": [4, 5, 6, 11, 12, 13], "block": [6, 13, 26], "modul": [6, 13, 18], "rubric": [6, 13], "item": [6, 13], "endfor": [6, 13], "endif": [6, 13], "endblock": [6, 13], "mode": [14, 18, 20, 23], "upload": 14, "timeseri": 14, "your": [14, 15, 17, 19, 20, 23, 26, 27], "emiss": [14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 26, 27], "central": [14, 25], "server": [14, 18, 23], "public": [14, 15, 17, 26, 27], "befor": 14, "you": [14, 15, 17, 20, 23, 26, 27], "need": [14, 15, 20, 23, 25, 26, 27], "experiment_id": [14, 24, 26], "get": [14, 15, 24, 26, 27], "one": [14, 17, 23, 24, 25, 27], "run": [14, 15, 17, 19, 23, 24, 26, 27], "init": 14, "It": [14, 17, 20, 23, 25, 26], "creat": [14, 15, 18, 19, 26], "default": [14, 15, 17, 20, 23, 24, 25, 26, 27], "project": [14, 16, 17, 23, 24, 25, 27], "save": [14, 15, 25, 26], "config": [14, 26], "Then": [14, 20], "can": [14, 15, 17, 20, 21, 22, 23, 25, 26, 27], "tell": 14, "monitor": [14, 23, 26], "machin": [14, 22, 23, 24], "Or": [14, 26], "import": [14, 16, 22, 25, 26], "track_emiss": [14, 16, 18, 26], "save_to_api": [14, 24, 26], "true": [14, 16, 23, 24, 25, 26], "def": [14, 16, 26], "train_model": [14, 16], "gpu": [14, 21, 23, 24, 26], "intens": [14, 17, 18, 21, 24, 26], "train": [14, 15, 16, 21, 22, 26], "goe": [14, 26], "here": [14, 17, 19, 20, 21, 25, 26], "__name__": [14, 16], "__main__": [14, 16], "more": [14, 15, 20, 22, 26], "option": [14, 17, 20, 24, 25, 26, 27], "could": [14, 20, 21, 24, 26], "specifi": [14, 23, 24, 25], "dashboard": 14, "have": [14, 15, 17, 20, 21, 22, 23, 24, 26], "nice": 14, "web": [14, 26], "interfac": [14, 23], "own": [14, 21], "organ": 14, "openapi": 14, "And": [14, 15], "team": 14, "experi": [14, 15, 22, 24, 26, 27], "set": [14, 15, 23, 24, 25, 26], "id": [14, 23, 24], "two": [14, 20, 26], "In": [14, 15, 20, 21, 22, 25, 26], "measure_power_sec": [14, 20, 24, 26], "30": 14, "api_call_interv": [14, 24, 26], "4": [14, 21, 26], "codecarbon": [15, 16, 17, 21, 24, 25, 26, 27], "automat": 15, "track": [15, 20, 22, 23, 24, 25, 26], "visual": [15, 18], "scientist": 15, "power": [15, 18, 22, 23, 24, 25, 27], "tool": [15, 20, 21, 26], "compar": [15, 21, 27], "explain": 15, "now": [15, 27], "easili": 15, "carbon": [15, 17, 18, 21, 22, 26], "footprint": [15, 17, 20, 22], "job": 15, "along": [15, 19, 26], "metric": [15, 16, 23], "hyperparamet": 15, "dataset": [15, 16, 26], "sampl": 15, "artifact": [15, 24], "To": [15, 19, 20], "start": [15, 16, 20, 23, 25, 26], "make": [15, 17, 20], "sure": 15, "ml": 15, "instal": [15, 18, 20], "pip": [15, 19], "comet_ml": 15, "3": [15, 19, 20, 21, 23, 24, 26], "2": [15, 16, 21, 23, 24], "go": [15, 22, 23], "": [15, 20, 22, 23, 24, 26, 27], "websit": [15, 19], "account": [15, 20], "page": [15, 18], "api": [15, 18, 24, 26, 27], "kei": [15, 24], "mnist": [15, 16], "py": [15, 19, 23, 25], "exampl": [15, 18, 20, 22, 23, 24, 26, 27], "replac": 15, "placehold": 15, "api_kei": [15, 24], "click": [15, 19, 27], "link": 15, "stdout": 15, "taken": 15, "back": [15, 20], "ui": 15, "ll": 15, "see": [15, 20, 23, 24, 25, 26, 27], "graph": [15, 21], "definit": 15, "system": [15, 23, 25], "environ": [15, 19, 23, 26], "detail": [15, 24, 26], "emissionstrack": [15, 16, 25, 26], "object": [15, 18, 22, 24], "packag": [15, 17, 19, 20, 22, 23, 25, 27], "when": [15, 17, 20, 23, 24, 26], "panel": 15, "tab": 15, "left": [15, 27], "sidebar": 15, "add": [15, 17, 20, 24, 25], "galleri": 15, "search": [15, 18, 23], "onc": [15, 23], "ve": 15, "found": [15, 20, 26], "render": 15, "view": [15, 17], "voil\u00e0": 15, "everi": [15, 20, 24], "time": [15, 18, 20, 23, 26, 27], "abl": [15, 23], "alongsid": 15, "everyth": [15, 26], "els": 15, "research": [15, 17], "deep": [16, 21], "learn": [16, 21, 22], "model": [16, 18, 22, 26], "recogn": [16, 17, 22], "digit": 16, "imag": [16, 22], "tensorflow": 16, "tf": 16, "kera": 16, "x_train": 16, "y_train": 16, "x_test": 16, "y_test": 16, "load_data": 16, "255": 16, "0": [16, 20, 21, 23, 26], "sequenti": 16, "layer": 16, "flatten": 16, "input_shap": 16, "28": 16, "dens": [16, 21], "128": 16, "activ": [16, 19, 27], "relu": 16, "dropout": 16, "10": [16, 23, 26], "loss_fn": 16, "sparsecategoricalcrossentropi": 16, "from_logit": 16, "compil": 16, "optim": 16, "adam": 16, "accuraci": 16, "tracker": [16, 20, 23, 24, 25, 26], "epoch": 16, "float": [16, 25], "stop": [16, 20, 23, 25, 26], "print": 16, "project_nam": [16, 23, 24, 26], "return": [16, 26], "avail": [16, 17, 20, 23, 24, 25, 26, 27], "github": [16, 24], "repositori": [16, 18], "how": [17, 26], "accur": [17, 20], "estim": [17, 20, 21, 22, 24], "hard": 17, "quantifi": [17, 20], "entireti": 17, "comput": [17, 20, 21, 22, 23, 26], "becaus": [17, 26], "mani": 17, "factor": [17, 20, 24], "plai": [17, 22], "notabl": 17, "life": [17, 27], "cycl": 17, "infrastructur": [17, 20, 23, 24, 26, 27], "we": [17, 19, 20, 22, 26], "therefor": 17, "onli": [17, 20, 24], "focu": 17, "produc": [17, 22, 27], "actual": 17, "much": 17, "done": [17, 23], "improv": [17, 20], "what": 17, "energi": [17, 21, 22, 23, 27], "For": [17, 19, 22, 23, 24, 26], "cloud": [17, 20, 23, 24], "googl": [17, 24], "electr": [17, 20, 22, 26], "platform": [17, 23], "unfortun": 17, "amazon": 17, "ha": [17, 20, 21, 22, 23, 26, 27], "made": 17, "habit": 17, "keep": [17, 26], "inform": [17, 26, 27], "about": [17, 26], "although": 17, "releas": 17, "global": [17, 20, 22, 24, 26], "doe": 17, "datacent": 17, "microsoft": [17, 21], "sustain": 17, "calcul": [17, 20], "help": [17, 20, 24], "enterpris": 17, "analyz": 17, "IT": 17, "But": 17, "privat": [17, 23, 25, 26], "infra": 17, "ourworld": 17, "mix": [17, 20, 27], "countri": [17, 20, 23, 24, 26], "find": [17, 20], "globalpetrolpric": 17, "com": [17, 24], "multipli": 17, "world": [17, 20], "averag": [17, 20, 21, 27], "475": [17, 20], "gco2": [17, 20], "eq": [17, 20], "kwh": [17, 20, 21, 23], "iea": 17, "offset": 17, "my": 17, "There": 17, "scheme": 17, "recommend": [17, 19, 26, 27], "singl": [17, 26], "shot": 17, "gold": 17, "standard": [17, 22, 24], "often": 17, "choos": [17, 24], "differ": [17, 20, 21, 22, 27], "price": 17, "local": [17, 20, 25, 26], "initi": [17, 26], "well": 17, "try": [17, 20, 24, 26], "exist": [17, 20, 24, 26, 27], "region": [17, 18, 23, 24, 26], "recur": 17, "wren": 17, "let": 17, "monthli": 17, "them": 17, "via": [17, 22], "subscript": 17, "mind": 17, "choic": 17, "reduc": [17, 23], "should": [17, 20, 24], "prioriti": [17, 18], "If": [17, 20, 23, 26, 27], "function": [17, 24, 26], "miss": 17, "repo": 17, "pleas": [17, 19, 20, 25, 26], "open": [17, 20], "issu": [17, 20], "did": 17, "our": [17, 20], "best": 17, "cover": 17, "case": [17, 21, 23, 26, 27], "count": 17, "commun": 17, "greater": 17, "success": 17, "motiv": 18, "methodologi": 18, "usag": [18, 24], "refer": [18, 19, 25, 26], "comparison": 18, "impact": [18, 22, 24], "year": [18, 22], "frequent": [18, 20], "ask": [18, 23], "question": 18, "pypi": 18, "conda": 18, "depend": [18, 22, 26], "quickstart": 18, "onlin": 18, "offlin": 18, "configur": [18, 20, 23], "access": 18, "internet": 18, "through": 18, "proxi": 18, "paramet": [18, 20, 23, 26], "input": [18, 23], "output": [18, 25], "explicit": 18, "context": 18, "manag": [18, 19], "decor": [18, 24], "comet": 18, "integr": 18, "csv": [18, 24, 26, 27], "prometheu": 18, "logfir": 18, "http": [18, 24, 26], "logger": [18, 24, 27], "collect": [18, 23], "beta": [18, 24], "index": 18, "virtual": 19, "easier": 19, "instruct": 19, "offici": 19, "host": [19, 23, 24, 26, 27], "command": [19, 20, 27], "termin": 19, "forg": 19, "python": [19, 26], "7": [19, 21], "itself": [19, 20], "arrow": 19, "panda": 19, "pynvml": [19, 20], "request": [19, 26], "psutil": 19, "cpuinfo": 19, "rapidfuzz": 19, "prometheus_cli": 19, "setup": 19, "latest": 19, "dioxid": [20, 22], "co\u2082": [20, 22, 23], "kilogram": [20, 22], "equival": [20, 21, 22, 23], "co\u2082eq": [20, 22, 23], "main": 20, "consum": [20, 22, 27], "g": [20, 23], "emit": [20, 21, 22], "per": [20, 22, 23, 24], "kilowatt": [20, 22], "hour": [20, 21, 22], "e": [20, 23], "weight": 20, "gener": [20, 22, 26, 27], "fossil": [20, 22], "fuel": [20, 22], "renew": 20, "toolkit": 20, "coal": 20, "petroleum": 20, "natur": 20, "ga": 20, "known": [20, 24], "amount": [20, 22, 27], "each": [20, 26, 27], "low": [20, 24], "solar": 20, "hydroelectr": 20, "biomass": 20, "geotherm": 20, "nearbi": 20, "grid": [20, 22, 27], "contain": [20, 27], "mixtur": 20, "call": [20, 23, 24, 26], "don": 20, "t": [20, 26], "tabl": [20, 21], "kg": [20, 23], "mwh": 20, "995": 20, "816": 20, "743": 20, "38": 20, "26": 20, "nuclear": 20, "29": 20, "48": 20, "wind": 20, "25": 20, "35": 20, "14": 20, "net": [20, 27], "731": 20, "59": 20, "kgco\u2082": 20, "ever": [20, 27], "appli": 20, "As": [20, 22], "still": [20, 25], "room": 20, "contribut": 20, "welcom": 20, "suppli": 20, "underli": [20, 22], "hardwar": [20, 24], "interv": [20, 23, 24], "valu": [20, 23, 26], "15": [20, 24], "second": [20, 23, 24], "pass": [20, 26], "instanti": [20, 26], "current": [20, 22, 23, 24, 26, 27], "support": [20, 24, 25, 26], "nvidia": [20, 23], "consumpt": [20, 24, 27], "librari": [20, 26], "watt": 20, "8": [20, 21, 23, 24], "gb": 20, "ratio": 20, "measur": [20, 21, 22, 24, 26], "satisfi": 20, "idea": 20, "enhanc": [20, 23], "hesit": 20, "On": [20, 21], "window": [20, 23], "mac": 20, "intel": [20, 23], "processor": [20, 22], "gadget": 20, "yourself": 20, "both": [20, 22, 26], "powermetr": 20, "nativ": 20, "usabl": [20, 25], "sudo": 20, "knowledg": 20, "administr": 20, "know": 20, "solut": 20, "propos": 20, "give": 20, "enter": 20, "password": 20, "sudoer": 20, "visudo": 20, "line": [20, 21], "end": [20, 24], "usernam": 20, "root": 20, "nopasswd": 20, "usr": 20, "bin": 20, "want": [20, 26], "user": [20, 24, 26, 27], "fall": 20, "constant": 20, "linux": 20, "amd": 20, "rapl": 20, "sy": 20, "class": [20, 23, 25], "powercap": 20, "directori": [20, 23, 24, 26], "u": [20, 21, 23, 24], "note": [20, 26, 27], "mention": 20, "path": [20, 24, 27], "none": [20, 24], "resourc": 20, "switch": [20, 27], "fallback": 20, "first": [20, 21, 23, 25, 26], "detect": 20, "which": [20, 22, 24, 26], "map": 20, "2000": 20, "correspond": [20, 24, 26], "thermal": 20, "design": 20, "tdp": 20, "assum": 20, "50": 20, "approxim": 20, "show": [20, 21, 27], "statist": 20, "relationship": 20, "between": [20, 24], "empir": 20, "test": [20, 26], "decent": 20, "dure": [20, 22], "report": [20, 25], "environment": [20, 21, 22], "awar": [20, 26], "part": [20, 22], "algorithm": 20, "schedul": [20, 26], "signific": [20, 22], "overhead": [20, 26], "fast": 20, "light": [20, 21], "small": [20, 21, 26], "memori": 20, "method": 20, "popular": 21, "nlp": 21, "vision": 21, "h": [21, 23], "bert": 21, "fintetun": 21, "v100": 21, "6": 21, "1": [21, 23, 24, 26], "pretrain": 21, "36": 21, "37": 21, "6b": 21, "transf": 21, "256": 21, "a100": 21, "192": 21, "13": 21, "812": 21, "121": 21, "p40": 21, "02": 21, "169": 21, "03": 21, "201": 21, "04": 21, "vit": 21, "tini": 21, "19": 21, "21": 21, "larg": [21, 22], "90": 21, "93": 21, "huge": 21, "216": 21, "237": 21, "would": [21, 22], "languag": 21, "locat": [21, 24], "studi": 21, "might": 21, "relev": 21, "most": [21, 27], "localis": 21, "great": 21, "below": [21, 27], "azur": [21, 23], "develop": [21, 22, 23, 26], "result": [21, 23, 26], "11": [21, 23], "describ": 21, "displai": [21, 23, 27], "black": 21, "repres": 21, "across": [21, 22, 23, 27], "blue": 21, "fourth": 21, "quartil": 21, "side": [21, 27], "point": [21, 26, 27], "protect": [21, 23], "agenc": 21, "nb": 21, "present": 21, "log": [21, 24, 27], "scale": 21, "anoth": [21, 27], "polici": 21, "consider": 21, "recent": 22, "artifici": 22, "intellig": 22, "becom": 22, "remark": 22, "effici": 22, "perform": 22, "human": 22, "level": [22, 24, 25, 27], "task": [22, 26], "face": 22, "drive": 22, "car": 22, "sophist": 22, "game": 22, "like": [22, 26], "chess": 22, "order": [22, 24, 25], "achiev": 22, "incred": 22, "approach": 22, "leverag": [22, 25], "vast": 22, "pattern": 22, "featur": 22, "thu": 22, "state": [22, 23, 24], "art": 22, "advanc": 22, "week": 22, "month": 22, "consequ": 22, "enorm": 22, "process": [22, 23, 24, 25, 26, 27], "entail": 22, "greenhous": 22, "gase": 22, "With": 22, "ai": 22, "ubiquit": 22, "deploi": [22, 23], "sector": 22, "industri": 22, "also": [22, 25, 26, 27], "grow": 22, "reason": 22, "curtail": 22, "enabl": [22, 26], "program": 22, "warm": 22, "potenti": 22, "variou": [22, 25, 27], "matter": 22, "fact": 22, "broader": 22, "combust": 22, "built": [23, 27], "output_dir": [23, 24, 26], "descript": [23, 24], "timestamp": 23, "y": 23, "m": 23, "dt": 23, "format": 23, "durat": 23, "emissions_r": 23, "divid": [23, 27], "cpu_pow": 23, "cpu": 23, "w": 23, "gpu_pow": 23, "ram_pow": 23, "ram": 23, "cpu_energi": 23, "gpu_energi": 23, "ram_energi": 23, "energy_consum": 23, "sum": 23, "country_nam": 23, "where": [23, 24, 26], "country_iso_cod": [23, 24, 26], "letter": [23, 24, 26], "alphabet": [23, 26], "iso": [23, 24, 26], "respect": [23, 26], "provinc": [23, 24], "citi": [23, 24], "on_cloud": 23, "n": 23, "cloud_provid": [23, 24], "One": 23, "major": 23, "aw": 23, "gcp": 23, "cloud_region": [23, 24], "geograph": 23, "east": 23, "brazilsouth": 23, "asia": 23, "east1": 23, "o": [23, 26], "devic": 23, "19044": 23, "sp0": 23, "python_vers": 23, "cpu_count": 23, "number": [23, 24, 27], "cpu_model": 23, "r": 23, "core": 23, "tm": 23, "i7": 23, "1065g7": 23, "30ghz": 23, "gpu_count": 23, "gpu_model": 23, "x": 23, "geforc": 23, "gtx": 23, "1080": 23, "ti": 23, "longitud": 23, "precis": 23, "rang": 23, "km": 23, "123": 23, "km\u00b2": 23, "privaci": 23, "latitud": 23, "ram_total_s": 23, "total": [23, 27], "tracking_mod": [23, 24, 26], "requir": [23, 24, 26], "databas": 23, "implement": [23, 26], "custom": 23, "baseoutput": 23, "target": 23, "given": 23, "evalu": 23, "rule": 23, "trigger": [23, 25], "alert": 23, "observ": 23, "expos": 23, "suffix": 23, "codecarbon_": [23, 26], "version": [23, 26], "pushgatewai": 23, "auth": 23, "prometheus_usernam": 23, "prometheus_password": 23, "push": 23, "docker": [23, 26], "compos": [23, 26], "up": [23, 24, 26], "emissiontrack": 23, "usual": 23, "save_to_prometheu": 23, "offlineemissionstrack": [23, 26], "self": 23, "usa": 23, "localhost": [23, 26], "9090": 23, "save_to_logfir": 23, "appear": 23, "allow": [23, 25, 26], "webhook": 23, "send": [23, 24, 25, 26], "histor": 23, "place": 23, "By": 23, "noth": 23, "sent": [23, 27], "addit": [24, 26], "entir": 24, "isol": 24, "gpu_id": [24, 26], "log_level": [24, 26], "verbos": 24, "debug": [24, 25, 26], "info": [24, 25], "warn": [24, 26], "error": 24, "critic": [24, 25], "co2_signal_api_token": [24, 26], "token": [24, 26], "co2sign": 24, "sign": 24, "pue": 24, "effect": 24, "center": 24, "being": [24, 27], "multipl": 24, "hi": 24, "old": 24, "new": 24, "green": 24, "save_to_fil": [24, 26], "boolean": 24, "variabl": [24, 26], "indic": 24, "output_fil": 24, "on_csv_writ": 24, "flush": [24, 26], "manual": [24, 26], "updat": 24, "run_id": 24, "row": 24, "eras": 24, "former": 24, "append": 24, "fals": [24, 26], "api_endpoint": 24, "url": 24, "endpoint": [24, 26], "io": 24, "mandatori": 24, "save_to_logg": [24, 25], "dedic": [24, 25], "logging_logg": [24, 25], "loggeroutput": [24, 25], "encapsul": 24, "logger_preambl": 24, "string": 24, "systemat": 24, "messag": [24, 25], "global_energy_mix": 24, "json": 24, "canada": 24, "california": 24, "york": 24, "mlco2": 24, "blob": 24, "master": 24, "country_2letter_iso_cod": 24, "electricitymap": 24, "org": 24, "v3": 24, "zone": 24, "argument": [24, 27], "fn": 24, "googlecloudloggeroutput": 25, "subclass": 25, "distinct": 25, "than": 25, "build": [25, 26], "etc": 25, "parallel": 25, "offlineemissiontrack": 25, "lack": 25, "network": 25, "forbid": 25, "stream": 25, "collector": 25, "_logger": 25, "getlogg": 25, "log_nam": 25, "handler": 25, "after": 25, "_channel": 25, "filehandl": 25, "addhandl": 25, "typic": 25, "filter": 25, "setlevel": 25, "my_logg": 25, "client": 25, "sdk": 25, "google_project_nam": 25, "valid": 25, "demonstr": 25, "logging_demo": 25, "co2": 26, "framework": 26, "minim": 26, "just": 26, "prompt": 26, "same": 26, "ctrl": 26, "cli": [26, 27], "8008": 26, "yet": 26, "come": [26, 27], "soon": 26, "absenc": 26, "entri": 26, "section": 26, "_": 26, "final": 26, "jupyt": 26, "notebook": 26, "begin": 26, "last": 26, "cell": 26, "record": 26, "write": 26, "disk": 26, "piec": 26, "infer": 26, "bert_infer": 26, "start_task": 26, "load": 26, "load_dataset": 26, "imdb": 26, "split": 26, "imdb_emiss": 26, "stop_task": 26, "build_model": 26, "model_emiss": 26, "prevent": 26, "uuid": 26, "normal": 26, "interfer": 26, "wrap": 26, "within": 26, "training_loop": 26, "intern": 26, "remain": 26, "unchang": 26, "fetch": 26, "complet": 26, "wikipedia": 26, "structur": 26, "hierarch": 26, "manner": 26, "home": 26, "folder": 26, "script": 26, "param": 26, "header": 26, "instanc": 26, "overwrit": 26, "emissions_endpoint": 26, "7777": 26, "overrid": 26, "victor": 26, "235b1da5": 26, "aaaa": 26, "893681599d2c": 26, "export": 26, "codecarbon_gpu_id": 26, "codecarbon_log_level": 26, "yield": 26, "attribut": 26, "configpars": 26, "re": 26, "wonder": 26, "syntax": 26, "under": 26, "hood": 26, "reli": 26, "ini": 26, "https_proxi": 26, "http_proxi": 26, "shell": 26, "0000": 26, "read": 26, "dash": 27, "app": 27, "illustr": 27, "understand": 27, "execut": 27, "filepath": 27, "port": 27, "8050": 27, "carbonboard": 27, "3333": 27, "dive": 27, "daili": 27, "weekli": 27, "share": 27, "american": 27, "household": 27, "mile": 27, "driven": 27, "32": 27, "inch": 27, "lcd": 27, "tv": 27, "watch": 27, "benchmark": 27, "eco": 27, "friendli": 27, "concern": 27, "those": 27, "who": 27, "chose": 27, "explor": 27, "preview": 27, "top": 27, "organis": 27, "better": 27, "sever": 27, "happen": 27, "shown": 27, "barchart": 27, "hand": 27, "bubbl": 27, "chart": 27, "bar": 27, "runtim": 27, "seri": 27, "metadata": 27}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"The": [3, 10], "mit": [3, 10], "licens": [3, 10], "codecarbon": [14, 18, 19, 20, 23], "api": [14, 23], "comet": 15, "integr": 15, "exampl": [16, 25], "us": [16, 23], "explicit": [16, 26], "object": [16, 26], "context": [16, 26], "manag": [16, 26], "decor": [16, 26], "frequent": 17, "ask": 17, "question": 17, "introduct": 18, "get": 18, "start": 18, "log": [18, 23, 25], "indic": 18, "tabl": 18, "instal": 19, "from": [19, 27], "pypi": 19, "repositori": 19, "conda": 19, "depend": 19, "methodologi": 20, "carbon": [20, 27], "intens": [20, 27], "across": 20, "energi": 20, "sourc": 20, "power": 20, "usag": 20, "gpu": 20, "ram": 20, "cpu": 20, "appl": 20, "silicon": 20, "chip": 20, "m1": 20, "m2": 20, "refer": [20, 21], "how": [20, 23], "work": 20, "model": 21, "comparison": [21, 27], "electr": [21, 27], "consumpt": 21, "ai": 21, "cloud": [21, 25, 27], "instanc": 21, "impact": 21, "time": 21, "year": 21, "region": [21, 27], "motiv": 22, "output": [23, 24], "csv": 23, "data": 23, "field": 23, "each": 23, "experi": 23, "prometheu": 23, "test": 23, "local": 23, "logfir": 23, "http": 23, "logger": [23, 25], "paramet": 24, "input": 24, "specif": 24, "offlin": [24, 26, 27], "mode": [24, 26], "offlineemissionstrack": 24, "track_emiss": 24, "collect": 25, "emiss": 25, "creat": 25, "python": 25, "googl": 25, "authent": 25, "an": 25, "emissiontrack": 25, "quickstart": 26, "onlin": [26, 27], "command": 26, "line": 26, "configur": 26, "prioriti": 26, "access": 26, "internet": 26, "through": 26, "proxi": 26, "server": 26, "visual": 27, "summari": 27, "equival": 27, "beta": 27, "global": 27, "more": 27, "detail": 27, "product": 27, "per": 27, "countri": 27}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 58}, "alltitles": {"The MIT License (MIT)": [[3, "the-mit-license-mit"], [10, "the-mit-license-mit"]], "CodeCarbon API": [[14, "codecarbon-api"], [14, "id1"], [23, "codecarbon-api"]], "Comet Integration": [[15, "comet-integration"]], "Examples": [[16, "examples"]], "Using the Explicit Object": [[16, "using-the-explicit-object"]], "Using the Context Manager": [[16, "using-the-context-manager"]], "Using the Decorator": [[16, "using-the-decorator"]], "Frequently Asked Questions": [[17, "frequently-asked-questions"]], "CodeCarbon": [[18, "codecarbon"]], "Introduction": [[18, null]], "Getting Started": [[18, null]], "Logging": [[18, null]], "Indices and tables": [[18, "indices-and-tables"]], "Installing CodeCarbon": [[19, "installing-codecarbon"]], "From PyPi repository": [[19, "from-pypi-repository"]], "From conda repository": [[19, "from-conda-repository"]], "Dependencies": [[19, "dependencies"]], "Methodology": [[20, "methodology"]], "Carbon Intensity": [[20, "carbon-intensity"]], "Carbon Intensity Across Energy Sources": [[20, "id5"]], "Power Usage": [[20, "power-usage"]], "GPU": [[20, "gpu"]], "RAM": [[20, "ram"]], "CPU": [[20, "cpu"]], "Apple Silicon Chips (M1, M2)": [[20, "apple-silicon-chips-m1-m2"]], "References": [[20, "references"], [21, "references"]], "How CodeCarbon Works": [[20, "how-codecarbon-works"]], "Model Comparisons": [[21, "model-comparisons"]], "Electricity consumption of AI cloud instance": [[21, "id1"]], "Impact of time of year and region": [[21, "impact-of-time-of-year-and-region"]], "Comparisons": [[21, "comparisons"]], "Motivation": [[22, "motivation"]], "Output": [[23, "output"]], "CSV": [[23, "csv"]], "Data Fields Logged for Each Experiment": [[23, "id4"]], "Prometheus": [[23, "prometheus"]], "Using CodeCarbon with prometheus": [[23, "using-codecarbon-with-prometheus"]], "How to test in local": [[23, "how-to-test-in-local"]], "Logfire": [[23, "logfire"]], "Using CodeCarbon with logfire": [[23, "using-codecarbon-with-logfire"]], "How to use it": [[23, "how-to-use-it"]], "HTTP Output": [[23, "http-output"]], "Logger Output": [[23, "logger-output"]], "Parameters": [[24, "parameters"]], "Input Parameters": [[24, "input-parameters"], [24, "id4"]], "Output parameters": [[24, "output-parameters"]], "Output Parameters": [[24, "id5"]], "Specific parameters for offline mode": [[24, "specific-parameters-for-offline-mode"]], "Input Parameters to OfflineEmissionsTracker": [[24, "id6"]], "@track_emissions": [[24, "track-emissions"]], "Input Parameters to @track_emissions": [[24, "id7"]], "Collecting emissions to a logger": [[25, "collecting-emissions-to-a-logger"]], "Create a logger": [[25, "create-a-logger"]], "Python logger": [[25, "python-logger"]], "Google Cloud Logging": [[25, "google-cloud-logging"]], "Authentication": [[25, "authentication"]], "Create an EmissionTracker": [[25, "create-an-emissiontracker"]], "Example": [[25, "example"]], "Quickstart": [[26, "quickstart"]], "Online Mode": [[26, "online-mode"]], "Command line": [[26, "command-line"]], "Explicit Object": [[26, "explicit-object"], [26, "id1"]], "Context manager": [[26, "context-manager"], [26, "id2"]], "Decorator": [[26, "decorator"], [26, "id3"]], "Offline Mode": [[26, "offline-mode"]], "Configuration": [[26, "configuration"]], "Configuration priority": [[26, "configuration-priority"]], "Access internet through proxy server": [[26, "access-internet-through-proxy-server"]], "Visualize": [[27, "visualize"]], "Offline": [[27, "offline"]], "Summary and Equivalents": [[27, "summary-and-equivalents"]], "Regional Comparisons": [[27, "regional-comparisons"]], "Cloud Regions": [[27, "cloud-regions"]], "Online (Beta)": [[27, "online-beta"]], "from global\u2026": [[27, "from-global"]], "to more and more\u2026": [[27, "to-more-and-more"]], "detailed": [[27, "detailed"]], "Electricity production carbon intensity per country": [[27, "electricity-production-carbon-intensity-per-country"]]}, "indexentries": {}}) \ No newline at end of file diff --git a/docs/to_logger.html b/docs/to_logger.html index 1661b61d..a3094f54 100644 --- a/docs/to_logger.html +++ b/docs/to_logger.html @@ -1,10 +1,10 @@ - + - Collecting emissions to a logger — CodeCarbon 2.7.0 documentation + Collecting emissions to a logger — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -103,17 +103,17 @@
-

Collecting emissions to a logger

+

Collecting emissions to a logger

The LoggerOutput class (and GoogleCloudLoggerOutput subclass) allows to send emissions tracking to a logger. This is a specific, distinct logger than the one used by the CodeCarbon package for its β€˜private’ logs. It allows to leverage powerful logging systems, to centralize emissions to some central or cloud-based system, and build reports, triggers, etc. based on these data.

This logging output can be used in parallel with other output options provided by CodeCarbon.

-

Create a logger

+

Create a logger

In order to send emissions tracking data to the logger, first create a logger and then create an EmissionTracker. OfflineEmissionTracker is also supported but lack of network connectivity may forbid to stream tracking data to some central or cloud-based collector.

-

Python logger

+

Python logger

import logging
 
 # Create a dedicated logger (log name can be the CodeCarbon project name for example)
@@ -133,7 +133,7 @@ 

Python logger -

Google Cloud Logging

+

Google Cloud Logging

import google.cloud.logging
 
 
@@ -146,11 +146,11 @@ 

Google Cloud Logging

-

Authentication

+

Authentication

Please refer to Google Cloud documentation.

-

Create an EmissionTracker

+

Create an EmissionTracker

Create an EmissionTracker saving output to the logger. Other save options are still usable and valid.

tracker = EmissionsTracker(save_to_logger=True, logging_logger=my_logger)
 tracker.start()
@@ -161,7 +161,7 @@ 

Create an EmissionTracker -

Example

+

Example

A demonstration is available in codecarbon/examples/logging_demo.py.

diff --git a/docs/usage.html b/docs/usage.html index c962a99e..44ec7160 100644 --- a/docs/usage.html +++ b/docs/usage.html @@ -1,10 +1,10 @@ - + - Quickstart — CodeCarbon 2.7.0 documentation + Quickstart — CodeCarbon 2.7.1 documentation @@ -15,9 +15,9 @@ - - - + + + @@ -112,15 +112,15 @@
-

Quickstart

+

Quickstart

The CO2 tracking tool can be used along with any computing framework. It supports both online (with internet access) and offline (without internet access) modes. The tracker can be used in the following ways:

-

Online Mode

+

Online Mode

When the environment has internet access, the EmissionsTracker object or the track_emissions decorator can be used, which has offline parameter set to False by default.

-

Command line

+

Command line

Create a minimal configuration file (just follow the prompts) :

codecarbon config
 
@@ -140,7 +140,7 @@

Command line -

Explicit Object

+

Explicit Object

In the case of absence of a single entry and stop point for the training code base, users can instantiate a EmissionsTracker object and pass it as a parameter to function calls to start and stop the emissions tracking of the compute section.

from codecarbon import EmissionsTracker
@@ -174,7 +174,7 @@ 

Explicit Objectstart_task will stop the scheduler as we do not want it to interfere with the task measurement.

-

Context manager

+

Context manager

The Emissions tracker also works as a context manager.

from codecarbon import EmissionsTracker
 
@@ -185,7 +185,7 @@ 

Context manager -

Decorator

+

Decorator

In case the training code base is wrapped in a function, users can use the decorator @track_emissions within the function to enable tracking emissions of the training code.

from codecarbon import track_emissions
@@ -203,11 +203,11 @@ 

Decorator -

Offline Mode

+

Offline Mode

An offline version is available to support restricted environments without internet access. The internal computations remain unchanged; however, a country_iso_code parameter, which corresponds to the 3-letter alphabet ISO Code of the country where the compute infrastructure is hosted, is required to fetch Carbon Intensity details of the regional electricity used. A complete list of country ISO codes can be found on Wikipedia.

-

Explicit Object

+

Explicit Object

Developers can use the OfflineEmissionsTracker object to track emissions as follows:

from codecarbon import OfflineEmissionsTracker
 tracker = OfflineEmissionsTracker(country_iso_code="CAN")
@@ -218,7 +218,7 @@ 

Explicit Object -

Context manager

+

Context manager

The OfflineEmissionsTracker also works as a context manager

from codecarbon import OfflineEmissionsTracker
 
@@ -228,7 +228,7 @@ 

Context manager -

Decorator

+

Decorator

The track_emissions decorator in offline mode requires following two parameters:

  • offline needs to be set to True, which defaults to False for online mode.

  • @@ -247,9 +247,9 @@

    Decorator<

-

Configuration

+

Configuration

-

Configuration priority

+

Configuration priority

CodeCarbon is structured so that you can configure it in a hierarchical manner:
  • global parameters in your home folder ~/.codecarbon.config

  • @@ -329,7 +329,7 @@

    Configuration priority

-

Access internet through proxy server

+

Access internet through proxy server

If you need a proxy to access internet, which is needed to call a Web API, like Codecarbon API, you have to set environment variable HTTPS_PROXY, or HTTP_PROXY if calling an http:// endpoint.

You could do it in your shell:

export HTTPS_PROXY="http://0.0.0.0:0000"
diff --git a/docs/visualize.html b/docs/visualize.html
index 0b04f9ed..17cc010f 100644
--- a/docs/visualize.html
+++ b/docs/visualize.html
@@ -1,10 +1,10 @@
 
-
+
 
   
 
   
-  Visualize — CodeCarbon 2.7.0 documentation
+  Visualize — CodeCarbon 2.7.1 documentation
       
       
 
@@ -15,9 +15,9 @@
   
         
         
-        
-        
-        
+        
+        
+        
     
     
     
@@ -107,9 +107,9 @@
            
-

Visualize

+

Visualize

-

Offline

+

Offline

The package also comes with a Dash App containing illustrations to understand the emissions logged from various experiments across projects. The App currently consumes logged information from a CSV file, generated from an in-built logger in the package.

The App can be run by executing the below CLI command that needs following arguments:

@@ -121,7 +121,7 @@

Offline

-

Summary and Equivalents

+

Summary and Equivalents

Users can get an understanding of net power consumption and emissions generated across projects and can dive into a particular project. The App also provides exemplary equivalents from daily life, for example:

    @@ -132,41 +132,41 @@

    Summary and EquivalentsSummary

-

Regional Comparisons

+

Regional Comparisons

The App also provides a comparative visual to benchmark emissions and energy mix of the electricity from the grid across different countries.

Global Equivalents
-

Cloud Regions

+

Cloud Regions

The App also benchmarks equivalent emissions across different regions of the cloud provider being used and recommends the most eco-friendly region to host infrastructure for the concerned cloud provider.

Cloud Emissions
-

Online (Beta)

+

Online (Beta)

A Dash App is also available for those who chose to connect the package to the API then data are public and available for all to explore. preview

-

from global…

+

from global…

Showing on the top the global energy consumed and emissions produced at an organisation level and the share of each project in this. The App also provides comparison points with daily life activity to get a better understanding of the amount generated.

Summary
-

to more and more…

+

to more and more…

Each project can be divided into several experiments, and in each experiment several runs can happen. The total emissions of experiments is shown on the barchart on the right hand side, and the runs on the bubble chart on the left hand side. If ever your project has several experiments you can switch from one experiment’s runs in the bubble chart to another by clicking the bar chart.

experiment and run
-

detailed

+

detailed

Clicking on one bubble, you can display the runtime series and see its metadata.

run time series and metadata
-

Electricity production carbon intensity per country

+

Electricity production carbon intensity per country

The app also provides a visualization of regional carbon intensity of electricity production.

carbon intensity carbon_map

Note that for now, all data sent to CodeCarbon API are public.

diff --git a/pyproject.toml b/pyproject.toml index 9c20b39e..46cdccb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -181,7 +181,7 @@ include = [ ] [tool.bumpver] -current_version = "2.7.0" +current_version = "2.7.1" version_pattern = "MAJOR.MINOR.PATCH" [tool.bumpver.file_patterns]
Input Parameters to @track_emissionsInput Parameters to @track_emissions