Skip to content

Comments

(breaking): remove legacy Symbol extrapolation API#40

Merged
mgyoo86 merged 5 commits intomasterfrom
cleanup/remove_Symbol_extrap
Feb 23, 2026
Merged

(breaking): remove legacy Symbol extrapolation API#40
mgyoo86 merged 5 commits intomasterfrom
cleanup/remove_Symbol_extrap

Conversation

@mgyoo86
Copy link
Collaborator

@mgyoo86 mgyoo86 commented Feb 20, 2026

Summary

Remove the deprecated Symbol-based extrapolation API (extrap=:none, extrap=:constant, etc.) and the ParabolaFit alias. All extrapolation is now specified exclusively through typed AbstractExtrap subtypes introduced in PR #38.

This is a breaking change for any code still using Symbol-based extrap keywords or ParabolaFit.

Motivation

PR #38 introduced typed AbstractExtrap dispatch (NoExtrap(), ConstExtrap(), ExtendExtrap(), WrapExtrap()) for all 1D interpolants, with deprecation warnings on the old Symbol path. PR #37 did the same for ND interpolants. Both have been released since v0.2.11 — the deprecation period is complete.

Removing the legacy code path eliminates:

Removed code Original Purpose
@_dispatch_extrap macro Runtime Symbol → if-elseif branching at every call site
_validate_extrap(::Symbol) Symbol validation (extrap in (:none, :constant, ...))
_check_domain(x, xi, ::Val{:none/...}) Domain checks dispatching on Val{Symbol}
_symbol_to_extrap_mode Symbol → AbstractExtrap conversion with depwarn
_resolve_extrap_nd(::Symbol, ...) ND Symbol resolution path
_to_extrap_vals / ExtrapVal union NTuple{N, Val{Symbol}} conversion and type alias
_EXTRAP_SYMBOL_DEPWARN constant Deprecation message string
ParabolaFit function Deprecated alias for QuadraticFit with depwarn

Changes

Commit Description
93dc120 Remove all Symbol-based extrap infrastructure from utils.jl, eval_ops.jl, nd_utils.jl, bc_types.jl; remove ParabolaFit export
6f6fdc5 Rename ND extrap testsets and update comments to reflect typed-only API
85da202 Update all remaining extrap=:symbol references across source, tests, docs, examples, and extensions to use NoExtrap() / ConstExtrap() / ExtendExtrap() / WrapExtrap()

Migration Guide

# Before (removed)
itp = cubic_interp(x, y; extrap=:none)
itp = cubic_interp(x, y; extrap=:constant)
itp = cubic_interp(x, y; extrap=:extension)
itp = cubic_interp(x, y; extrap=:wrap)
itp = cubic_interp(x, y; bc=Left(ParabolaFit()))

# After (required)
itp = cubic_interp(x, y; extrap=NoExtrap())
itp = cubic_interp(x, y; extrap=ConstExtrap())
itp = cubic_interp(x, y; extrap=ExtendExtrap())
itp = cubic_interp(x, y; extrap=WrapExtrap())
itp = cubic_interp(x, y; bc=Left(QuadraticFit()))

Impact

  • ~790 lines removed across 107 files (net −791 lines)
  • No new features or behavioral changes — pure removal of deprecated code paths
  • All AbstractExtrap subtypes and typed dispatch remain unchanged
  • Docstrings cleaned: removed "Replaces extrap=:symbol" references

BREAKING CHANGE: All extrap keyword arguments now require AbstractExtrap
type instances (NoExtrap(), ConstExtrap(), ExtendExtrap(), WrapExtrap())
instead of Symbol literals (:none, :constant, :extension, :wrap).

- Remove @_dispatch_extrap macro and _validate_extrap(::Symbol)
- Remove @_dispatch_extrap_nd macro and all ND Symbol dispatch helpers
- Remove _check_domain(x, xi, ::Val{:none}) overloads (use ::NoExtrap)
- Remove 2-arg _resolve_extrap_nd(extrap, Val(N)) Symbol path
- Remove ParabolaFit deprecated alias and its export
- Update all tests, examples, and benchmarks to use AbstractExtrap types
- Fix stale test Dict lookup and Symbol iteration in series interp tests

94 files changed, -798 lines net. Full test suite passes (98% coverage).
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated Symbol-based extrapolation API (e.g., extrap=:none, extrap=:constant) in favor of typed AbstractExtrap subtypes (NoExtrap(), ConstExtrap(), etc.) introduced in PRs #38 and #37. The deprecation warnings have been in place since v0.2.11, making this a clean breaking change for v0.3.0.

Changes:

  • Removed all Symbol-based extrapolation infrastructure (~790 lines of deprecated code)
  • Removed ParabolaFit deprecated alias for QuadraticFit
  • Updated all tests, docs, examples, and extensions to use typed extrapolation API

Reviewed changes

Copilot reviewed 107 out of 107 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/*.jl (50+ files) Converted all extrap=:symbol to typed NoExtrap()/ConstExtrap()/ExtendExtrap()/WrapExtrap()
src/core/eval_ops.jl Removed ExtrapVal union, _symbol_to_extrap_mode(), cleaned up docstrings
src/core/nd_utils.jl Removed Symbol-based _resolve_extrap_nd(), _to_extrap_vals(), deprecation constant
src/core/bc_types.jl Removed ParabolaFit deprecated alias
src/*/*_types.jl Updated constructors to accept only AbstractExtrap (removed Union{Symbol,AbstractExtrap})
src/*/*_oneshot.jl Removed Symbol dispatch logic and deprecation warnings
src/*/*_interpolant.jl Cleaned up type signatures
docs/src/*.md Updated all documentation examples
ext/*.jl Updated extension examples
examples/*.jl Updated example code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FastInterpolations.jl Benchmarks

Details
Benchmark suite Current: acb6424 Previous: f9c51d7 Ratio
10_nd_construct/bicubic_2d 66795 ns 64061 ns 1.04
10_nd_construct/bilinear_2d 1785.14 ns 1776.14 ns 1.01
10_nd_construct/tricubic_3d 393717 ns 411573 ns 0.96
10_nd_construct/trilinear_3d 4565.36 ns 4404.88 ns 1.04
11_nd_eval/bicubic_2d_batch 1850.5 ns 1823.5 ns 1.01
11_nd_eval/bicubic_2d_scalar 31.96 ns 33.96 ns 0.94
11_nd_eval/bilinear_2d_scalar 28.25 ns 27.86 ns 1.01
11_nd_eval/tricubic_3d_batch 3718 ns 3683 ns 1.01
11_nd_eval/tricubic_3d_scalar 56.51 ns 58.81 ns 0.96
11_nd_eval/trilinear_3d_scalar 32.26 ns 31.96 ns 1.01
1_cubic_oneshot/q00001 573.26 ns 594.12 ns 0.96
1_cubic_oneshot/q10000 64450.7 ns 64179.6 ns 1.00
2_cubic_construct/g0100 1495.02 ns 1508.84 ns 0.99
2_cubic_construct/g1000 15120.3 ns 15173.5 ns 1.00
3_cubic_eval/q00001 40.57 ns 42.28 ns 0.96
3_cubic_eval/q00100 511.16 ns 515.98 ns 0.99
3_cubic_eval/q10000 45392.9 ns 45484.5 ns 1.00
4_linear_oneshot/q00001 46.58 ns 45.18 ns 1.03
4_linear_oneshot/q10000 37577.3 ns 37253 ns 1.01
5_linear_construct/g0100 11.62 ns 14.12 ns 0.82
5_linear_construct/g1000 11.62 ns 14.03 ns 0.83
6_linear_eval/q00001 24.05 ns 23.64 ns 1.02
6_linear_eval/q00100 413.96 ns 408.16 ns 1.01
6_linear_eval/q10000 36096.6 ns 36074.9 ns 1.00
7_cubic_range/scalar_query 26.05 ns 26.04 ns 1.00
7_cubic_vec/scalar_query 16.74 ns 18.43 ns 0.91
8_cubic_multi/construct_s001_q100 1408.64 ns 1391.62 ns 1.01
8_cubic_multi/construct_s010_q100 6550.66 ns 6597 ns 0.99
8_cubic_multi/construct_s100_q100 50615.7 ns 49887.7 ns 1.01
8_cubic_multi/eval_s001_q100 2098.74 ns 2132.4 ns 0.98
8_cubic_multi/eval_s010_q100 3271.12 ns 3377.34 ns 0.97
8_cubic_multi/eval_s010_q100_scalar_loop 4068.22 ns 4062.42 ns 1.00
8_cubic_multi/eval_s100_q100 15234.5 ns 15769.6 ns 0.97
8_cubic_multi/eval_s100_q100_scalar_loop 5008.4 ns 5002.3 ns 1.00
9_nd_oneshot/bicubic_2d 41897.5 ns 43145.1 ns 0.97
9_nd_oneshot/bilinear_2d 1696.96 ns 1686.18 ns 1.01
9_nd_oneshot/tricubic_3d 367210.7 ns 374789.3 ns 0.98
9_nd_oneshot/trilinear_3d 3376.3 ns 3291.1 ns 1.03

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'FastInterpolations.jl Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.

Benchmark suite Current: 85da202 Previous: f9c51d7 Ratio
8_cubic_multi/eval_s100_q100 17878.3 ns 15769.6 ns 1.13

This comment was automatically generated by workflow using github-action-benchmark.

@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.84%. Comparing base (f9c51d7) to head (acb6424).
⚠️ Report is 13 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
+ Coverage   96.82%   97.84%   +1.02%     
==========================================
  Files          71       71              
  Lines        6230     5944     -286     
==========================================
- Hits         6032     5816     -216     
+ Misses        198      128      -70     
Files with missing lines Coverage Δ
src/FastInterpolations.jl 100.00% <ø> (ø)
src/constant/constant_anchor.jl 100.00% <ø> (ø)
src/constant/constant_interpolant.jl 100.00% <ø> (ø)
src/constant/constant_oneshot.jl 98.57% <100.00%> (-0.08%) ⬇️
src/constant/constant_series_interp.jl 95.97% <100.00%> (-0.10%) ⬇️
src/constant/constant_types.jl 100.00% <100.00%> (ø)
src/constant/nd/constant_nd_interpolant.jl 100.00% <100.00%> (ø)
src/constant/nd/constant_nd_oneshot.jl 91.26% <100.00%> (+13.06%) ⬆️
src/constant/nd/constant_nd_types.jl 100.00% <ø> (ø)
src/core/bc_types.jl 100.00% <ø> (ø)
... and 26 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mgyoo86 mgyoo86 merged commit 28e22bf into master Feb 23, 2026
11 checks passed
@mgyoo86 mgyoo86 deleted the cleanup/remove_Symbol_extrap branch February 23, 2026 01:24
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