Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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 <olivier.cots@irit.fr>", "Jean-Baptiste Caillau <caillau@univ-cotedazur.fr>"]

[deps]
Expand Down
3 changes: 1 addition & 2 deletions src/Interpolation/Interpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/Interpolation/ctinterpolate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions src/Interpolation/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions test/suite/interpolation/test_interpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
Loading