Skip to content

v0.14.2 - User-Controlled Threshold Range in fit_thresholds.py (2026-02-07)

What Changed?

This release adds user-controlled threshold range functionality to the fit_thresholds.py analysis script. Users can now specify which threshold values to analyze instead of relying on auto-detection from measurement data. The feature is fully backward compatibleβ€”existing scripts continue to work unchanged with automatic range detection.


What's New

Main Feature: Threshold Range Control in fit_thresholds.py

What it does: Allows users to specify the exact threshold range for curve fitting analysis via CLI parameters (--min, --max, --step). This enables precise control over which measured data is included in the analysis without requiring manual data filtering.

How to use it:

  1. Auto-detect range (default - backward compatible):
uv run fit_thresholds.py ./measurements
  1. Specify custom threshold range:
uv run fit_thresholds.py ./measurements --min 200 --max 400 --step 5
  1. With verbose output and save:
uv run fit_thresholds.py ./measurements --min 200 --max 400 --step 5 --verbose --save

Code example:

# New function to create user-defined threshold range
threshold_range_df = create_threshold_data(
    min_threshold=200,
    max_threshold=400,
    step_size=5,
    channel=1
)

# Process data with user-defined range
x, y = process_threshold_data(
    df,
    channel=1,
    threshold_range_df=threshold_range_df,  # New parameter
    verbose=True
)

Installation

Quick Start

# Get the release
git checkout v0.14.2

# Setup
uv sync

# Run the analysis script
uv run examples/fit_thresholds.py --help

What's Different from the Last Version?

βœ… Added

  • New function create_threshold_data() to generate user-defined threshold range DataFrames
  • CLI parameters: --min, --max, --step for specifying analysis threshold range
  • Parameter validation ensuring all three range parameters provided together
  • Clear error messages for invalid parameter combinations
  • Verbose logging showing whether auto-detection or user-defined range is being used
  • Comprehensive documentation and usage examples in module docstring

πŸ”§ Changed

  • Modified process_threshold_data() signature to accept optional threshold_range_df parameter
  • Updated module and function docstrings with new options and examples
  • Enhanced verbose output to display range information for each channel

βœ… Backward Compatible

  • No breaking changes; existing scripts work unchanged
  • Auto-detection mode remains the default when parameters not provided

Is It Safe to Upgrade?

Backward Compatible: βœ… Yes

  • All existing scripts continue to work without modifications
  • New CLI parameters are optional; scripts using fit_thresholds.py without them behave identically to v0.14.1
  • No changes to core library or API surface
  • Safe for production use

Tests Passed

  • βœ… Builds without errors
  • βœ… Auto-detection mode (backward compatibility)
  • βœ… User-defined range mode
  • βœ… Parameter validation (incomplete, invalid range, invalid step)
  • βœ… Results saved to JSON with custom ranges
  • βœ… Verbose logging displays correct range information
  • βœ… All channels analyzed consistently with same range

Release Details

  • Date: 2026-02-07
  • Version: v0.14.2
  • Files Changed: 1 (examples/fit_thresholds.py)
  • Commits:
  • 1a9b19b - feat(examples): add user-controlled threshold range to fit_thresholds.py
  • 3867225 - bump: version 0.14.1 β†’ 0.14.2
  • Lines Added: 147
  • Lines Removed: 20

Next Steps

Future Enhancements (out of scope for v0.14.2):

  • Per-channel threshold ranges (different ranges for each channel)
  • Auto-suggestion of optimal ranges based on data statistics
  • Interactive mode for specifying ranges
  • Range validation warnings when no data exists in specified range