v0.1.35 - Timestamp Precision Enhancement (2025-12-13)¶
What Changed?¶
This release improves timestamp precision for device responses by changing the received_us field from seconds to microseconds. The type annotation has also been updated from float to int for accuracy. This enables higher-precision timing analysis and event correlation without changing the public API.
What's New¶
Enhancement: Microsecond Timestamp Precision¶
What it does:
The received_us field in device responses now uses microsecond precision instead of second precision. This field records when a response/event was received by the library.
Why it matters:
- Higher precision enables accurate event timing correlation
- Useful for performance analysis and latency measurement
- Type annotation (
intinstead offloat) provides better type safety - No API changesβusers can seamlessly use the higher-precision values
Technical details:
Changed from:
received_us: float | None = None # seconds since epoch
To:
received_us: int | None = None # microseconds since epoch
The timestamp is calculated as int(time.time() * 1_000_000) in both PortDevice and MockDevice.
Installation¶
Quick Start¶
# Get the release
git checkout vX.Y.Z
# Setup
task env:setup
# Run CLI
uv run kazunoko --help
What's Different from the Last Version?¶
β Added¶
- None (refactoring/enhancement release)
π§ Changed¶
DeviceResponse.received_usnow usesinttype instead offloat- Timestamp precision changed from seconds to microseconds
- Both
PortDeviceandMockDevicenow return microsecond timestamps
π Fixed¶
- Type accuracy:
intis semantically correct for microsecond timestamps
Is It Safe to Upgrade?¶
Backward Compatible: Mostly Yes
- Type change from
floattointis compatible for most use cases - If code explicitly checks
isinstance(response.received_us, float), it will need updating - Values are now 1,000,000x larger (seconds to microseconds)
- All existing functionality remains unchanged
Tests Passed¶
- β Builds without errors
- β Type checking (mypy) - no new errors
- β Linting (ruff) - all checks passed
- β Consistent across all modules (device.py, mock.py, parser.py)
Release Details¶
- Date: 2025-12-13
- Version: v0.1.35
- Files Changed: 3
- Commits:
48abfcb
Next Steps¶
- Continue improving code quality and maintainability
- Consider adding comprehensive test coverage for timestamp handling
- Future enhancements may include nanosecond precision if needed