Project

EarthSciAST

The EarthSciML Abstract Syntax Tree format: schema, operators, coupling, and five language bindings.

Contents

This is the documentation for the older version v0.16.0. For the latest release, see v0.17.0.

assertion_result

Stable type · Simulation

Tier: stable · Kind: type · Topic: Simulation

JuliaTypeScriptPythonRustGo
AssertionResultoutside profilenot exportedAssertionResultoutside profile

Julia

struct AssertionResult
AssertionResult(file::String, container_kind::Symbol, container_name::String, test_id::String, assertion_idx::Int64, variable::String, time::Float64, expected::Float64, actual::Union{Nothing, Float64}, status::AssertionStatus, message::String, duration_s::Float64, reduce::Union{Nothing, String}, rtol::Float64, atol::Float64, code::Union{Nothing, String})
AssertionResult(file, container_kind, container_name, test_id, assertion_idx, variable, time, expected, actual, status, message, duration_s, reduce, rtol, atol, code)
AssertionResult(file, container_kind::Symbol, container_name, test_id, assertion_idx::Integer, variable, time::Real, expected::Real, actual, status::AssertionStatus, message, duration_s::Real)
AssertionResult(file, container_kind::Symbol, container_name, test_id, assertion_idx::Integer, variable, time::Real, expected::Real, actual, status::AssertionStatus, message, duration_s::Real, reduce, rtol::Real, atol::Real)
AssertionResult

Outcome of one (file, container, test, assertion_idx) evaluation, as run_inline_tests and run_esm_tests report it.

message carries the diff or error text for non-PASS results; code is the diagnostic code of the error behind an ERROR result (the error’s own code field, see error_code ), nothing when it carried none or for any other status. duration_s is this assertion’s even share of its test’s wall time (solve + all samples), so summing duration_s over a test’s assertions recovers the test’s duration (the JUnit testcase time).

§6.6.5 fields: reduce is the assertion’s declared field reduction (nothing for a plain scalar assertion); rtol/atol are the RESOLVED §6.6.4 tolerances the pass predicate used (0.0/0.0 on results synthesized before tolerance resolution, e.g. a parse/compile failure). The trailing four fields have defaults, so a 12-argument positional construction that omits them is accepted, as is a 15-argument one that omits code.

Virtual properties: r.passed (status == PASS) and r.model (alias of container_name).

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

Rust

pub struct AssertionResult {
    pub model: String,
    pub test_id: String,
    pub assertion_idx: usize,
    pub variable: String,
    pub time: f64,
    pub reduce: Option<String>,
    pub expected: f64,
    pub actual: Option<f64>,
    pub rtol: f64,
    pub atol: f64,
    pub passed: bool,
    pub message: String,
    pub file: String,
}

Outcome of one §6.6.5 inline-test assertion evaluated through the simulation pathway. actual is the computed reduction value (None when the simulation or reduction itself failed); message carries the diff or error text for non-passing results. Field-for-field identical to the Julia AssertionResult / Python AssertionResult, and Serialize-able so conformance runners can record it directly.

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.