Skip to content

v0.4.7 - Threshold Fitting Script Enhancements (2025-12-24)

What Changed?

This release extends structured logging and progress bars to the fit_thresholds.py example script, completing logging integration across all example scripts. The script now logs all threshold fitting operations to JSON files and displays a visual progress bar during JSONL file loading. All improvements maintain backward compatibility with existing threshold fitting workflows.


What's New

Main Feature: Enhanced Threshold Fitting Script with Logging and Progress Bars

What it does: The fit_thresholds.py example script now includes structured logging integration and visual progress bars during JSONL file loading. Users receive real-time feedback on file processing and all operations are logged to JSON files for post-hoc analysis and debugging of threshold fitting sessions.

How to use it: Simply run the fit_thresholds.py script as before - all enhancements are transparent:

# Progress bar shown during file loading
uv run fit_thresholds.py ./measurements

# With verbose output and detailed logging
uv run fit_thresholds.py ./measurements --verbose

# Save results with logging
uv run fit_thresholds.py ./measurements --save

Logs are automatically saved to the platform-specific directory (e.g., ~/Library/Logs/kazunoko/kazunoko.json on macOS) with per-file and fitting details for analyzing threshold fitting sessions.


Installation

Quick Start

# Get the release
git checkout v0.4.7

# Setup
task env:setup

# Run CLI
uv run kazunoko --help

What's Different from the Last Version?

✅ Added

  • Structured logging integration in fit_thresholds.py example script
  • Progress bars for JSONL file loading with visual feedback
  • Per-file loading logging with filename and event count
  • Threshold fitting session logging with channel detection and results
  • PEP 723 script dependencies: loguru, platformdirs
  • JSON logging to platform-specific directories for fitting analysis

🔧 Changed

  • fit_thresholds.py now calls setup_logger() for consistent logging behavior
  • Progress bars display on stderr for file loading
  • File loading loop wrapped in Progress context manager for visual feedback
  • Example script dependencies documented in PEP 723 spec
  • Per-file and fitting operation logging with structured extra fields

🐛 Fixed

  • Adjusted logging verbosity for empty file handling (reduced noise during normal operation)

Is It Safe to Upgrade?

Backward Compatible: Yes

  • All existing functionality preserved
  • Threshold fitting script maintains same command-line interface
  • Progress bars are automatic and transparent
  • Logging happens in background without affecting workflows
  • No changes to data output or fitting algorithm
  • Progress bars enhance visibility without disrupting operations

Tests Passed

  • ✅ Builds without errors
  • ✅ Threshold fitting script logging initialization verified
  • ✅ Progress bars display correctly during file loading
  • ✅ Structured logging captures all fitting operations
  • ✅ Pre-commit hooks passed (commitizen check)

Release Details

  • Date: 2025-12-24
  • Version: v0.4.7
  • Files Changed: 5 (examples/fit_thresholds.py, mkdocs.yml, pyproject.toml, CHANGELOG.md, version files)
  • Commits:
  • cf535a6 - feat: add structured logging to fit_thresholds.py example script
  • 641f761 - feat: add progress bar to fit_thresholds.py JSONL file loading
  • 79d4f10 - refactor: adjust logging verbosity in fit_thresholds.py file loading
  • 9c43901 - bump: version 0.4.6 → 0.4.7

Next Steps

  • Consider adding elapsed time and ETA to progress bars for long-running fitting operations
  • Explore dashboard or monitoring tools for analyzing multi-fitting JSON logs
  • Gather user feedback on progress bar behavior and logging verbosity
  • Evaluate logging integration completeness across all remaining example scripts