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: 18 additions & 2 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This document describes breaking changes in CTModels releases and how to migrate your code.

## [0.19.4-beta] - unreleased
## [0.19.5] - 2026-09-17

### No Breaking Changes

Expand Down Expand Up @@ -674,6 +674,7 @@ The package automatically detects and handles both formats. All tests pass (3324
### Migration Notes

No action required for users. All existing code continues to work unchanged. This is an internal improvement that:

- Removes a redundant generic method
- Improves type safety and method dispatch clarity
- Maintains all existing public APIs
Expand Down Expand Up @@ -770,11 +771,13 @@ Existing plotting code continues to work unchanged.
### Module and Type Renaming

#### Overview

The InitialGuess module has been renamed to `Init` for better API ergonomics and more concise naming. This is a **breaking change** that requires users to update their imports and type references.

#### What Changed

##### Module Name

```julia
# Before (0.8.2-beta and earlier)
using CTModels.InitialGuess
Expand All @@ -784,6 +787,7 @@ using CTModels: Init
```

##### Type Names

```julia
# Before
pre = CTModels.OptimalControlPreInit(...)
Expand Down Expand Up @@ -829,11 +833,13 @@ pre_init = CTModels.PreInitialGuess(state=0.1, control=0.2)
### InitialGuess Validation Architecture Change

#### Overview

Refactored the InitialGuess validation system to follow Single Responsibility Principle. This is an **internal architectural change** that does not affect the public API behavior but improves code organization.

#### What Changed

##### Construction vs Validation Separation

```julia
# Before (0.8.1-beta and earlier)
# initial_guess() validated internally, build_initial_guess() had mixed responsibilities
Expand All @@ -844,6 +850,7 @@ Refactored the InitialGuess validation system to follow Single Responsibility Pr
```

##### Validation Coverage Fix

```julia
# Before: This case was NOT validated (potential runtime error)
bad_init = CTModels.InitialGuess(wrong_dimensions...)
Expand All @@ -856,6 +863,7 @@ validated = CTModels.build_initial_guess(ocp, bad_init) # Throws IncorrectArgum
#### Migration Required

**No user code changes required** - this is an internal refactoring that:

- Maintains all existing public APIs
- Fixes a validation gap for direct `AbstractInitialGuess` inputs
- Improves error detection and code reliability
Expand All @@ -874,13 +882,15 @@ validated = CTModels.build_initial_guess(ocp, bad_init) # Throws IncorrectArgum
### Module Migration to CTSolvers

#### Overview

Major refactoring where several modules have been moved from CTModels to the new CTSolvers package.

#### Moved Modules

The following modules are no longer part of CTModels and must be imported from CTSolvers:

- **Options** → `using CTSolvers: Options`
- **Strategies** → `using CTSolvers: Strategies`
- **Strategies** → `using CTSolvers: Strategies`
- **Orchestration** → `using CTSolvers: Orchestration`
- **Optimization** → `using CTSolvers: Optimization`
- **Modelers** → `using CTSolvers: Modelers`
Expand All @@ -889,6 +899,7 @@ The following modules are no longer part of CTModels and must be imported from C
#### Migration Guide

##### Before (CTModels < 0.8.0)

```julia
using CTModels
using CTModels.Options
Expand All @@ -897,6 +908,7 @@ using CTModels.Optimization
```

##### After (CTModels ≥ 0.8.0)

```julia
using CTModels
using CTSolvers: Options
Expand All @@ -907,6 +919,7 @@ using CTSolvers: Optimization
#### Specific Changes

##### Option Types

```julia
# Before
using CTModels.Options
Expand All @@ -918,6 +931,7 @@ opt = CTSolvers.OptionValue(100, :user)
```

##### Strategy Types

```julia
# Before
using CTModels.Strategies
Expand All @@ -929,6 +943,7 @@ strategy = CTSolvers.DirectStrategy()
```

##### Modelers

```julia
# Before
using CTModels.Modelers
Expand All @@ -940,6 +955,7 @@ modeler = CTSolvers.ADNLPModeler()
```

##### DOCP Types

```julia
# Before
using CTModels.DOCP
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ All notable changes to this project 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.19.4-beta] - unreleased
## [0.19.5] - 2026-09-17

### 📚 Documentation

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 = "CTModels"
uuid = "34c4fa32-2049-4079-8329-de33c2a22e2d"
version = "0.19.4-beta"
version = "0.19.5"
authors = ["Olivier Cots <olivier.cots@toulouse-inp.fr>"]

[deps]
Expand Down
10 changes: 5 additions & 5 deletions test/suite/serialization/test_multi_grids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ function test_multi_grids()
successful=Solutions.successful(sol_unified),
)

filename = tempname()

# Export
Serialization.export_ocp_solution(
sol_multi; filename="multi_grid_test", format=:JLD
)
Serialization.export_ocp_solution(sol_multi; filename=filename, format=:JLD)

# Import
sol_reloaded = Serialization.import_ocp_solution(
ocp; filename="multi_grid_test", format=:JLD
ocp; filename=filename, format=:JLD
)

# Verify time grid model type
Expand All @@ -193,7 +193,7 @@ function test_multi_grids()
Components.control(sol_multi)(t) atol=1e-8
end

remove_if_exists("multi_grid_test.jld2")
remove_if_exists(filename * ".jld2")
end

# ====================================================================
Expand Down
Loading