Skip to content

Release 1.1.0: show report times in µs, ms or s so fast sections stay visible - #23

Merged
seba2390 merged 2 commits into
mainfrom
report/readable-units
Sep 30, 2026
Merged

seba2390 merged 2 commits into
mainfrom
report/readable-units

Conversation

@seba2390

@seba2390 seba2390 commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

What does this change?

Report readability. The text report printed seconds with four decimals, so any section under 50 µs read 0.0000 s. Timing a recursive fib(6) gave:

Total time: 0.0000 s.

fib: 0.0000 s (100.00%)
..  fib: 0.0000 s (89.07%)
...

Each time now has three decimals, in µs, ms or s, whichever keeps the number below 1000:

Total time: 42.750 µs.

fib: 42.750 µs (100.00%)
..  fib: 38.583 µs (90.25%)
..  ..  fib: 33.332 µs (77.97%)
..  ..  ..  fib: 23.333 µs (54.58%)
..  ..  ..  ..  fib: 8.624 µs (20.17%)
..  ..  ..  ..  ..  fib: 1.000 µs (2.34%)

The unit is picked after rounding, so 999.9996 µs reads 1.000 ms, never 1000.000 µs. Seconds keep millisecond resolution (2.500 s, 3725.000 s). get_execution_timings() and the JSON export don't change and still return plain seconds.

Compatibility: this changes the report text, which is output for people to read, not a typed API. Anyone parsing it will need to update, and the changelog entry says so. That makes this a minor release rather than a patch.

Release: bumps __version__ to 1.1.0 and adds the [1.1.0] changelog section. The bug-report template's version placeholder is now 1.1.0.

Docs: the example outputs in the README, index, getting started, reports, timing-code and counters pages are replaced with real output from running those examples on this branch. The reports guide, the getting-started report explanation and the get_execution_times_report docstring describe the unit rule. The getting-started text quoted validate's percentage from the old output (13.88%); it now matches the new output (13.97%).

Checklist

  • uv run pytest --cov passes (120 tests, 100% statement and branch coverage). It also passes locally on 3.12, 3.13, 3.14 and 3.14t.
  • uv run ruff check and uv run ruff format --check pass
  • uv run basedpyright passes (0 errors, 0 warnings)
  • Behaviour changes are covered by a test: 8 parametrized cases covering each unit and both rounding boundaries all fail on main and pass here; three existing exact-report assertions are updated
  • CHANGELOG.md updated
  • uv build and twine check --strict pass, and the wheel reports 1.1.0.
  • The Sphinx build passes with -W -n.

The text report printed seconds with four decimals, so any section under
50 µs read 0.0000 s; a whole recursive fib(6) call tree came out as zeros.
Each time now has three decimals in the largest of µs, ms and s that keeps
the number below 1000, picked after rounding so 999.9996 µs reads 1.000 ms.

The dictionary and JSON readers are unchanged and still return seconds.
Docs examples show real output from the new format.
Bump __version__ to 1.1.0 and move the report-units entry into its
changelog section. The report text changes format, so this is a minor
release rather than a patch.

Also correct the getting-started percentage that the refreshed example
output no longer matched, explain the report units there, and update the
bug template's version placeholder.
@seba2390 seba2390 changed the title Show report times in µs, ms or s so fast sections stay visible Release 1.1.0: show report times in µs, ms or s so fast sections stay visible Sep 30, 2026
@seba2390
seba2390 merged commit fe5bc5f into main Sep 30, 2026
19 checks passed
@seba2390
seba2390 deleted the report/readable-units branch September 30, 2026 21:55
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.

1 participant