Skip to content

v0.3.4 - Workflow System & CI Fixes

Choose a tag to compare

@imewei imewei released this 21 Dec 23:53
· 712 commits to main since this release

Highlights

Workflow System (Unified fit() Entry Point)

  • Unified fit() function: Single entry point that coexists with curve_fit() and curve_fit_large()

    • Automatic workflow selection based on dataset size and memory
    • Named presets for common use cases ('fast', 'robust', 'global', etc.)
    • Custom WorkflowConfig for fine-grained control
  • WorkflowTier enum: Processing strategy selection

    • STANDARD: Direct optimization for small datasets (< 100K points)
    • CHUNKED: Memory-efficient chunked processing (100K - 10M points)
    • STREAMING: Streaming optimization for huge datasets (> 10M points)
    • STREAMING_CHECKPOINT: Streaming with automatic checkpointing
  • OptimizationGoal enum: Optimization objective specification

    • FAST: Minimum iterations, relaxed tolerances
    • ROBUST: Multi-start with 5 starting points
    • GLOBAL: Thorough global search with 20 starts
    • MEMORY_EFFICIENT: Aggressive chunking, streaming fallback
    • QUALITY: Tight tolerances with validation passes
  • 7 workflow presets: Ready-to-use configurations

    • fast, robust, global, memory_efficient, quality, hpc, streaming
  • YAML configuration: Load from ./nlsq.yaml with environment variable overrides

  • Cluster detection: HPC environment support with PBS Pro auto-detection

CI/CD Improvements

  • Fixed Windows Unicode encoding for emoji output in example scripts
  • Cross-platform temp paths using tempfile.gettempdir()
  • Added missing test dependencies (nbformat, pyyaml, etc.) for integration workflow

Documentation

  • Migration guide: docs/migration/curve_fit_to_fit.md
  • Complete Sphinx docs for workflow module
  • 148 new tests for workflow system

Installation

pip install nlsq==0.3.4

Quick Start

from nlsq import fit
import jax.numpy as jnp

def model(x, a, b):
    return a * jnp.exp(-b * x)

# Automatic workflow selection
result = fit(model, x, y, p0=[1.0, 0.1])

# Or use presets
result = fit(model, x, y, p0=[1.0, 0.1], preset='robust')

See CHANGELOG.md for full details.