Repository navigation
Add None, Periodic and Reflective extrapolation and document N-D linear extrapolation - #111
asinghvi17 wants to merge 5 commits into
Conversation
…ntics Complete the per-dimension `ExtrapolationType` options so they cover the same modes as DataInterpolations.jl: - `None` throws an `ExtrapolationError` when evaluating outside the grid of that dimension. Multi-point evaluation checks `t_eval` on the host, so constructing a dimension with out-of-range `t_eval` still works. - `Periodic` and `Reflective` fold the query point onto the grid before index lookup and evaluation, including the precomputed indices and spline basis functions used by `eval_grid` and `eval_unstructured`. Odd derivatives along mirrored copies of a reflective axis change sign. Defaults are unchanged (`Linear` for linear dimensions, `Constant` for constant dimensions, `Extension` for splines). New modes are appended to the enum so existing values keep their integer codes. Mode selection stays an isbits enum compared by value, so evaluation remains allocation free for linear and constant dimensions and has no dynamic dispatch on the mode. Document the tensor-product semantics of `Linear` extrapolation in several dimensions (sides continue with the boundary slope, corners pick up the mixed partial terms) and add tests for 1D agreement with DataInterpolations in every mode, 2D/3D sides and corners against the formula, derivative continuity at the boundary, derivatives against finite differences outside the grid, unchanged defaults and allocations. Also accept heterogeneous input tuples in `make_out`, which failed to dispatch on Julia 1.10 for three or more dimensions, e.g. when ForwardDiff differentiates one coordinate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com> Harness: claude Model: claude-opus-5-5 Factory-Task: 4e5399d0-1eb6-44c0-ab1e-b8c3c4620652 Agent-Harness: Claude 2.1.319 Agent-Model: claude-opus-5-5 Agent-Session: factory task 4e5399d0-1eb6-44c0-ab1e-b8c3c4620652 on m_e7dafdb55d0afc98861a124723a9e3fd (no session URL)
Replace the large 3D and mixed-mode test matrices with seven focused testsets: `None` throws outside the grid, `Periodic` and `Reflective` match DataInterpolations in 1D (values and first derivative, including `eval_grid`), a 2D `Linear` corner check against the tensor-product formula, derivative continuity at the boundary, pinned default values, the Julia 1.10 `make_out` regression with heterogeneous input tuples, and zero allocations. Trim the extrapolation docs to the table of modes, the corner formula and one example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com> Harness: claude Model: claude-opus-5-5 Factory-Task: 7989b2ec-c5ab-4b9b-88b9-c41580512f1a Agent-Harness: Claude 2.1.319 Agent-Model: claude-opus-5-5 Agent-Session: factory task 7989b2ec-c5ab-4b9b-88b9-c41580512f1a on m_e7dafdb55d0afc98861a124723a9e3fd (no session URL)
Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1cd74-b22f-7e02-86f6-7736dfb93f99, reviewed head d69925c
This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers. CI: CI unreadable; review only; merge gates unchanged Riskhigh (H4: the round-two delta deletes distinct numerical, AD, vector-output and multi-point coverage; the whole-PR hot-path changes also match M3). Blocking findings
The review remains blocked: no issue-deferral evidence was supplied, G2 is unsatisfied, and H4 requires a human decision under the supplied risk policy. Non-blocking findings
What I ranAI review produced with codex-cli 0.164.0, model gpt-6.1-sol; local session 01a1cd74-b22f-7e02-86f6-7736dfb93f99 (no session URL). Read the explicitly supplied prior-head review, delta and whole PR diff. No author rating or same-head review was read. Independent risk was recorded in this file before finalizing findings. All commands exported the requested TMPDIR first. Scratch files, environments and logs are in
What I did not verifyLive CI, PR body/comments/reviews, author risk and follow-up issue state were deliberately unread. The explicitly requested previous-head review was the sole review input. GPU interpolation kernels remain unexecuted. I did not run QA, Symbolics extension tests, documentation builds, performance benchmarks, other Julia versions' suites or other platforms. No checkout edits, fixes, commits, pushes, GitHub posts or merges were made. 🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
Unsigned grids no longer wrap around when a query lies below the grid, and far out periodic and reflective queries keep their phase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com> Harness: claude Model: claude-opus-5-5 Factory-Task: 0614e7ad-53fe-44da-a61f-2405053e547c Agent-Harness: Claude 2.1.319 Agent-Model: claude-opus-5-5 Agent-Session: factory task 0614e7ad-53fe-44da-a61f-2405053e547c on m_e7dafdb55d0afc98861a124723a9e3fd (no session URL)
…l_unstructured and folded splines Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com> Harness: claude Model: claude-opus-5-5 Factory-Task: 0614e7ad-53fe-44da-a61f-2405053e547c Agent-Harness: Claude 2.1.319 Agent-Model: claude-opus-5-5 Agent-Session: factory task 0614e7ad-53fe-44da-a61f-2405053e547c on m_e7dafdb55d0afc98861a124723a9e3fd (no session URL)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Anshul Singhvi <anshul.singhvi@juliahub.com> Harness: claude Model: claude-opus-5-5 Factory-Task: 0614e7ad-53fe-44da-a61f-2405053e547c Agent-Harness: Claude 2.1.319 Agent-Model: claude-opus-5-5 Agent-Session: factory task 0614e7ad-53fe-44da-a61f-2405053e547c on m_e7dafdb55d0afc98861a124723a9e3fd (no session URL)
Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1cf3b-7f94-72d3-894d-993a515dd30d, reviewed head 5e56b90
This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers. CI: CI unreadable; review only; merge gates unchanged Riskmedium (M3: coordinate folding is added to evaluation hot paths without a runtime benchmark; new documented public extrapolation modes also match ML7). Independent risk recorded before reading the designated prior review; verdict pending tests. Blocking findingsVerification in progress. Non-blocking findingsPending. What I ranPending. What I did not verifyCI and PR discussion are excluded. 🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5 |
🤖 Automated comment from an AI agent running as @asinghvi17 — not written or reviewed by Anshul.
Adds the remaining DataInterpolations extrapolation modes:
NonethrowsExtrapolationErroroutside the grid.PeriodicandReflectivewrap or mirror the query point onto the grid. Odd derivatives flip sign on mirrored copies of a reflective axis.Defaults are unchanged. It also documents and tests N-D
Linearextrapolation, which already works as a tensor product with bilinear corners.Extends the
ExtrapolationTypeenum from #101 with the DataInterpolations modes it left out (towards #12), keeping the single per-dimensionextrapolationkeyword agreed there.It also fixes
make_outdispatch on Julia 1.10 for 3D calls with mixed argument types, e.g.itp(0.3, 1, 0.7f0)gave aMethodError; the signature is nowTuple{Vararg{Number, N_in}}.🤖 Generated with Claude Code
https://claude.ai/code/session_014mFQHtrhbkjCL96BmvXjDA
🤖 Posted by an AI agent — harness: Claude 2.1.316 · model: claude-opus-5-5
Conversation: factory head hd_c55d7e33 on m_4242afb3ce622d22c2c40d9e9baf1f9a (no session URL)