Skip to content

docs: complete metadata, citation, troubleshooting and accuracy docs - #1302

Open
davidberenstein1957 wants to merge 9 commits into
masterfrom
docs/traction-batch
Open

docs: complete metadata, citation, troubleshooting and accuracy docs#1302
davidberenstein1957 wants to merge 9 commits into
masterfrom
docs/traction-batch

Conversation

@davidberenstein1957

@davidberenstein1957 davidberenstein1957 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #1301.

Implements all twelve documentation and traction items. uv run task docs builds clean and the internal link check passes (5246 attributes); tests/test_cpu.py, test_emissions_tracker.py and 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, 15 keywords, 19 classifiers; Changelog URL now points at the docs. bumpver also patterns CITATION.cff.
  • New CITATION.cff and a rewritten README citation section using the Zenodo concept DOI 10.5281/zenodo.4658424, which tracks the latest release instead of pinning v2.4.1. docs/index.md citation link updated to the same DOI.

Discoverability

  • examples/README.md rewritten as a categorised index. Every filename checked against ls examples/, every symbol against codecarbon/__init__.py — no CO2Tracker, no @track_co2. The duplicated table in docs/how-to/examples.md is gone; that page now points at the canonical index. New tests/test_readme_links.py asserts relative links resolve.
  • The RAPL guide moves to a top-level how-to entry, retitled "Get accurate CPU measurements (Linux/RAPL)", with inbound links from the README, docs index, FAQ, installation and the quickstart. File path unchanged, so no redirect needed.
  • New docs/how-to/troubleshooting.md, keyed to log lines that were each grepped out of the current source. cpu.py now 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

  • New docs/explanation/alternatives.md and docs/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.md gains 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

  • Issue forms replace the four .md templates. The bug form requires codecarbon detect output (command verified to exist); config.yml disables blank issues and links Discord, troubleshooting, FAQ and docs.
  • contributing.md split into a 95-line contributor page, how-to/development.md, and maintaining.md. Nothing dropped — content moved. The stray </a> in four headings and the hand-maintained TOC markers are gone.
  • CHANGELOG.md at the repo root, holding both the user-facing changelog and the deprecations/migrations table; the Changelog project 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 from gh release view bodies and git log; deprecation "since" versions from git log -S plus git tag --contains. release-drafter.yml now resolves the version instead of always bumping the patch.
  • Open Graph and Twitter Card tags via a small overrides/main.html (Zensical emits none, and supports custom_dir — no Cairo dependency, no workflow change), five footer links, and start()/stop()/flush()/task-tracking now rendering in the API reference. Two malformed :param: directives in track_task_emissions fixed, since griffe now publishes them.

Worth a maintainer's eye before merge

  • CITATION.cff author 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.
  • Two citations copied from the audit rather than verified against the papers: the Khan et al. RAPL in Action year/venue details, and the Henderson et al. JMLR volume/issue 21(248).
  • External links were not fetched — the link checker skips them by default. Worth one scripts/check_docs_links.py site --external run.
  • date-released in CITATION.cff still needs a manual touch at release time; bumpver only patterns the version line.
  • The release checklist in maintaining.md should gain a "move Unreleased under the new version" step; the changelog page is otherwise a manual artefact.

🤖 Generated with Claude Code

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>
@davidberenstein1957
davidberenstein1957 requested a review from a team as a code owner August 12, 2026 14:14
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.77%. Comparing base (065d0e6) to head (759b516).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1302      +/-   ##
==========================================
+ Coverage   91.39%   91.77%   +0.37%     
==========================================
  Files          49       49              
  Lines        5056     5057       +1     
==========================================
+ Hits         4621     4641      +20     
+ Misses        435      416      -19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

davidberenstein1957 and others added 3 commits August 12, 2026 16:28
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>
davidberenstein1957 and others added 5 commits August 12, 2026 16:40
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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs and traction: fill the twelve gaps in packaging, citation, troubleshooting and accuracy docs

1 participant