You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To test the API, see [how to deploy it](#local_deployement) first.
90
90
91
91
92
-
Core & external classes are unit tested, with one test file per class. Mosts pull-requests are expected to contains new tests or test update, if you are unusure what to test / how to test it, please put it in the pull-request description and the maintainers will help you.
92
+
Core and external classes are unit tested, with one test file per class. Most pullrequests are expected to contain either new tests or test updates. If you are unusure what to test / how to test it, please put it in the pullrequest description and the maintainers will help you.
93
93
94
94
### Stress your computer
95
95
96
-
To test CodeCarbon it is usefull to stress your computer to make it use his full power:
97
-
- 7Zip is often already on your computer, running it with `7z b`make a quick CPU test.
96
+
To test CodeCarbon, it is useful to stress your computer to make it use its full power:
97
+
- 7Zip is often already installed, running it with `7z b`makes a quick CPU test.
98
98
-[GPU-burn](https://github.com/wilicc/gpu-burn) will load test the GPU for a configurable duration.
99
99
100
-
`nvidia-smi` is a usefull tool to see the metrics of the GPU and compare it with CodeCarbon.
100
+
`nvidia-smi` is a useful tool to see the metrics of the GPU and compare it with CodeCarbon.
101
101
102
-
### Versionning
102
+
### Versioning
103
103
104
104
105
-
To add a new feature to codecarbon, the following workflow is applied :
105
+
To add a new feature to codecarbon, the apply the following workflow:
106
106
- Master branch is protected
107
107
- To contribute to an already [prioritized](https://github.com/orgs/mlco2/projects/1) feature, you can create a branch from master and open a draft PR
108
108
- Documenting the intent & the limits of a contribution in a dedicated issue or in the pull request helps the review
@@ -182,7 +182,7 @@ Then, click on the url displayed in the terminal.
182
182
183
183
### Coding style && Linting
184
184
185
-
The coding style and linting rules are automatically applied and enforce by [pre-commit](https://pre-commit.com/). This tool helps to maintain the same code style across the code-base to ease the review and collaboration process. Once installed ([https://pre-commit.com/#installation](https://pre-commit.com/#installation)), you can install a Git hook to automatically run pre-commit (and all configured linters/auto-formatters) before doing a commit with `pre-commit install`. Then once you tried to commit, the linters/formatters will run automatically. It should display something similar to:
185
+
The coding style and linting rules are automatically applied and enforce by [pre-commit](https://pre-commit.com/). This tool helps to maintain the same code style across the code-base and to ease the review and collaboration process. Once installed ([https://pre-commit.com/#installation](https://pre-commit.com/#installation)), you can install a Git hook to automatically run pre-commit (and all configured linters/auto-formatters) before doing a commit with `pre-commit install`. Then once you tried to commit, the linters/formatters will run automatically. It should display something similar to:
186
186
187
187
```
188
188
[INFO] Initializing environment for https://github.com/psf/black.
If any of the linters/formatters failed, check the difference with `git diff`, add the differences if there is no behavior changes (isort and black might have change some coding style or import order, this is expected it is their jobs) with `git add` and finally try to commit again `git commit ...`.
207
+
If any of the linters/formatters fail, check the difference with `git diff`, add the differences if there is no behavior changes (isort and black might have change some coding style or import order, this is expected it is their job) with `git add` and finally try to commit again `git commit ...`.
208
208
209
209
You can also run `pre-commit` with `pre-commit run -v` if you have some changes staged but you are not ready yet to commit.
210
210
@@ -216,12 +216,12 @@ Dependencies are defined in three different places:
216
216
- In [setup.py](setup.py#L7), those are the dependencies for the Pypi package.
217
217
- In [.conda/meta.yaml](.conda/meta.yaml#L21), those are the dependencies for the Conda pacakge targeting Python 3.7 and higher versions.
218
218
219
-
We drop support of Python 3.6 since version 2.0.0 of CodeCarbon.
219
+
We have dropped support of Python 3.6 since version 2.0.0 of CodeCarbon.
220
220
221
221
### Alternative ways of contributing
222
222
223
223
224
-
You have a cool idea, but do not know know if it fits with Code Carbon? You can create an issue to share:
224
+
You have a cool idea, but do not know know if it fits with Code Carbon? You can create an issue to share:
225
225
- the code, via the Github repo or [Binder](https://mybinder.org/), to share executable notebooks
226
226
- a webapp, using [Voilà](https://github.com/voila-dashboards/voila), [Dash](https://github.com/plotly/dash) or [Streamlit](https://github.com/streamlit/streamlit)
227
227
- ideas for improvement about the tool or its documentation
@@ -272,15 +272,15 @@ Inside the docker container, run:
272
272
273
273
### API
274
274
275
-
To run the API locally, the easiest way is Docker. Launch this command in the project directory:
275
+
The easiest way to run the API locally is with Docker. Launch this command in the project directory:
276
276
```
277
277
docker-compose up -d
278
278
```
279
279
Please see [Docker specific documentation](./docker/README.md) for more informations.
280
-
When up, the API documentation is locally available at the following URL: http://localhost:8008/redoc and can be used for testing.
280
+
When up, the API documentation is available locally at the following URL: http://localhost:8008/redoc and can be used for testing.
281
281
282
282
283
-
In order to connect make codecarbon automatically connect to the local API, create a file `.codecarbon.config` with the content:
283
+
In order to make codecarbon automatically connect to the local API, create a file `.codecarbon.config` with contents:
The API is availiable to everyone from https://api.codecarbon.io but if you want to deploy it for yourself, here is the instructions.
306
+
The API is availiable to everyone from https://api.codecarbon.io, but if you want to deploy it for yourself, here are the instructions.
307
307
308
-
To deploy the API we use [Clever Cloud](https://www.clever-cloud.com/), an IT Automation platform. They manage all the hard ops work while we focus on the Code Carbon value.
308
+
To deploy the API we use [Clever Cloud](https://www.clever-cloud.com/), an IT Automation platform. They manage all the hard ops work while we focus on the Code Carbon value.
309
309
310
-
Here is the Clever Cloud configuration if you want to reproduce it:
310
+
Here is the Clever Cloud configuration if you want to reproduce it:
Copy file name to clipboardexpand all lines: docs/edit/faq.rst
+2-2
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Frequently Asked Questions
9
9
* **What are the sources of your energy carbon intensity data?**
10
10
We use the following sources:
11
11
12
-
For cloud computing:
12
+
For cloud computing:
13
13
14
14
- Google publish carbon intensity of electricity for `Google Cloud Plateform <https://cloud.google.com/sustainability/region-carbon?hl=fr>`_.
15
15
@@ -18,7 +18,7 @@ Frequently Asked Questions
18
18
- Microsoft has a Sustainability Calculator that helps enterprises analyze the carbon emissions of their IT infrastructure. But does not publish datacenter carbon intensity.
19
19
20
20
21
-
For private infra:
21
+
For private infra:
22
22
23
23
- When available we use data from `ourworld in data <https://ourworldindata.org/grapher/carbon-intensity-electricity?tab=table>`_
Copy file name to clipboardexpand all lines: docs/edit/methodology.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ energy sources that are used to generate electricity, including fossil fuels and
26
26
27
27
When available, CodeCarbon uses global carbon intensity of electricity per cloud provider ( `here <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/cloud/impact.csv>`_ ) or per country ( `here <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/eu-carbon-intensity-electricity.csv>`_ ).
28
28
29
-
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:
29
+
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:
30
30
31
31
.. list-table:: Carbon Intensity Across Energy Sources
*[mnist_decorator.py](mnist_decorator.py): Using the `@track_co2` decorator.
12
12
*[mnist_callback.py](mnist_callback.py): Using Keras callbacks to save emissions after each epoch.
13
13
*[mnist-comet.py](mnist-comet.py): Using `CO2Tracker` with [`Comet`](https://www.comet.ml/site) for automatic experiment and emissions tracking.
14
-
*[api_call_demo.py](api_call_demo.py): Simplest demo to send computer emissions to CodeCarbon API.
15
-
*[api_call_debug.py](api_call_debug.py): Script to send computer emissions to CodeCarbon API. Made for debugging: debug log and send data every 20 seconds.
14
+
*[api_call_demo.py](api_call_demo.py): Simplest demo to send computer emissions to CodeCarbon API.
15
+
*[api_call_debug.py](api_call_debug.py): Script to send computer emissions to CodeCarbon API. Made for debugging: debug log and send data every 20 seconds.
0 commit comments