Skip to content

Move Utils module to CTBase.jl #319

@ocots

Description

@ocots

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

  1. Create branch for the move
  2. Remove Utils module from CTModels.jl
  3. Add Utils module to CTBase.jl (see corresponding issue)
  4. Update imports and references in CTModels.jl
  5. Move tests to CTBase.jl
  6. 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

  • CTBase.jl: #445

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions