Skip to content

Commit 987ecdf

Browse files
Apply suggestions from code review
Clean up the #skip comments for some python blocks Co-authored-by: David Berenstein <david.m.berenstein@gmail.com>
1 parent e28687d commit 987ecdf

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

docs/getting-started/examples.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ But you can't get them in your code, see the Context Manager section
1414
below for that.
1515

1616
```python
17-
# skip mktestdocs testing because a) we would need to add the large tensorflow package as a doc
17+
# skip mktestdocs
1818
# dependency, which would slow down CI setup time, b) these snippets do quiet a lot of work which
1919
# would slow things down further.
2020
import tensorflow as tf
@@ -53,7 +53,7 @@ We think this is the best way to use CodeCarbon. Still only two lines of
5353
code, and you can get the emissions in your code.
5454

5555
```python
56-
# skip mktestdocs testing because a) we would need to add the large tensorflow package as a doc
56+
# skip mktestdocs
5757
# dependency, which would slow down CI setup time, b) these snippets do quiet a lot of work which
5858
# would slow things down further.
5959
import tensorflow as tf
@@ -102,7 +102,7 @@ background after your computation code has crashed, so your program will
102102
never finish.
103103

104104
```python
105-
# skip mktestdocs testing because a) we would need to add the large tensorflow package as a doc
105+
# skip mktestdocs
106106
# dependency, which would slow down CI setup time, b) these snippets do quiet a lot of work which
107107
# would slow things down further.
108108
import tensorflow as tf

docs/introduction/power_estimation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ The `Power.from_energies_and_delay` method handles this operation:
2323

2424
```python
2525
from codecarbon.core import units
26-
energy_now= units.Energy(kWh=1.0)
26+
27+
energy_now = units.Energy(kWh=1.0)
2728
energy_previous = units.Energy(kWh=0.5)
2829
delay = units.Time(seconds=3600.0)
2930
delta_energy_kwh = float(abs(energy_now.kWh - energy_previous.kWh))

docs/logging/output.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ docker-compose up
6363
Run your EmissionsTracker as usual, with `save_to_prometheus=True`:
6464

6565
```python
66-
# skip mktestdocs testing because this would try to save to prometheus
66+
# skip mktestdocs
6767
tracker = OfflineEmissionsTracker(
6868
project_name="my_project",
6969
country_iso_code="USA",
@@ -87,7 +87,7 @@ CodeCarbon exposes all its metrics with the suffix `codecarbon_`.
8787
Run your EmissionsTracker as usual, with `save_to_logfire=True`:
8888

8989
```python
90-
# skip mktestdocs testing because this would try to save to logfire
90+
# skip mktestdocs
9191
tracker = OfflineEmissionsTracker(
9292
project_name="my_project",
9393
country_iso_code="USA",

docs/logging/to_logger.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ or cloud-based collector.
2121
### Python logger
2222

2323
```python
24-
# skip mktestdocs testing because this relies on a separate logger
24+
# skip mktestdocs
2525
import logging
2626

2727
# Create a dedicated logger (log name can be the CodeCarbon project name for example)
@@ -42,7 +42,7 @@ my_logger = LoggerOutput(_logger, logging.INFO)
4242
### Google Cloud Logging
4343

4444
```python
45-
# skip mktestdocs testing because this requires cloud logging
45+
# skip mktestdocs
4646
import google.cloud.logging
4747

4848

@@ -64,7 +64,7 @@ Create an EmissionTracker saving output to the logger. Other save
6464
options are still usable and valid.
6565

6666
```python
67-
# skip mktestdocs testing because this requires creation of a logger
67+
# skip mktestdocs
6868
tracker = EmissionsTracker(save_to_logger=True, logging_logger=my_logger)
6969
tracker.start()
7070
# Your code here

0 commit comments

Comments
 (0)