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.CoreFundamental numeric type alias (ctNumber) and internal display helpers
CTBase.ExceptionsTyped exception hierarchy with rich context fields
CTBase.TraitsCompile-time trait types for time dependence, variable dependence, mutability, and dynamics dispatch
CTBase.DataTrait-carrying function wrappers: VectorField, Hamiltonian, HamiltonianVectorField
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, and automatic_reference_documentation
CTBase.UnicodeUnicode subscript/superscript helpers for display
CTBase.PlottingBackend-agnostic plotting IR: series, axes, layout tree, and render contract

User 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.

  • Strategy Parameters — declaring and resolving strategy options.

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

  • 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.postprocess_coverage.

  • 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 render contract.

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