Summary
This issue tracks the migration of the Utils module from CTModels.jl to CTBase.jl.
Rationale
The Utils module contains general-purpose utility functions (interpolation, matrix operations, function transformations) that are not specific to optimal control problems. These utilities are better placed in CTBase.jl as they can be reused across the entire control-toolbox ecosystem.
Scope
Files to move:
src/Utils/Utils.jl (main module)
src/Utils/function_utils.jl (private utilities)
src/Utils/macros.jl (private utilities)
src/Utils/interpolation.jl (public utilities)
src/Utils/matrix_utils.jl (public utilities)
Tests to move:
test/suite/utils/test_function_utils.jl
test/suite/utils/test_interpolation.jl
test/suite/utils/test_macros.jl
test/suite/utils/test_matrix_utils.jl
Public API
The following functions will be moved and should be accessible via CTBase.function_name():
ctinterpolate: Linear interpolation for data
ctinterpolate_constant: Piecewise-constant interpolation for data
matrix2vec: Convert matrices to vectors
Implementation Plan
- Create branch for the move
- Remove Utils module from CTModels.jl
- Add Utils module to CTBase.jl (see corresponding issue)
- Update imports and references in CTModels.jl
- Move tests to CTBase.jl
- Update documentation
Breaking Changes
- Users importing from
CTModels.Utils will need to update to CTBase.Utils
- This is a breaking change but should be straightforward to migrate
Related Issues
Summary
This issue tracks the migration of the
Utilsmodule from CTModels.jl to CTBase.jl.Rationale
The
Utilsmodule contains general-purpose utility functions (interpolation, matrix operations, function transformations) that are not specific to optimal control problems. These utilities are better placed in CTBase.jl as they can be reused across the entire control-toolbox ecosystem.Scope
Files to move:
src/Utils/Utils.jl(main module)src/Utils/function_utils.jl(private utilities)src/Utils/macros.jl(private utilities)src/Utils/interpolation.jl(public utilities)src/Utils/matrix_utils.jl(public utilities)Tests to move:
test/suite/utils/test_function_utils.jltest/suite/utils/test_interpolation.jltest/suite/utils/test_macros.jltest/suite/utils/test_matrix_utils.jlPublic API
The following functions will be moved and should be accessible via
CTBase.function_name():ctinterpolate: Linear interpolation for datactinterpolate_constant: Piecewise-constant interpolation for datamatrix2vec: Convert matrices to vectorsImplementation Plan
Breaking Changes
CTModels.Utilswill need to update toCTBase.UtilsRelated Issues