solver_time_span
Stable type · Other
Tier: stable · Kind: type · Topic: Other
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
SolverTimeSpan | not exported | SolverTimeSpan | SolverTimeSpan | SolverTimeSpan |
Julia
struct SolverTimeSpan
SolverTimeSpan(start::Union{Float64, Int64, String}, stop::Union{Float64, Int64, String})
SolverTimeSpan(start, stop)
SolverTimeSpan(start, stop)
The solver.time_span interval (esm-spec §2.2.7): the period the document is
meant to be simulated over. Each bound is what the author wrote — a number in
the document’s time units (seconds; an Int64 when written as an integer, else
a Float64), or an RFC 3339 UTC timestamp String — so emit writes it back
unchanged. Its value in seconds comes from
resolve_time_span
. The wire key end is spelled stop here, as in
TimeSpan, because end is a Julia keyword.
TypeScript
TypeScript does not export this type.
Python
class SolverTimeSpan
SolverTimeSpan(start: float | int | str, end: float | int | str)
solver.time_span: the interval a document is meant to be simulated over.
Each bound is held EXACTLY as authored (esm-spec §2.2.4 requirement 2): a
number in the document’s time units (seconds of the independent variable),
or an RFC 3339 UTC timestamp string (...Z), which means seconds from the
document’s time origin. resolve_time_span
converts both to binary64 seconds (§2.2.7); the converted value is never
written back into the document.
Rust
pub struct SolverTimeSpan {
pub start: TimePoint,
pub end: TimePoint,
}
solver.time_span (esm-spec §2.2.7): the {start, end} shape of
tests[].time_span (TimeSpan
), except that each bound may also be an
RFC 3339 UTC timestamp, so it is a separate type rather than f64 bounds.
Go
type SolverTimeSpan struct {
Start TimePoint `json:"start"`
End TimePoint `json:"end"`
}
SolverTimeSpan is the interval the document’s author means it to be simulated over (esm-spec §2.2.7). It is a distinct type from TimeSpan (the tests[].time_span pair of float bounds) because a bound here may also be an RFC 3339 UTC timestamp. Both bounds are held exactly as authored and emitted verbatim; their value in seconds comes from ResolveTimeSpan and is never written back.