Skip to content

refactor: add missing features - #577

Open
sathvikbhagavan wants to merge 8 commits into
masterfrom
sb/remaining
Open

refactor: add missing features#577
sathvikbhagavan wants to merge 8 commits into
masterfrom
sb/remaining

Conversation

@sathvikbhagavan

@sathvikbhagavan sathvikbhagavan commented Aug 4, 2026

Copy link
Copy Markdown
Member

This PR does:

  • Adds full Matrix/Vector{Vector} support (construct, eval, derivative, integral) to Akima, QuadraticSpline, CubicSpline, CubicHermiteSpline, QuinticHermiteSpline, SmoothedConstantInterpolation, BSplineInterpolation/BSplineApprox, and closes remaining integral/derivative gaps in Linear/Quadratic/ConstantInterpolation.
  • Adds an analytical integral and Vector{Vector} construction support to SmoothArcLengthInterpolation, and fixes its cache_parameters kwarg, which was silently ignored (always built as if false).
  • Fixes a few bugs: broken integral caching for Vector{Vector} data, an integrate_cubic_polynomial array-arithmetic bug, wrong extrapolation indexing in SmoothedConstantInterpolation, a single-point ConstantInterpolation edge case, and a SmoothArcLengthInterpolation aliasing bug where A.(t_vec) (broadcasting) and the documented Vector{Vector}-out in-place form silently returned the same last-evaluated buffer for every element instead of distinct values (root cause: an in_place buffer-reuse kwarg unique to this type, now removed so it behaves like every other interpolation).
  • Fixes the Plots.jl recipe, which silently produced garbage (thousands of degenerate one-point series) or errored outright for any Matrix/Vector{Vector}-valued interpolation — plotting effectively never worked for multi-dimensional data before this. Also fixes a related regression risk for BSplineApprox specifically: its "Data points" series must show the true raw data, not the smoothed curve re-evaluated at the knots.
  • Fixes show/pretty-printing, which crashed for higher-rank (AbstractArray{T,3}) data and silently mis-rendered Vector{Matrix} data.
  • Rewrites SmoothArcLengthInterpolation's _interpolate/_derivative to avoid in-place broadcast assignment, fixing Zygote/Mooncake/ForwardDiff differentiability w.r.t. t (previously failed unconditionally with "Mutating arrays is not supported").
  • Adds Zygote/Mooncake AD test coverage for all the new shape-support code paths, plus new t-derivative coverage for SmoothArcLengthInterpolation (its u-gradient through the constructor remains unsupported by both frameworks — documented, not fixed, since it requires rewriting the mutation-heavy geometry-fitting algorithm).
  • Documents all of the above in the README (new Feature Support and Automatic Differentiation tables) and docs (SmoothArcLengthInterpolation added to the interpolation listing, tutorial simplified now that Vector{Vector} input no longer needs manual hcat).
  • Full test suite passes with zero failures/errors; verified consistent results across shapes, cache_parameters, and all extrapolation modes.

Made with Claude Code

@sathvikbhagavan
sathvikbhagavan marked this pull request as ready for review August 10, 2026 00:41
@ChrisRackauckas

Copy link
Copy Markdown
Member

wow, that's a lot 😅 😅 😅 😅 😅 😅 😅 😅 😅 😅 😅 😅 😅

@sathvikbhagavan

Copy link
Copy Markdown
Member Author

Yeah 😅
I started off with just to add support for higher order arrays for the remaining methods and then went down the rabbit hole. Also, a big chunk of changes are in tests.

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.

2 participants