Skip to content

Add least_squares, reset_knots, keep_knots across all fitter types#42

Merged
perazz merged 1 commit intomainfrom
pr-a-api-cleanup
Feb 16, 2026
Merged

Add least_squares, reset_knots, keep_knots across all fitter types#42
perazz merged 1 commit intomainfrom
pr-a-api-cleanup

Conversation

@perazz
Copy link
Owner

@perazz perazz commented Feb 16, 2026

Summary

  • Add least_squares to fitpack_parametric_curve (inherited by fitpack_closed_curve and fitpack_constrained_curve), completing consistent API across all 9 fitter types
  • Add reset_knots optional parameter to interpolate on all 9 types — when .false., preserves the current knot set as a starting point instead of recomputing from scratch
  • Add keep_knots optional parameter to fit on all 9 types — bypasses the iopt guard so callers (like interpolate(reset_knots=.false.)) can continue from the current knot configuration
  • Extend test_umbrella_api with parametric curve interpolate/least_squares coverage and fp value checks (fp=0 for interpolation, fp>0 for least-squares)

Test plan

  • fpm build compiles cleanly
  • fpm test — all 51 tests pass, 0 failures
  • New test verifies interpolate(reset_knots=.false.) achieves fp=0
  • New test verifies least_squares() after smoothing fit gives fp>0

- Add least_squares(smoothing, reset_knots) to all 9 fitter types
  (was missing from fitpack_parametric_curve). When reset_knots=.true.,
  a smoothing pre-fit determines sparser knots before the LS pass.
- Add interpolate(reset_knots) to all 9 types (default .true.).
  When .false., FITPACK continues from current knots.
- Add keep_knots parameter to fit() to bypass the iopt guard.
- Extend test_umbrella_api with parametric curve interpolate/LS tests.
- Mark PR A (Public API Cleanup) as done in refactoring plan.
@perazz perazz merged commit 43d18c9 into main Feb 16, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant