Repository navigation
docs: document missing CLI options, config keys and recent fixes - #1480
Open
davidberenstein1957 wants to merge 1 commit into
Open
davidberenstein1957 wants to merge 1 commit into
davidberenstein1957 wants to merge 1 commit into
Conversation
- cli.md: add --version, the four missing monitor options, the real --log-level default, and the get-token and test-api commands. - configuration.md: replace the invalid save_to_file=local-overwrite example with output_methods, and add a table of all config keys with defaults and the CODECARBON_<KEY> environment variable rule. - api.md and the track_emissions docstring: say the decorator does not accept force_mode_cpu_load or metadata, and align api_call_interval and region with the base tracker docstring. - slurm.md: warn that machine-mode trackers on local rank > 0 count the node more than once. - logging.md: link to the real logging examples. - cloud-api.md and methodology.md: note sub-second API durations and the city fallback for cloud regions with no state.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1480 +/- ##
=======================================
Coverage 93.86% 93.86%
=======================================
Files 51 51
Lines 5734 5734
=======================================
Hits 5382 5382
Misses 352 352 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
davidberenstein1957
requested review from
SaboniAmine,
benoit-cty and
inimaz
November 11, 2026 07:42
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fill gaps between the code and the docs. Each change was checked against the code on
master@ ab8627a.docs/reference/cli.md--version/-v(cli/main.py:99).codecarbon monitortable: added--project-name(Add project name option to monitor command #1435),--measure-power-secs(default 10),--api-call-interval(default 30) and--region.--log-levelnow shows the real defaulterrorand includescritical.--country-iso-codeis required in offline mode unless the config file sets it (main.py:488).codecarbon get-token PROJECT_ID(main.py:203) andcodecarbon test-api(main.py:152).docs/how-to/configuration.mdsave_to_file=local-overwrite. That value no longer exists and is read asFalse. The examples now useoutput_methods._set_from_confwith its default, and theCODECARBON_<KEY>environment variable rule (core/config.py:183).docs/reference/api.md: the decorator does not acceptforce_mode_cpu_loadormetadataas arguments. The page said it accepts the same parameters asEmissionsTracker.codecarbon/emissions_tracker.py:track_emissionsdocstring only.api_call_intervalandregionnow match theBaseEmissionsTrackerdocstring (default 8,-1; US States and Canada).docs/how-to/slurm.md: warning about machine-mode trackers on SLURM local rank other than 0 counting the node twice (feat: warn when SLURM ranks double count a node #1390,core/slurm.py).docs/how-to/logging.md: the example pathcodecarbon/examples/logging_demo.pydoes not exist. It now links toexamples/logging_to_file.pyandexamples/logging_to_google_cloud.py.docs/how-to/cloud-api.md: the API keeps sub-second durations; only a duration of zero or less is skipped (515dea6).docs/explanation/methodology.md: a cloud region with no state falls back to the city (f416fcb).Related Issue
N/A
Motivation and Context
Features from 3.3.x and later commits on
masterwere missing from the reference pages, and one config example stopped working after theoutput_methodschange.How Has This Been Tested?
uv run zensical build -f mkdocs.yml --clean: exit 0. The 6 existing redirect warnings remain; the Zensical upgrade PR fixes them.python scripts/check_docs_links.py site: passed, exit 0.uv run codecarbon monitor --help: option names match the table. Defaults read fromcli/main.py._set_from_conf(...)calls incodecarbon/emissions_tracker.py.pre-commit run --files <changed files>: autoflake, isort, black, flake8 passed.pytest -k "track_emissions or decorator or docs" --ignore=tests/test_viz_data.py: 22 passed (test_viz_data.pyneedsdash, which thedocgroup does not install).git diff codecarbon/emissions_tracker.pychanges docstring lines only.Screenshots (if appropriate):
N/A
Types of changes
AI Usage Disclosure
Please refer to docs/how-to/ai-policy.md for detailed guidelines on how to disclose AI usage in your PR. Accurately completing this section is mandatory.
Checklist:
Commits