diff --git a/BREAKING.md b/BREAKING.md index 6f3b6d2c..36427561 100644 --- a/BREAKING.md +++ b/BREAKING.md @@ -2,6 +2,26 @@ This document outlines all breaking changes introduced in CTBase v0.18.0-beta compared to v0.17.4. Use this guide to migrate your code and understand the impact of these changes. +## Breaking changes (0.27.5-beta) + +- **`Interpolation`: `LinearInterpolant` and `ConstantInterpolant` aliases removed.** + The type aliases `LinearInterpolant = Interpolant{Linear}` and + `ConstantInterpolant = Interpolant{Constant}` have been deleted from + `CTBase.Interpolation` and are no longer exported. + + **Migration:** replace `LinearInterpolant` → `Interpolant{Linear}` and + `ConstantInterpolant` → `Interpolant{Constant}`. + + ```julia + # before + interp = CTBase.Interpolation.ctinterpolate(x, f) + interp isa CTBase.Interpolation.LinearInterpolant + + # after + interp = CTBase.Interpolation.ctinterpolate(x, f) + interp isa CTBase.Interpolation.Interpolant{CTBase.Interpolation.Linear} + ``` + ## Breaking changes (0.25.0-beta) - **`NotProvided` / `NotProvidedType` removed from `CTBase.Options`.** They now live and are diff --git a/CHANGELOG.md b/CHANGELOG.md index ff5a0e94..a8e2ba00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to CTBase will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.27.5-beta] - 2026-07-11 + +### 💥 Breaking Changes + +#### **Interpolation** — `LinearInterpolant` / `ConstantInterpolant` aliases removed + +- **Removed the `LinearInterpolant` and `ConstantInterpolant` type aliases** from + `CTBase.Interpolation`. Use the parameterised form `Interpolant{Linear}` and + `Interpolant{Constant}` instead. The aliases are no longer exported. +- **Why**: the aliases were redundant with the parameterised `Interpolant{M}` type and + added clutter to the public API. The parameterised form is already used everywhere + internally. +- **Migration**: replace `LinearInterpolant` → `Interpolant{Linear}` and + `ConstantInterpolant` → `Interpolant{Constant}`. See [BREAKING.md](BREAKING.md). + ## [0.27.4-beta] - 2026-07-10 ### 🐛 Bug Fixes diff --git a/Project.toml b/Project.toml index 5ba3d1a8..d4bcd89e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "CTBase" uuid = "54762871-cc72-4466-b8e8-f6c8b58076cd" -version = "0.27.4-beta" +version = "0.27.5-beta" authors = ["Olivier Cots ", "Jean-Baptiste Caillau "] [deps] diff --git a/src/Interpolation/Interpolation.jl b/src/Interpolation/Interpolation.jl index 42607b3e..e9c5d832 100644 --- a/src/Interpolation/Interpolation.jl +++ b/src/Interpolation/Interpolation.jl @@ -15,7 +15,6 @@ include(joinpath(@__DIR__, "types.jl")) include(joinpath(@__DIR__, "ctinterpolate.jl")) include(joinpath(@__DIR__, "display.jl")) -export ctinterpolate, ctinterpolate_constant -export Interpolant, LinearInterpolant, ConstantInterpolant +export ctinterpolate, ctinterpolate_constant, Interpolant end # module Interpolation diff --git a/src/Interpolation/ctinterpolate.jl b/src/Interpolation/ctinterpolate.jl index e67e69b0..acf361eb 100644 --- a/src/Interpolation/ctinterpolate.jl +++ b/src/Interpolation/ctinterpolate.jl @@ -46,7 +46,7 @@ the bounds of `x` (returns `f[1]` for `t < x[1]` and `f[end]` for `t >= x[end]`) - `f`: A vector of values to interpolate. # Returns -A callable [`LinearInterpolant`](@ref) that can be evaluated at new points. +A callable [`Interpolant{Linear}`](@ref) that can be evaluated at new points. # Example ```julia-repl @@ -78,7 +78,7 @@ This implements the standard steppost behavior for optimal control: - `f`: A vector of values to interpolate. # Returns -A callable [`ConstantInterpolant`](@ref) that can be evaluated at new points. +A callable [`Interpolant{Constant}`](@ref) that can be evaluated at new points. # Example ```julia-repl diff --git a/src/Interpolation/types.jl b/src/Interpolation/types.jl index 5db421e8..9c425558 100644 --- a/src/Interpolation/types.jl +++ b/src/Interpolation/types.jl @@ -37,8 +37,7 @@ that selects the evaluation rule, so the call is type-stable. # Construction Build instances through the factories [`ctinterpolate`](@ref) (linear) and -[`ctinterpolate_constant`](@ref) (piecewise-constant), or directly via the aliases -[`LinearInterpolant`](@ref) / [`ConstantInterpolant`](@ref). +[`ctinterpolate_constant`](@ref) (piecewise-constant). """ struct Interpolant{M<:AbstractInterpolation,TX,TF} <: Function x::TX @@ -50,16 +49,6 @@ function Interpolant{M}(x::TX, f::TF) where {M<:AbstractInterpolation,TX,TF} return Interpolant{M,TX,TF}(x, f) end -""" -Alias for a linear [`Interpolant`](@ref). -""" -const LinearInterpolant = Interpolant{Linear} - -""" -Alias for a piecewise-constant [`Interpolant`](@ref). -""" -const ConstantInterpolant = Interpolant{Constant} - """ $(TYPEDSIGNATURES) diff --git a/test/suite/interpolation/test_interpolation.jl b/test/suite/interpolation/test_interpolation.jl index c81c3581..b9630b21 100644 --- a/test/suite/interpolation/test_interpolation.jl +++ b/test/suite/interpolation/test_interpolation.jl @@ -116,14 +116,14 @@ function test_interpolation() interp = Interpolation.ctinterpolate([0.0, 1.0, 2.0], [0.0, 1.0, 0.0]) Test.@test interp isa Function Test.@test interp isa Interpolation.Interpolant - Test.@test interp isa Interpolation.LinearInterpolant + Test.@test interp isa Interpolation.Interpolant{Interpolation.Linear} Test.@test Interpolation.method(interp) === Interpolation.Linear Test.@test occursin("linear", sprint(show, interp)) Test.@test occursin("3 nodes", sprint(show, interp)) c = Interpolation.ctinterpolate_constant([0.0, 1.0, 2.0], [1.0, 2.0, 3.0]) Test.@test c isa Function - Test.@test c isa Interpolation.ConstantInterpolant + Test.@test c isa Interpolation.Interpolant{Interpolation.Constant} Test.@test Interpolation.method(c) === Interpolation.Constant Test.@test occursin("constant", sprint(show, c))