Private API

This page lists non-exported (internal) symbols of CTSolvers.Options.


From CTSolvers.Options

NotStored

CTSolvers.Options.NotStoredConstant
NotStored

Internal singleton instance of NotStoredType.

Used internally by the option extraction system to signal that an option should not be stored. This is distinct from nothing which is a valid option value.

See also: NotProvided, extract_option

NotStoredType

CTSolvers.Options.NotStoredTypeType
struct NotStoredType

Internal sentinel type used by the option extraction system to signal that an option should not be stored in the instance.

This is returned by extract_option when an option has NotProvided as its default and was not provided by the user.

Note

This type is internal to the Options module and should not be used directly by users. Use NotProvided instead.

See also: NotProvided, extract_option

_construct_option_definition

CTSolvers.Options._construct_option_definitionFunction
_construct_option_definition(
    name::Symbol,
    type::Type,
    default::Nothing,
    description::String,
    aliases::Tuple{Vararg{Symbol}},
    validator::Union{Nothing, Function},
    computed::Bool
) -> CTSolvers.Options.OptionDefinition{Any}

Construct an OptionDefinition with a nothing default value.

This method handles the special case where default = nothing, creating an OptionDefinition{Any} with type = Any since nothing can represent any type.

Arguments

  • name::Symbol: Primary name of the option
  • type::Type: Expected Julia type (ignored for nothing defaults)
  • default::Nothing: Must be nothing
  • description::String: Human-readable description
  • aliases::Tuple{Vararg{Symbol}}: Alternative names (default: empty tuple)
  • validator::Union{Function, Nothing}: Optional validation function (default: nothing)
  • computed::Bool: Whether the default is computed from parameters (default: false)

Returns

  • OptionDefinition{Any}: Option definition with nothing default

Example

julia> using CTSolvers.Options

julia> def = _construct_option_definition(
           :backend,
           Union{Nothing, String},
           nothing,
           "Execution backend",
           (:be,)
       )
OptionDefinition{Any}(...)

julia> default(def)
nothing

See also: OptionDefinition, NotProvided

_construct_option_definition(
    name::Symbol,
    type::Type,
    default::CTSolvers.Options.NotProvidedType,
    description::String,
    aliases::Tuple{Vararg{Symbol}},
    validator::Union{Nothing, Function},
    computed::Bool
) -> CTSolvers.Options.OptionDefinition{CTSolvers.Options.NotProvidedType}

Construct an OptionDefinition with a NotProvided default value.

This method handles the special case where default = NotProvided, creating an OptionDefinition{NotProvidedType}. The declared type is preserved since NotProvided indicates the absence of a default value while maintaining type information for validation.

Arguments

  • name::Symbol: Primary name of the option
  • type::Type: Expected Julia type for user-provided values
  • default::NotProvidedType: Must be NotProvided
  • description::String: Human-readable description
  • aliases::Tuple{Vararg{Symbol}}: Alternative names (default: empty tuple)
  • validator::Union{Function, Nothing}: Optional validation function (default: nothing)
  • computed::Bool: Whether the default is computed from parameters (default: false)

Returns

  • OptionDefinition{NotProvidedType}: Option definition with no default value

Example

julia> using CTSolvers.Options

julia> def = _construct_option_definition(
           :input_file,
           String,
           NotProvided,
           "Input file path",
           (:input,)
       )
OptionDefinition{NotProvidedType}(...)

julia> is_required(def)
true

See also: OptionDefinition, NotProvided, is_required

_construct_option_definition(
    name::Symbol,
    type::Type,
    default,
    description::String,
    aliases::Tuple{Vararg{Symbol}},
    validator::Union{Nothing, Function},
    computed::Bool
) -> CTSolvers.Options.OptionDefinition{Any}

Construct an OptionDefinition with a concrete default value.

This method handles the general case where default is a concrete value. It infers the type parameter T from the default value and validates that the default value is compatible with the declared type.

Arguments

  • name::Symbol: Primary name of the option
  • type::Type: Expected Julia type for the option value
  • default::T: Default value (type T is inferred)
  • description::String: Human-readable description
  • aliases::Tuple{Vararg{Symbol}}: Alternative names (default: empty tuple)
  • validator::Union{Function, Nothing}: Optional validation function (default: nothing)
  • computed::Bool: Whether the default is computed from parameters (default: false)

Returns

  • OptionDefinition{T}: Option definition with concrete default value

Throws

  • CTModels.Exceptions.IncorrectArgument: If default is not compatible with type

Example

julia> using CTSolvers.Options

julia> def = _construct_option_definition(
           :max_iter,
           Int,
           100,
           "Maximum number of iterations",
           (:max,)
       )
OptionDefinition{Int}(...)

julia> default(def)
100

See also: OptionDefinition, Exceptions.IncorrectArgument