Skip to content

CTBase.jl — Ecosystem Foundation ​

CTBase.jl is the foundational package of the control-toolbox ecosystem. It provides the base layer shared by all packages: common types, structured exceptions, description management, compile-time traits, trait-carrying data wrappers, extension infrastructure, and developer tools.

Qualified access

CTBase exports no symbols at the package level. Every public symbol is accessed via its full qualified path, e.g. CTBase.Exceptions.IncorrectArgument or CTBase.Descriptions.add. This makes the origin of every symbol explicit at every call site and prevents namespace collisions between packages.

Downstream packages (e.g. OptimalControl.jl) may re-export selected symbols for convenience.

Ask DeepWiki

DeepWiki offers an interactive, AI-generated overview of this codebase. Answers may be inaccurate — use this reference documentation as the source of truth.

Submodule overview ​

SubmoduleRole
CTBase.CoreShared foundations: ctNumber, the NotProvided sentinel, extension tags and caches, the @ensure macro, matrix/function helpers, and the color palette
CTBase.ExceptionsTyped exception hierarchy with rich context fields
CTBase.TraitsCompile-time trait types: time, variable and control dependence, mutability, feedback, constraint kind, dynamics, AD and variable-costate capabilities
CTBase.DataTrait-carrying function wrappers: vector fields, Hamiltonians, pseudo-Hamiltonians, control laws, path constraints, multipliers, and their compositions
CTBase.DescriptionsSymbolic description tuples: catalogue management, pattern completion, similarity search
CTBase.OptionsGeneric option handling: provenance tracking, schema definition, validation, and aliases
CTBase.StrategiesStrategy contract, registry, building/validation, and metadata for pluggable algorithmic components
CTBase.OrchestrationOption routing and disambiguation between problem-level actions and strategies
CTBase.DifferentiationAD-backend strategies for gradients, derivatives, partial derivatives, and Jacobian–vector products
CTBase.InterpolationLinear and piecewise-constant interpolation with flat extrapolation
CTBase.DevToolsDeveloper tools with tag-based dispatch for run_tests, postprocess_coverage, automatic_reference_documentation, and the documentation helpers repl_without_extensions and warnings_without_paths
CTBase.UnicodeUnicode subscript/superscript helpers for display
CTBase.PlottingBackend-agnostic plotting IR: series, axes, layout tree, and a render contract with Plots.jl and Makie.jl backends

Guides ​

  • Getting Started — installation, mental model, 5-minute walkthrough.

  • Exceptions — exception hierarchy, choosing the right type, best practices.

  • Traits — compile-time trait types, the opt-in contract, and predicate functions.

  • Data — trait-carrying wrappers for vector fields and Hamiltonians.

  • Descriptions — catalogue API, pattern matching, error handling.

  • Options System — option schema, validation, aliases, and provenance.

  • Implementing a Strategy — the strategy contract and how to add one.

  • Orchestration & Routing — routing options to strategies with disambiguation.

  • Strategy Parameters — CPU/GPU specialization of strategies.

  • Differentiation — AD-backend strategies and differentiation primitives (extension-backed).

  • Test Runner — modular test infrastructure with CTBase.DevTools.run_tests.

  • Coverage — post-processing coverage artifacts with CTBase.DevTools.postprocess_coverage.

  • Performance — hot path vs setup path, type-stability checks with JET.

  • API Documentation — auto-generating per-module API pages.

  • Color System — semantic color roles, built-in themes, and runtime customization.

  • Interpolation — linear and piecewise-constant interpolation with flat extrapolation.

  • Unicode Helpers — subscript and superscript character generation for display.

  • Plotting Engine — backend-agnostic plotting IR, panels, combinators, and a render contract with Plots.jl and Makie.jl backends.

To browse the complete API, see the API Reference section in the left sidebar.