pub enum SimulateError {
Show 18 variants
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,
},
}Expand description
Errors raised building an crate::problem::EsmProblem or running
crate::problem::solve.
Variants§
Compile(CompileError)
Wraps a CompileError raised by crate::problem::esm_problem
before solving even starts.
DiffsolError
diffsol returned a solver-internal error (build failure, step failure, etc.).
ToleranceNotMet
The integrator could not satisfy the requested tolerances.
NotDynamic
crate::problem::solve was called on a EsmProblem whose document
declares no differential equations, so there is nothing to integrate.
Its build-time products are still readable with
crate::problem::observed_field.
crate::problem::ProblemOptions::compiler named a value that is in
API_SPEC §5.8’s closed vocabulary but that this binding, this build or
this process cannot provide (esm-spec §9.6.6 compiler_unavailable).
Never answered by building with a different compiler: the whole point
of naming one is that the caller knows which ran. details names what
would have to be loaded or built.
RangeRestriction
A range-restricted or operator-restricted right-hand side (API_SPEC
§5.8: select, halo, tile, lanes) was refused. code is one of
range_halo_insufficient, range_global_locality,
range_selection_writes_incomplete or range_box_invalid, and
message names the rule, variable and axis involved.
Fields
DataSourceUnbound
A DATA-FED parameter — one whose update is kind: "data" (esm-spec
§5.4, §8.5) — reached a build with NOTHING bound to it: no provider,
no loaded array, and no caller-supplied p value (esm-spec §9.6.6
data_source_unbound, CONFORMANCE_SPEC §5.46).
Raised at CONSTRUCTION, before any right-hand side is built, so the
answer does not depend on the compiler: this asks whether the
DOCUMENT’s inputs are bound, not what a compiler can lower. A compiler
that additionally cannot lower a read of the forcing channel reports
that separately as CompileError::CompilerRefusedRule.
Refused rather than evaluated at the parameter’s default, which is
not a fallback value but a placeholder: a forcing at its default
integrates to a complete, smooth trajectory reported under the label of
a quantity the document says is read from a file.
Fields
Cancelled
A build progress observer asked crate::problem::esm_problem to
stop (returned Flow::Cancel).
Distinct from every other variant in that nothing went wrong: it is the
caller’s own decision. It stays an ERROR — unlike a cancelled solve,
which is ReturnCode::Terminated with a partial trajectory — because a
half-built EsmProblem is not a usable result.
UnsubstitutableBinding
crate::problem::remake was asked to substitute a binding the
EsmProblem cannot honour without redoing part of construction.
Raised rather than silently rebuilding or silently ignoring the
substitution (esm-libraries-spec.md §2.5.5): the name and the class
that makes it un-substitutable are both reported so the caller knows to
build a fresh EsmProblem instead.
Fields
InvalidTimeSpan
The caller supplied a time span whose start or end is not a finite
number — NaN, +∞ or −∞.
A document cannot spell one: the schema’s TimeSpan bounds are JSON
numbers, and esm-spec §6.6.4 records that “JSON has no infinite
literal”. So this is a caller-supplied argument of a solve,
validated alongside the parameter and initial-condition maps of the same
call.
Refused rather than interpreted. Every ordering test against NaN is
false, so a NaN endpoint reads as a run that cannot advance and would
hand back the initial state as though it were a trajectory; an infinite
end gives the solver loop a stop time it can never reach.
InvalidParameter
The user supplied a parameter name that does not appear in the flattened system.
AmbiguousParameter
The user supplied a key that two or more of the flattened system’s
parameters carry as a DOTTED SUFFIX — a shared local name (gain for
Left.gain and Right.gain) or a shared partial qualification
(sub.g for Left.sub.g and Right.sub.g), esm-spec §6.6.2 rule 4.
Distinct from SimulateError::InvalidParameter: the name exists, it
just does not identify ONE parameter, and binding it to either
candidate would be a wrong answer rather than a missing one.
Fields
CollidingParameterKeys
Two or more NON-EXACT parameter_overrides keys designate the one
flattened parameter (esm-spec §6.6.2): a bare local spelling and a
more-qualified one (solo and Doc.Left.solo both landing on
Left.solo), or two more-qualified ones (A.M.g and B.M.g both
landing on M.g). The caller wrote two overrides and only one can take
effect, so picking a winner would be a wrong answer rather than a
missing one. An EXACT key is never part of a collision — it identifies
its parameter outright and wins over any suffix or bare claim on it.
Fields
InvalidInitialCondition
The user supplied an initial condition for a name that is not a state
variable, or a state variable has no initial value (no entry in
initial_conditions and no default on the ModelVariable).
AmbiguousInitialCondition
The user supplied a key that two or more of the flattened system’s
states carry as a DOTTED SUFFIX (esm-spec §6.6.2 rule 4). The
state-side counterpart of SimulateError::AmbiguousParameter.
Fields
CollidingInitialConditionKeys
Two or more NON-EXACT initial_conditions keys designate the one state
element (esm-spec §6.6.2). The state-side counterpart of
SimulateError::CollidingParameterKeys.
Fields
InvalidFieldInitialCondition
An ic(target) field initial condition could not be resolved to a
per-cell value. Carries the ic(...) target state name plus a
diagnostic saying why (wrong field rank, unresolvable RHS, …), so
the name field stays a plain identifier.
Fields
ProviderError
A data provider bound in crate::problem::ProblemOptions failed to
materialize its loader field, or produced the wrong number of fields for
its target forcing variable.
Implementations§
Source§impl SimulateError
impl SimulateError
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether this is a build progress observer’s own Flow::Cancel rather
than something going wrong — the counterpart of reading
ReturnCode::Terminated off a Solution.
Trait Implementations§
Source§impl Debug for SimulateError
impl Debug for SimulateError
Source§impl Display for SimulateError
impl Display for SimulateError
Source§impl Error for SimulateError
impl Error for SimulateError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<CompileError> for SimulateError
impl From<CompileError> for SimulateError
Source§fn from(source: CompileError) -> Self
fn from(source: CompileError) -> Self
Auto Trait Implementations§
impl Freeze for SimulateError
impl RefUnwindSafe for SimulateError
impl Send for SimulateError
impl Sync for SimulateError
impl Unpin for SimulateError
impl UnsafeUnpin for SimulateError
impl UnwindSafe for SimulateError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.