• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hardbyte / python-can / 22640831152
71%

Build:
DEFAULT BRANCH: main
Ran 03 Mar 2026 08:17PM UTC
Jobs 21
Files 91
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Mar 2026 08:16PM UTC coverage: 70.862% (+0.03%) from 70.833%
22640831152

push

github

web-flow
Fix/asc writer timestamps format (#2032)

* feat(asc): add timestamps_format parameter to ASCWriter

Allow callers to choose between 'absolute' (default, existing behaviour)
and 'relative' when creating an ASC log file. The value is written into
the 'base hex  timestamps ...' header line so that other tools
(CANalyzer, CANoe, etc.) can interpret the file correctly.

Closes #2022

* docs: add changelog fragment for #2022

* style: apply black formatting to logformats_test.py

* fix(asc): apply timestamps_format to actual written timestamps, not just header

Previously, log_event() always subtracted self.started from every timestamp
regardless of timestamps_format, meaning "relative" mode only changed the
header line while writing identical data to "absolute" mode.

Per the ASC format specification:
- "absolute": each timestamp is an offset from the start of measurement
- "relative": each timestamp is a delta from the preceding event

Fix log_event() to compute per-event deltas when timestamps_format="relative",
and update self.last_timestamp after each event so the next delta is correct.

Also add two tests that verify the actual values written to the file differ
between the two modes (3-message uneven spacing exposes the distinction at msg3:
absolute writes 1.0, relative writes 0.7).

Update changelog fragment to describe the semantic difference accurately.

* fix(asc): address PR review feedback on timestamps_format

Reviewer feedback received (zariiii9003):

1. Use Literal type hint for timestamps_format parameter
   - Changed: timestamps_format: str = "absolute"
   - To:      timestamps_format: Literal["absolute", "relative"] = "absolute"
   - Added Literal to typing imports

2. Simplify log_event timestamp computation
   - Moved monotonic clamp out of if/else blocks:
     timestamp = max(timestamp, self.last_timestamp)
   - Each branch now contains only simple arithmetic:
     absolute: written_timestamp = timestamp - self.started
     relative: w... (continued)

17 of 17 new or added lines in 1 file covered. (100.0%)

7724 of 10900 relevant lines covered (70.86%)

13.5 hits per line

Jobs
ID Job ID Ran Files Coverage
1 Unittests-ubuntu-latest-py310 - 22640831152.1 03 Mar 2026 08:18PM UTC 91
66.03
GitHub Action Run
2 Unittests-macos-latest-py311 - 22640831152.2 03 Mar 2026 08:17PM UTC 91
63.26
GitHub Action Run
3 Unittests-macos-latest-py312 - 22640831152.3 03 Mar 2026 08:19PM UTC 91
63.26
GitHub Action Run
4 Unittests-windows-latest-py314 - 22640831152.4 03 Mar 2026 08:17PM UTC 91
63.29
GitHub Action Run
5 Unittests-ubuntu-latest-pypy310 - 22640831152.5 03 Mar 2026 08:19PM UTC 91
62.04
GitHub Action Run
6 Unittests-windows-latest-pypy310 - 22640831152.6 03 Mar 2026 08:21PM UTC 91
63.47
GitHub Action Run
7 Unittests-macos-latest-py310 - 22640831152.7 03 Mar 2026 08:17PM UTC 91
63.26
GitHub Action Run
8 Unittests-macos-latest-py313 - 22640831152.8 03 Mar 2026 08:17PM UTC 91
63.26
GitHub Action Run
9 Unittests-windows-latest-pypy311 - 22640831152.9 03 Mar 2026 08:21PM UTC 91
63.42
GitHub Action Run
10 Unittests-macos-latest-pypy310 - 22640831152.10 03 Mar 2026 08:18PM UTC 91
61.7
GitHub Action Run
11 Unittests-ubuntu-latest-py313 - 22640831152.11 03 Mar 2026 08:18PM UTC 91
66.03
GitHub Action Run
12 Unittests-macos-latest-pypy311 - 22640831152.12 03 Mar 2026 08:19PM UTC 91
61.7
GitHub Action Run
13 Unittests-ubuntu-latest-py311 - 22640831152.13 03 Mar 2026 08:18PM UTC 91
66.04
GitHub Action Run
14 Unittests-windows-latest-py312 - 22640831152.14 03 Mar 2026 08:18PM UTC 91
67.87
GitHub Action Run
15 Unittests-windows-latest-py310 - 22640831152.15 03 Mar 2026 08:18PM UTC 91
67.99
GitHub Action Run
16 Unittests-ubuntu-latest-pypy311 - 22640831152.16 03 Mar 2026 08:19PM UTC 91
62.06
GitHub Action Run
17 Unittests-ubuntu-latest-py312 - 22640831152.17 03 Mar 2026 08:19PM UTC 91
66.03
GitHub Action Run
18 Unittests-windows-latest-py311 - 22640831152.18 03 Mar 2026 08:18PM UTC 91
67.87
GitHub Action Run
19 Unittests-macos-latest-py314 - 22640831152.19 03 Mar 2026 08:19PM UTC 91
61.41
GitHub Action Run
20 Unittests-windows-latest-py313 - 22640831152.20 03 Mar 2026 08:18PM UTC 91
67.75
GitHub Action Run
21 Unittests-ubuntu-latest-py314 - 22640831152.21 03 Mar 2026 08:18PM UTC 91
63.42
GitHub Action Run
Source Files on build 22640831152
  • Tree
  • List 91
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #22640831152
  • 59b2e435 on github
  • Prev Build on main (#22527804257)
  • Next Build on main (#22642051689)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc