Skip to content

DependencyTable: read stopwatch durations as float or timedelta - #58

Merged
Paebbels merged 1 commit into
devfrom
claude/stopwatch-timedelta
Oct 19, 2026
Merged

Paebbels merged 1 commit into
devfrom
claude/stopwatch-timedelta

Conversation

@pytooling-claude

Copy link
Copy Markdown

pyTooling #595 (planned for v10.0.0-rc4) makes Stopwatch.Duration, Activity and Inactivity a timedelta; the floats move to DurationInSeconds, ActivityInSeconds, InactivityInSeconds. pyTooling's documentation build installs this package from PyPI, and its dependency-table directive formats two stopwatch values with :.2f - a TypeError with a timedelta. This makes the directive read both forms, so a release of this package can unblock pyTooling #595.

Changes

  • pyTooling.Sphinx.DependencyTable:
    • The log line of a dependency-table uses Stopwatch.DurationInNanoseconds / 1e9 (available since pyTooling 10.0.0rc2) instead of Stopwatch.Duration.
    • DependencyCollector.Seconds converts Stopwatch.Activity with total_seconds() when it's a timedelta; it stays a float.
    • Both places carry # WORKAROUND: pyTooling <10.0.0rc4 and the final form (DurationInSeconds, ActivityInSeconds) as a comment, to replace once the floor is >= 10.0.0rc4. pyEDAA.Reports uses the same marker.

Unit Tests


Related Issues and Pull-Requests

  • Companion of pyTooling #595 and of the pyEDAA.Reports adaptation; for v0.1.0-rc4 (v0.1.0-rc4 #55). pyTooling's doc build passes once both are released.

….0.0rc3 and rc4 answer.

pyTooling #595 (planned for rc4) makes Stopwatch.Duration/Activity/Inactivity a timedelta. pyTooling's own
documentation build installs this package from PyPI and failed on it: f"{stopwatch.Duration:.2f}" and
DependencyCollector.Seconds (Stopwatch.Activity, formatted with :.2f) raise a TypeError with a timedelta.

- The table's log line uses DurationInNanoseconds / 1e9 (exists since rc2).
- DependencyCollector.Seconds converts Activity with total_seconds() when it's a timedelta.
- Both marked '# WORKAROUND: pyTooling <10.0.0rc4' with the final form (DurationInSeconds, ActivityInSeconds) as a
  comment below, to replace once the floor is >= 10.0.0rc4.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@pytooling-claude
pytooling-claude Bot requested a review from Paebbels as a code owner October 19, 2026 20:45
@pytooling-claude pytooling-claude Bot added the Enhancement New feature or request label Oct 19, 2026
@codacy-production

codacy-production Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage 16.67% diff coverage · -0.07% coverage variation

Metric Results
Coverage variation ✅ -0.07% coverage variation (-1.00%)
Diff coverage ✅ 16.67% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (00ac132) 4882 4285 87.77%
Head commit (4fe514c) 4887 (+5) 4286 (+1) 87.70% (-0.07%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#58) 6 1 16.67%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.41%. Comparing base (00ac132) to head (4fe514c).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
pyTooling/Sphinx/DependencyTable.py 16.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #58      +/-   ##
==========================================
- Coverage   85.47%   85.41%   -0.07%     
==========================================
  Files          24       24              
  Lines        4882     4887       +5     
  Branches      786      787       +1     
==========================================
+ Hits         4173     4174       +1     
- Misses        597      601       +4     
  Partials      112      112              
Flag Coverage Δ
unittests 85.41% <16.66%> (-0.07%) ⬇️

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Paebbels
Paebbels merged commit 424e34d into dev Oct 19, 2026
57 of 59 checks passed
@Paebbels
Paebbels deleted the claude/stopwatch-timedelta branch October 19, 2026 23:05
Paebbels added a commit that referenced this pull request Oct 20, 2026
…ng 10.0.0rc4.

pyTooling.Sphinx requires pyTooling 10.0.0rc4 since #53, so the workarounds of #58 for rc3 go:
'DependencyCollector.Seconds' returns 'Stopwatch.ActivityInSeconds', and a table's time is
'Stopwatch.DurationInSeconds'.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@pytooling-claude pytooling-claude Bot mentioned this pull request Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants