Skip to content

Docs: clarify metric prefix selection examples - #469

Merged
hugovk merged 1 commit into
python-humanize:mainfrom
tongwentao:docs/metric-prefix-selection
Nov 12, 2026
Merged

hugovk merged 1 commit into
python-humanize:mainfrom
tongwentao:docs/metric-prefix-selection

Conversation

@tongwentao

@tongwentao tongwentao commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Changes proposed in this pull request:

  • Correct the metric() explanation, which currently says non-significant zeroes are required when describing how prefixes avoid them.
  • Use lowercase k for kilo and turn the two prefix-selection examples into executable doctests showing the actual output, including spacing.

This only changes the docstring; runtime behavior is unchanged.

Behavior and review notes

The examples document prefix selection and exact rendered text, including the lowercase SI kilo symbol and the space before the prefix. Making those outputs doctests keeps the prose tied to the current implementation. No numerical rounding, prefix thresholds, or formatting defaults are modified.

Validation on Linux, Python 3.13.5:

  • Number-module doctests: 8 passed, including the updated metric() examples.
  • mkdocs build --strict: passed; checked the generated number API page.
  • mypy .: passed for all 14 source files.
  • Configured prek hooks passed.

Prepared and validated with Codex assistance. The full runtime test suite and other platforms were not run for this documentation-only change.

@hugovk hugovk changed the title docs: clarify metric prefix selection examples Docs: clarify metric prefix selection examples Nov 12, 2026
@hugovk
hugovk enabled auto-merge (squash) November 12, 2026 11:47
@hugovk hugovk added documentation Improvements or additions to documentation changelog: skip Exclude PR from release draft labels Nov 12, 2026
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (785e5dc) to head (6841951).
⚠️ Report is 25 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #469   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files          12       12           
  Lines         995      995           
=======================================
  Hits          992      992           
  Misses          3        3           
Flag Coverage Δ
macos-latest 97.58% <ø> (ø)
ubuntu-latest 97.58% <ø> (ø)
windows-latest 93.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@hugovk
hugovk merged commit dbcc6ed into python-humanize:main Nov 12, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: skip Exclude PR from release draft documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants