docs: complete metadata, citation, troubleshooting and accuracy docs - #1302
Open
davidberenstein1957 wants to merge 30 commits into
Open
docs: complete metadata, citation, troubleshooting and accuracy docs#1302davidberenstein1957 wants to merge 30 commits into
davidberenstein1957 wants to merge 30 commits into
Conversation
Implements the twelve documentation and traction items tracked in updates/docs: - PyPI metadata: description, keywords, expanded classifiers - CITATION.cff plus an unpinned, DOI-based citation in the README - Rewritten examples/README.md indexing the real examples and APIs - New troubleshooting page keyed to actual log lines, linked from the README, FAQ, docs index and from RAPL warning strings in cpu.py - RAPL setup guide promoted out of "Deployment" to a top-level how-to - New alternatives comparison and accuracy/validation pages - Methodology bibliography built out; blog-post and open-issue citations demoted or replaced - GitHub issue forms that collect `codecarbon detect` output - Contributing guide split into contributor / development / maintainer pages, stray `</a>` in headings removed - CHANGELOG.md, changelog and deprecations reference pages, a blog surface, and release-drafter version resolution - Open Graph tags, footer links, and start()/stop() in the API reference Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1302 +/- ##
==========================================
+ Coverage 91.43% 91.77% +0.33%
==========================================
Files 49 49
Lines 5057 5058 +1
==========================================
+ Hits 4624 4642 +18
+ Misses 433 416 -17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The changelog and deprecations reference pages stay; the release announcement post belongs on codecarbon.io, not in the docs site. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Move the changelog and the deprecations table into the root CHANGELOG.md, which GitHub renders, and drop the two reference pages. The `Changelog` project URL now points at the releases page, and the deprecation notices in the configuration and output docs link to the deprecations section of CHANGELOG.md. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Docs build and the internal link check pass on the new version. 0.0.53 still emits no Open Graph tags of its own, so the `overrides/main.html` template added in this branch stays necessary. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The wheel-validation job runs the test suite against an installed wheel without the rest of the repository, so `examples/README.md` does not exist there and the check failed with FileNotFoundError. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Move the 165-line raw machine dumps in rapl.md into a clearly marked appendix so the explanation reads end to end. Retitle power-estimation.md to "From Energy Counters to Power" — the old title promised the TDP estimation model and delivered counter-to-power derivation. File path unchanged so external URLs keep working. Relabel model-comparisons.md: the numbers come from Azure tooling, not CodeCarbon. Provenance moved to a warning at the top and the nav entry moved out of Explanation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every CSV column now states what produced it: hardware counter, model, or config. Adds the four EmissionsData fields missing from the table (experiment_id, water_consumed, pue, wue), documents that PUE inflates the per-component energy columns, and corrects the lat/long precision claim (rounding happens only on the API path). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The three worked examples asserted CodeCarbon "uses psys only", which contradicted the Key Takeaways section on the same page. Verified against core/cpu.py: rapl_prefer_psys defaults to False (:453) and psys is used only when explicitly enabled (:694), with the else path logging "psys domain detected but not used" (:727). Key Takeaways was right. Each example now states the default package-domain behaviour and marks the psys arithmetic as requiring rapl_prefer_psys=True. Also reworded the open "we still have to investigate" note on DRAM as a stated limitation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The documented CPU fallback ladder did not match resource_tracker.py, the equivalence constants were sourced to a file absent from the repo, Electricity Maps was undocumented, and the RAM heuristic was presented as empirically motivated. Rewrite methodology.md against the source and split the bibliography and equivalences into their own pages. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tracking_mode silently swaps the power model on the estimation path: cubic with a 10% floor in machine mode (hardware.py:287-288), linear with no floor in process mode (hardware.py:346). Documenting only the cubic invited readers to blame the divergence on attribution scope. Also scope accuracy.md's deviation figures to machine mode, which is what the profiling script actually measured. Refs #1378 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Threadripper walkthrough presents a summed per-die figure as correct. Whether the two package-X-die-Y domains are independent or mirror the same counter is unresolved, so the page now links issue #1379 instead of vouching for the result. Observed numbers left untouched as evidence. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The overview page states the formula PUE-inflated; this page stated E x C and introduced PUE later, so the two read as disagreeing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The changelog duplicated the GitHub releases page, which both pyproject files already declare as the canonical Changelog URL. Keeping it meant every PR needed a bullet in a file that only existed on one branch. The deprecations table was the one thing releases cannot carry, so it moves to docs/reference/deprecations.md and the two docs pages that linked into the changelog anchor now point there. Also pin black and ruff to the versions CI's pre-commit hooks use, and set black's target-version explicitly. The inferred target outran the interpreter, so black was skipping its AST safety check and local formatting runs rewrote ~120 files that CI considered clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CodeQL reports py/weak-sensitive-data-hashing on generate_lookup_value. The value is a database index, not a credential: authentication is bcrypt against hashed_token, and the derivation cannot be changed because it is computed from plaintext tokens that are never stored. Write that down so the alert is not re-litigated, and correct get_api_key_hash's return annotation, which claimed str while returning bcrypt's bytes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
#1369 removes the taskipy black/ruff tasks entirely, which is the root-cause fix for the format drift: pinning a second toolchain to match pre-commit keeps two copies of the same version truth in sync by hand. Take the deletion there instead and leave these unpinned so the two branches do not conflict. [tool.black] target-version stays: the pre-commit black hook reads pyproject too, so that fix is orthogonal to #1369 and still wanted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The GPU row named only NVML, but AMD devices are read through AMDSMI in codecarbon/core/gpu_amd.py. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The cpu_load row described only the process-mode linear model; the default machine-mode model is cubic with a 10% TDP floor (external/hardware.py:287-288). Move on_cloud after ram_used_gb to match the EmissionsData field order the table claims to follow, and widen the coordinate-rounding citation to cover both axes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cut the preamble to one sentence, replace the numbered note lead-ins with sub-headings, remove the em-dashes the page did not have, blank the provenance cell for self-evident fields, and defer the carbon intensity fallback chain to the methodology page. Note that powermetrics is effectively unreachable on Apple Silicon because the cpu_load path is selected first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
force_cpu_power does not report a flat constant. With psutil installed -- a hard dependency -- control reaches _setup_fallback_tracking and selects cpu_load mode with the given value as the TDP, so machine mode reports value * (0.1 + 0.9 * load**3). Fix the backend table row and the bullet below it. troubleshooting.md still described powermetrics as the Apple Silicon backend and pointed at sudoers instructions the rewrite had deleted. Rewrite that section: on Apple Silicon the cpu_load path wins before powermetrics is tried, so passwordless sudo changes nothing; on Intel Macs powermetrics is still reachable, and the sudoers recipe now lives there. Also cut over-rewriting: drop the opening preamble, the "Checking this page" section and the repeated unsourced-constant notes, and restore the original Windows EMI, CPU hardware and per-fuel table prose. Carry over the four-term formula block and a References routing row from the how-it-works draft, which is otherwise a duplicate of this page. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Key Takeaways block named the options prefer_psys and include_dram. Neither exists; emissions_tracker.py:425-426 declares rapl_include_dram and rapl_prefer_psys. Revert the power-estimation.md title change and the three inbound link edits it forced. The original title is more searchable; the info box disambiguating it from the TDP path is kept. Leave Model Comparisons under Explanation, where the file lives, and cut the duplicated issue-tracker note in takeaways item 7 to one clause -- the full caveat is already in the appendix admonition. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
docs: restructure three explanation pages
docs: add provenance column to output fields
docs: correct the estimation chain reference
- troubleshooting: allow_multiple_runs defaults to True (emissions_tracker.py:162), so the machine-wide lock is only taken when it is set to False. The page had it backwards. - troubleshooting, enable-rapl: `docker --device` takes device nodes, not a sysfs directory; use a read-only bind mount, matching the Compose snippet. - examples/README: api_call_debug.py uses measure_power_secs=2 and api_call_interval=2, i.e. every 4 seconds, not 20. - troubleshooting: measure_power_secs is 15 in the Python API but 10 for `codecarbon monitor` (cli/main.py), with api_call_interval 30. - deprecations: the carbonboard/viz-legacy split shipped in v3.2.1, not 3.3.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Delete the references and equivalences pages, trim the deprecations page to its table, and cut the duplicated recaps from the alternatives, accuracy, troubleshooting and development pages. Fix commands that do not exist: `task lint` (removed from pyproject), `uv run task local`, `uv run dashboard`, `uv run api.docker` and `uv run api.local`. Move the orphaned accuracy paragraph out of the tools comparison FAQ entry. Revert the wrapped_fn rename and shorten the lookup-value docstring. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Closes #1301.
Implements all twelve documentation and traction items.
uv run task docsbuilds clean and the internal link check passes (5246 attributes);tests/test_cpu.py,test_emissions_tracker.pyand the new link test pass (76 passed, 2 skipped). Ruff error count is unchanged from master.What is in here
Packaging and citation
pyproject.toml:description, 15keywords, 19classifiers;ChangelogURL now points at the docs.bumpveralso patternsCITATION.cff.CITATION.cffand a rewritten README citation section using the Zenodo concept DOI10.5281/zenodo.4658424, which tracks the latest release instead of pinning v2.4.1.docs/index.mdcitation link updated to the same DOI.Discoverability
examples/README.mdrewritten as a categorised index. Every filename checked againstls examples/, every symbol againstcodecarbon/__init__.py— noCO2Tracker, no@track_co2. The duplicated table indocs/how-to/examples.mdis gone; that page now points at the canonical index. Newtests/test_readme_links.pyasserts relative links resolve.docs/how-to/troubleshooting.md, keyed to log lines that were each grepped out of the current source.cpu.pynow appends a docs URL to the RAPL-permission and unknown-CPU warnings via one shared constant, so the three call sites cannot drift apart. The two linked anchors are pinned with explicit{ #... }ids.Supporting our claims
docs/explanation/alternatives.mdanddocs/explanation/accuracy.md. The accuracy figures are computed from CSVs already committed in this repo (codecarbon/data/hardware/cpu_load_profiling/) — the TDP estimate deviates from RAPL by up to roughly a factor of two in either direction depending on CPU and load. Per-backend accuracy and wall-socket validation are marked "not yet measured" rather than estimated. Competitor facts (licence, language, archive status) were pulled from the GitHub API; no maintenance judgements, and "peer-reviewed" softened to "accompanying academic paper" where the venue was not verified.methodology.mdgains a real bibliography (foundational work, hardware measurement, carbon-intensity sources, citing CodeCarbon). The personal blog post is demoted to a supporting walkthrough behind Khan et al. and Weaver; the open GitHub issue is relabelled as a tracked limitation, with Intel's own page cited for the Power Gadget discontinuation.Contribution and release surface
.mdtemplates. The bug form requirescodecarbon detectoutput (command verified to exist);config.ymldisables blank issues and links Discord, troubleshooting, FAQ and docs.contributing.mdsplit into a 95-line contributor page,how-to/development.md, andmaintaining.md. Nothing dropped — content moved. The stray</a>in four headings and the hand-maintained TOC markers are gone.CHANGELOG.mdat the repo root, holding both the user-facing changelog and the deprecations/migrations table; theChangelogproject URL points at the GitHub releases page. No changelog or deprecations page in the docs site, and no blog surface — codecarbon.io already has one. Entries are sourced fromgh release viewbodies andgit log; deprecation "since" versions fromgit log -Splusgit tag --contains.release-drafter.ymlnow resolves the version instead of always bumping the patch.overrides/main.html(Zensical emits none, and supportscustom_dir— no Cairo dependency, no workflow change), five footer links, andstart()/stop()/flush()/task-tracking now rendering in the API reference. Two malformed:param:directives intrack_task_emissionsfixed, since griffe now publishes them.Worth a maintainer's eye before merge
CITATION.cffauthor list. Names come from the existing README BibTeX with unresolved handles dropped, plus a collective "The CodeCarbon contributors" entry. This is a social decision, not a technical one — please confirm.21(248).scripts/check_docs_links.py site --externalrun.date-releasedinCITATION.cffstill needs a manual touch at release time; bumpver only patterns the version line.maintaining.mdshould gain a "move Unreleased under the new version" step; the changelog page is otherwise a manual artefact.🤖 Generated with Claude Code