Version: dev

simulate_error

Stable error · Simulation

Tier: stable · Kind: error · Topic: Simulation

JuliaTypeScriptPythonRustGo
SimulateErroroutside profilenot exportedSimulateErroroutside profile

Julia

struct SimulateError <: EarthSciASTError
SimulateError(msg::String, code::String)
SimulateError(msg, code)
SimulateError(msg::AbstractString)
SimulateError(msg::AbstractString)
SimulateError(msg::String, code::String)

Exception thrown when a simulation Problem cannot be built or run (API_SPEC §5.8): esm_problem given a missing file or an unsupported input, an override in p / u0 that names no variable or collides with another, a document with no models, a provider or compiler that cannot serve the request, an observed_field read of a name that is not an evaluable observed, or solve called without the solver extension loaded.

msg is the human-readable description. code is the ERROR_CODES value when the failure has one, such as "compiler_unknown" or "compiler_unavailable" for a compiler = selection that cannot be honoured, and "" otherwise. showerror prints SimulateError: <code>: <msg>, omitting the code when it is empty.

Source

TypeScript

Not available in TypeScript. TypeScript is outside the simulation capability profile (Julia, Python, Rust): build an RHS and integrate it; TypeScript and Go are deliberately non-simulating.

Python

Python does not export this error.

Rust

pub enum SimulateError {
    Compile(CompileError),
    DiffsolError { details: String },
    ToleranceNotMet,
    NotDynamic { details: String },
    CompilerUnavailable { compiler: &'static str, details: String },
    RangeRestriction { code: &'static str, message: String },
    DataSourceUnbound { parameter: String, data_source: String },
    Cancelled { details: String },
    UnsubstitutableBinding { name: String, class: String },
    InvalidTimeSpan { start: f64, end: f64 },
    InvalidParameter { name: String },
    AmbiguousParameter { name: String, candidates: Vec<String> },
    CollidingParameterKeys { name: String, keys: Vec<String> },
    InvalidInitialCondition { name: String },
    AmbiguousInitialCondition { name: String, candidates: Vec<String> },
    CollidingInitialConditionKeys { name: String, keys: Vec<String> },
    InvalidFieldInitialCondition { name: String, details: String },
    ProviderError { name: String, details: String },
}

impl SimulateError { pub fn is_cancelled(&self) -> bool }

Errors raised building an crate::problem::EsmProblem or running crate::problem::solve .

Source · Rust docs

Go

Not available in Go. Go is outside the simulation capability profile (Julia, Python, Rust): build an RHS and integrate it; TypeScript and Go are deliberately non-simulating.