v0.4.5 - Threshold Scan Script Improvements (2025-12-24)¶
What Changed?¶
This release extends logging and progress bar improvements to get_thresholds.py example script with structured logging and visual progress feedback for threshold scanning. The script now logs all measurement operations to JSON files and displays individual progress bars for each measurement run during both count-based and time-based collection. All improvements maintain backward compatibility with existing threshold scanning workflows.
What's New¶
Main Feature: Enhanced Threshold Scan Script with Logging and Progress Bars¶
What it does: The get_thresholds.py example script now includes structured logging integration and visual progress bars for each measurement run during threshold scanning. Users receive real-time feedback on measurement progress for both count-based and time-based collection, and all operations are logged to JSON files for post-hoc analysis and debugging of threshold scan sessions.
How to use it: Simply run the get_thresholds.py script as before - all enhancements are transparent:
# Progress bar shown for each run during count-based collection
uv run get_thresholds.py "1:300;2:320;3:310" 100 1 --nsteps 10 --step-size 1
# Collect multiple files with 1000 events each per threshold
uv run get_thresholds.py "1:300;2:320;3:310" 1000 1 --nsteps 5 --step-size 2
# Time-based measurement (60 seconds per run)
uv run get_thresholds.py "1:300;2:320;3:310" 60 1 --use-sec --nsteps 10 --step-size 1
# Verbose mode with detailed logging and progress
uv run get_thresholds.py "1:300;2:320;3:310" 100 1 --verbose 2> scan.log
Logs are automatically saved to the platform-specific directory (e.g., ~/Library/Logs/kazunoko/kazunoko.json on macOS) with per-run collection details for troubleshooting threshold scan sessions.
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¶
- Structured logging integration in get_thresholds.py example script
- Progress bars for count-based threshold measurement runs
- Indeterminate progress bars for time-based threshold measurement runs
- Per-run collection logging with run_id, filename, and event count
- Threshold scan session logging with total events and scan mode
- PEP 723 script dependencies: loguru, platformdirs
- JSON logging to platform-specific directories for scan analysis
🔧 Changed¶
- get_thresholds.py now calls setup_logger() for consistent logging behavior
- Progress bars display on stderr for both count-based and time-based collection
- Event streaming loop separated into count-based (determinate progress) and time-based (indeterminate progress) paths
- Example script dependencies documented in PEP 723 spec
- Per-run collection loop enhanced with per-run logging at start and completion
🐛 Fixed¶
- None (enhancement release)
Is It Safe to Upgrade?¶
Backward Compatible: Yes
- All existing functionality preserved
- Threshold scan script maintains same command-line interface
- Progress bars are automatic and transparent
- Logging happens in background without affecting workflows
- No changes to data output when piping to files
- Per-run progress bars enhance visibility without disrupting operations
Tests Passed¶
- ✅ Builds without errors
- ✅ Threshold scan script logging initialization verified
- ✅ Per-run progress bars display correctly in terminal (count-based)
- ✅ Time-based progress bars display correctly with event counting
- ✅ Pre-commit hooks passed (commitizen check)
Release Details¶
- Date: 2025-12-24
- Version: v0.4.5
- Files Changed: 1 (examples/get_thresholds.py, pyproject.toml)
- Commits:
52fa944- feat: add structured logging to get_thresholds.py example script9e0ba5b- feat: add progress bars to get_thresholds.py example script55f47ab- feat: add progress bar to time-based threshold measurementdb52ad5- bump: version 0.4.4 → 0.4.5
Next Steps¶
- Extend logging and progress bars to remaining example scripts (get_fit_thresholds.py, etc.)
- Consider adding elapsed time and ETA to progress bars for time-based collection
- Gather user feedback on progress bar behavior across different collection modes
- Explore dashboard or monitoring tools for analyzing multi-run JSON logs