Skip to content

[WIP] Integrate utilities from CTModels.Utils into CTBase#446

Merged
ocots merged 5 commits into
mainfrom
feature/integrate-utils-from-ctmodels
Jun 12, 2026
Merged

[WIP] Integrate utilities from CTModels.Utils into CTBase#446
ocots merged 5 commits into
mainfrom
feature/integrate-utils-from-ctmodels

Conversation

@ocots

@ocots ocots commented Jun 11, 2026

Copy link
Copy Markdown
Member

This PR implements issue #445: migrating the Utils module from CTModels.jl to CTBase.jl.

Overview

The utilities from CTModels.Utils (interpolation, matrix utilities, function utilities, and validation macros) are generic and reusable across the control-toolbox ecosystem. They should live in CTBase as the foundational layer.

Architectural Decision

Rather than creating a monolithic Utils module (which would violate the "one module per responsibility" philosophy), we are splitting by responsibility:

  • New module Interpolationctinterpolate, ctinterpolate_constant
  • Extension of Corematrix2vec (public), to_out_of_place (private), @ensure (private)

Implementation Plan

The detailed implementation plan is documented in the plan file. Key steps:

  1. Create new Interpolation module with interpolation utilities
  2. Extend Core with matrix, function, and macro utilities
  3. Register modules in src/CTBase.jl
  4. Adapt tests from CTModels to CTBase conventions
  5. Update documentation in docs/api_reference.jl
  6. Verify docstrings follow CTBase conventions

Current Status

This is a placeholder PR to establish the branch. The actual implementation will follow the plan in subsequent commits.

References

ocots added 4 commits June 11, 2026 23:03
- New Interpolation module with ctinterpolate functions
- Extended Core with matrix_utils, function_utils, macros
- Updated docs/api_reference.jl for new modules
- Moved DeepWiki tip in index.md
- Interpolation module: ctinterpolate, ctinterpolate_constant
- Core utilities: matrix_utils, function_utils, macros
- Tests for all new modules
- Added Interpolant{Linear} and Interpolant{Constant} types
- Implemented call methods for each type
- Added display.jl with custom show methods
- Updated docs to include types.jl and display.jl
- Added type stability tests for interpolant calls
@ocots

ocots commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Implementation Complete

All utilities from CTModels.Utils have been successfully integrated into CTBase following the architectural decision to split by responsibility:

New Module: Interpolation

  • src/Interpolation/Interpolation.jl - module manifest
  • src/Interpolation/types.jl - Interpolant{Linear} and Interpolant{Constant} parametric types
  • src/Interpolation/ctinterpolate.jl - ctinterpolate and ctinterpolate_constant factory functions
  • src/Interpolation/display.jl - custom show methods for interpolants
  • test/suite/interpolation/test_interpolation.jl - comprehensive tests including type stability

Core Extensions

  • src/Core/matrix_utils.jl - matrix2vec (public)
  • src/Core/function_utils.jl - to_out_of_place (private)
  • src/Core/macros.jl - @ensure macro (private)
  • Tests in test/suite/core/ for all three utilities

Documentation

  • Updated docs/api_reference.jl to include new modules
  • Added Interpolation section with public and private documentation
  • Updated Core section to include new utility files

Test Results

All 1237 tests pass (41.2s), including:

  • 56 tests for interpolation (type-stable call methods)
  • 18 tests for function_utils
  • 14 tests for macros
  • 26 tests for matrix_utils

The implementation follows CTBase conventions: qualified imports, no top-level exports, typed structs with call methods, and comprehensive docstrings with $(TYPEDSIGNATURES).

@ocots
ocots marked this pull request as ready for review June 12, 2026 15:20
@ocots
ocots merged commit 9c082d9 into main Jun 12, 2026
4 checks passed
@ocots
ocots deleted the feature/integrate-utils-from-ctmodels branch June 12, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant