Skip to content

Commit

Permalink
Merge pull request #745 from mlco2/release_2.8.2
Browse files Browse the repository at this point in the history
Release 2.8.2
  • Loading branch information
benoit-cty authored Dec 18, 2024
2 parents 54578d8 + 135fb7a commit 150eabb
Show file tree
Hide file tree
Showing 35 changed files with 344 additions and 314 deletions.
273 changes: 131 additions & 142 deletions CONTRIBUTING.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion codecarbon/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.8.1"
__version__ = "2.8.2"
19 changes: 13 additions & 6 deletions codecarbon/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def show_config(path: Path = Path("./.codecarbon.config")) -> None:

fief = Fief(AUTH_SERVER_URL, AUTH_CLIENT_ID)
fief_auth = FiefAuth(fief, "./credentials.json")
print("FIEF", AUTH_SERVER_URL, AUTH_CLIENT_ID)


def _get_access_token():
Expand All @@ -128,10 +127,7 @@ def login():
fief_auth.authorize()


@codecarbon.command("get-token", short_help="Get project token")
def get_token(project_id: str):
# api = ApiClient(endpoint_url=API_URL) # TODO: get endpoint from config
# api.set_access_token(_get_access_token())
def get_api_key(project_id: str):
req = requests.post(
f"{API_URL}/projects/{project_id}/api-tokens",
json={
Expand All @@ -141,7 +137,16 @@ def get_token(project_id: str):
},
headers={"Authorization": f"Bearer {_get_access_token()}"},
)
print("Your token: " + req.json()["token"])
api_key = req.json()["token"]
return api_key


@codecarbon.command("get-token", short_help="Get project token")
def get_token(project_id: str):
# api = ApiClient(endpoint_url=API_URL) # TODO: get endpoint from config
# api.set_access_token(_get_access_token())
token = get_api_key(project_id)
print("Your token: " + token)
print("Add it to the api_key field in your configuration file")


Expand Down Expand Up @@ -292,6 +297,8 @@ def config():
experiment = [e for e in experiments if e["name"] == experiment][0]

overwrite_local_config("experiment_id", experiment["id"], path=file_path)
api_key = get_api_key(project_id)
overwrite_local_config("api_key", api_key, path=file_path)
show_config(file_path)
print(
"Consult [link=https://mlco2.github.io/codecarbon/usage.html#configuration]configuration documentation[/link] for more configuration options"
Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 734e8c48b9573f38d51f3c058baf536f
config: 9f4750dacb0c56bfad9fbaf2281536e5
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '2.8.1',
VERSION: '2.8.2',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
4 changes: 2 additions & 2 deletions docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CodeCarbon API &mdash; CodeCarbon 2.8.1 documentation</title>
<title>CodeCarbon API &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/comet.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Comet Integration &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Comet Integration &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/edit/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.1"
release = "2.8.2"


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Examples &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Examples &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Frequently Asked Questions &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Frequently Asked Questions &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Index &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Index &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CodeCarbon &mdash; CodeCarbon 2.8.1 documentation</title>
<title>CodeCarbon &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Installing CodeCarbon &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Installing CodeCarbon &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/methodology.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Methodology &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Methodology &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/model_examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Model Comparisons &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Model Comparisons &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/motivation.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Motivation &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Motivation &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/output.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Output &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Output &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/parameters.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Parameters &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Parameters &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Search &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Search &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />



<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/to_logger.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Collecting emissions to a logger &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Collecting emissions to a logger &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Quickstart &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Quickstart &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/visualize.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Visualize &mdash; CodeCarbon 2.8.1 documentation</title>
<title>Visualize &mdash; CodeCarbon 2.8.2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />


<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=cd87aae0"></script>
<script src="_static/documentation_options.js?v=fa7f208a"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ include = [
]

[tool.bumpver]
current_version = "2.8.1"
current_version = "2.8.2"
version_pattern = "MAJOR.MINOR.PATCH"

[tool.bumpver.file_patterns]
Expand Down
Loading

0 comments on commit 150eabb

Please sign in to comment.