Expand description
§earthsci-ast - Rust Implementation
This crate provides Rust types and utilities for the EarthSciML Abstract Syntax Tree Format (ESM).
§Features
- Core: Parse, serialize, Markdown and Typst source text, substitute, validate schema
- Analysis: Unit checking, equation counting, structural validation
- CLI Tool: Command-line interface for validation and conversion
- WASM: WebAssembly compilation for web use
§Example
use earthsci_ast::{EsmFile, load_string, to_json};
// Load an ESM file
let esm_data = r#"
{
"esm": "2.0.0",
"metadata": {
"name": "test_model"
},
"models": {
"simple": {
"variables": {},
"equations": []
}
}
}
"#;
let esm_file: EsmFile = load_string(esm_data)?;
// Save back to JSON
let json = to_json(&esm_file)?;Re-exports§
pub use performance::CompactExpr;pub use performance::PerformanceError;
Modules§
- extension
- The tier-2 extension seam
- intern
- Load-scoped structural interning (hash-consing) of
ExpressionNodes. - performance
- Experimental performance utilities (benchmark support).
- precision
- The evaluator’s working precision —
domain.element_type(esm-spec §11.3). Public because the contract it implements ("Float32"means per-operation binary32 rounding) is observable, and a host embedding the evaluator needs to be able to name it. Working precision of the evaluator —domain.element_type(esm-spec §11.3). - precision_
infer - Static precision inference: propagate
ModelVariable.element_typeover an expression tree and mark the boundaries (esm-spec §11.3.1). - provider
- Data-provider consumption + cadence wiring — the refresh executor (bead
ess-14f.9 / RS-R1, plan
esio-consumer-rust-plan; parent ess-14f). - simulate_
array - Native array runtime for
faq,makearray,index,reshape,transpose,concat, andbroadcastexpression nodes (gt-oxr).
Structs§
- Affect
Equation - Equation that modifies state/parameters when event fires
- Assertion
Result - Outcome of one §6.6.5 inline-test assertion evaluated through the
simulation pathway.
actualis the computed reduction value (Nonewhen the simulation or reduction itself failed);messagecarries the diff or error text for non-passing results. Field-for-field identical to the JuliaAssertionResult/ PythonAssertionResult, andSerialize-able so conformance runners can record it directly. - AxisCut
- One decomposed horizontal index set: its name and its period, when the axis is periodic.
- Callback
Set - The callbacks declared on a
EsmProblem. - Class
Summary - Annotated-node counts by derived class — the golden
class_summary. - Classification
- One model’s complete §6.3.1 classification, computed once. Every name list is sorted.
- Compiler
Report - What built a Problem’s right-hand side, per rule (API_SPEC §5.8).
- Compiler
Rule Report - Where ONE rule of a Problem landed, and at what cadence (API_SPEC §5.8, “Every Problem reports what ran”).
- Component
Graph - Component graph representing model structure
- Component
Metadata - Summary counts a component node carries (esm-libraries-spec §4.8.1).
- Component
Node - Node in the component graph
- Construct
Source - One construct of a document’s source text: where its content is in the document the text reads as, and where the text writes it.
- Continuous
Event - Continuous event that fires on zero-crossings
- Contribution
- One summand of a flattened equation’s right-hand side, with its authors (esm-libraries-spec §4.7.5, “Per-term provenance”).
- Coord
Plan - A CF dimension coordinate (§8.3): a 1-D coordinate variable named
exactly like its dimension, its values, and its CF attributes. Field-for-
field the shape of
earthsciio::format::WriteCoord. - Coordinate
- One entry of the document-scoped
EsmFile::coordinatesregistry (RFC streaming-output-sinks §8.3): marks an existing data array — or an inline literal vector — as a physical coordinate and attaches CF metadata. - Coupling
Edge - Edge in the component graph
- Coupling
Import Options - Options controlling how
coupling_importrefs are resolved at flatten. - Coupling
Role - A coupling-library formal component role (esm-spec §10.9). Present only in
a coupling-library file’s top-level
coupling_rolesmap; each entry carries an optional human-readable description. Roles are formal parameters (names, not types), bound to actual components at acoupling_import. - DaeError
- Error returned by
apply_dae_contract/discretizewhen the RFC §12 DAE binding contract cannot be satisfied. - DaeInfo
- Summary of DAE classification stamped onto
metadata.dae_infobydiscretize()per RFC §12. - Data
Source - Generic, runtime-agnostic description of an external data source (esm-spec §8).
- Data
Source Binding - Binds a parameter to ONE variable of a
data_sourcesentry (esm-spec §8.5). The 0.xDataLoaderVariableminusunits: the units are the parameter’s own, declared once on the parameter instead of twice. - Data
Source Determinism - Reproducibility contract a loader advertises to bindings (esm-spec §8.9.2).
- Data
Source Location - File discovery configuration. Describes how to locate data files at runtime via URL templates with date/variable substitutions.
- Data
Source Metadata - Free-form metadata about a data loader.
- Data
Source Temporal - Temporal coverage and record layout for a data source.
- Decomposition
- The horizontal decomposition a tile cuts (RFC U3 §1): the decomposed index
sets and the face sets that stagger off them,
(face set, cell set). Every other index set is whole on every tile. - Dependency
Edge - Edge representing dependencies between variables in an expression graph
- Dimension
Promotion Record - Record of a dimension promotion applied during flattening.
- Discrete
Event - Discrete event that can modify the system
- Discretize
Options - Options for
discretize. The §11 pipeline options (max passes, strict unrewritten) will be added when that pipeline lands; today only the DAE knob exists. - Discretized
From - Provenance stamp written to
metadata.discretized_frombydiscretize()per RFC §12: identifies the source document the discretized one came from. - Domain
- Spatial/temporal domain specification
- Ensemble
Problem - A EsmProblem plus a per-trajectory rewrite, and the family it stands for (§2.5.8) — the canonical form for parameter sweeps, Monte Carlo over declared distributions, and perturbed initial conditions.
- Equation
- Differential equation
- EsmFile
- Top-level ESM file structure
- EsmProblem
- A simulation problem: a document, an interval, and the bindings that fix the document rather than the run.
- Exact
Scale - The EXACT scale of a unit relative to SI (esm-spec §4.8.1 “Scales are EXACT”).
- Expression
Graph - Expression graph representing variable dependencies within expressions
- Expression
Graph Options - Settings for
expression_graph_with_options. - Expression
Node - Expression node representing an operator with operands.
- Flatten
Metadata - Provenance metadata for a flattening pipeline run.
- Flattened
System - Spec-compliant flattened coupled system (§4.7.5).
- Float
KeyError - Raised when a relational key contains a floating-point (or otherwise
non-integer / out-of-domain) component, violating
CONFORMANCE_SPEC.md§5.5.1 rule 1 (“floats are forbidden in keys”). Normalise the value to an integer / categorical ID before the build-time pre-pass. - Forcing
Set - The forcing a program evaluation reads (API_SPEC §5.8): one immutable
buffer per
RhsProgram::forcing_slotsentry, stamped with a process-unique epoch. Refresh is a swap:Self::replacemakes a new set (a new epoch) sharing every other buffer, and a call on the new set re-runs what reads forcing. Cheap to clone;Send + Sync. - Forcing
Slot - One buffer of a
ForcingSet: the variable it serves, its shape, and its kind. The buffer holdsshape’s element count (one for a 0-d slot), column-major, first index fastest. - Functional
Update - A registered handler computing a parameter’s new value when its update
fires (esm-spec §5.5). The 0.x event
functional_affect, relocated onto the parameter it writes — which is why it needs nomodified_paramslist: it writes exactly one thing, the parameter carrying it. - Grid
Plan - One grid: a set of variables sharing a spatial-dim signature, with the coordinates and dimension lengths that describe it (RFC §9). The RFC’s recommended decomposition is one Sink — one store or group — per grid.
- Halo
Report RhsProgram::halo’s report (RFC U3 §3): for each state the program reads and each decomposed or face index set on its shape, keyed(variable, index set), how far the owned output reaches into it:locells below the owned box,hiabove it.- Inline
Test Options - Per-document overrides for
run_inline_tests_paths, returned by itsoptions_forcallback. - Integrator
- A stepping integrator (§2.5.6) — the same lifecycle
solveperforms internally, exposed for callers that need to interleave their own work with the integration: the coupling driver in a host model, an interactive session, a progress UI. - Kernel
- A compiled kernel (API_SPEC §5.8).
Send + Sync; a clone shares it. - Kernel
Block - One output’s block of a kernel’s
out(0-basedoffset). - Kernel
Set - The kernels of one
compile_kernelscall, sharing oneu/zlayout, one parameter vector and one forcing signature. - Kernel
Spec - A kernel spec: a name, the parameters that read
dt, and the outputs. - Kernel
Workspace - A kernel’s buffers, one per concurrent caller.
Send, notSync. - Lane
Block - One variable’s block in a lane program’s inputs (API_SPEC §5.8, “Lanes”):
its index sets outside the lane sets, their extents, and its offset in
units of lanes. Element
e(1-based, column-major oversets) of lanelis at slot(offset + e - 1)·L + l(l0-based in Rust). - Lane
Inputs - The per-lane buffers of a lane program’s pre-gather plan: one run of
capacityvalues per hoisted read. Filled byLaneProgram::gather_lane_inputs, read byLaneProgram::eval_gathered_into, which reads the forcing set they were gathered from.Send, like a workspace. - Lane
Layout - A lane program’s
uandauxlayout, with the lane sets a column ofcellsindexes and the capacityL. - Lane
Program - A lane program (RFC U3 §6).
Send + Sync + Clone; it reads the forcing sets of the program it was built from. - Load
Options - Options controlling how
load_string_with_options/load_document_with_options/load_path_with_optionsparse an ESM file (esm-spec §9.7). - Loader
Field - One provider-served loaded field the flattened system consumes
(esm-spec §8.5; esm-libraries-spec §4.7.5 step 4
loader_fields). - Materialization
Point - A materialization point: where the frontier cut fires (§5.7.4). Either an
expr_edgecadence drop inside a hot/per-event RHS, or anoutput_buffer— a top-level CONST equation whose entire output folds into the artifact. - Math
Error - Why
parse_mathrefused a text, and where in it. - Metadata
- Metadata section
- Migration
Error - Migration error that occurs when migration fails.
- Model
- ODE-based model component
- Model
Analysis - Inline illustrative analysis of how to run the enclosing component
(schema
Analysis): run configuration plus plots derived from the result. Carried byModel::analysesandReactionSystem::analyses, the same wayModelTestserves both components’tests. - Model
Test - Inline validation test for a
Model. - Model
Test Assertion - A single scalar
(variable, time, expected)check inside aModelTest, or one of its §6.6.5 PDE-aware variants:coordspoint-samples an array state at physical coordinates,reducecollapses the variable’s spatial field to a scalar (L2_error/Linf_erroragainstreference, or the pure collapsersintegral/mean/max/min).coordsandreduceare mutually exclusive per the schema. - Model
Variable - Variable within a model
- Operator
- Runtime operator reference
- Output
Meta - The document slice a streaming writer needs so it can name axes and emit CF
coordinates (RFC §7–§8) without importing the document model. Distilled from
an
EsmFilebyderive_output_meta; the Rust mirror of Julia’sOutputMeta. - Output
Plan - The full derived output plan: every grid the run produces.
- Param
Slot - One positional parameter of a program:
p[k]isRhsProgram::parameters[k]. - Parameter
Sweep - A parameter-sweep specification on a
ModelAnalysis(schemaParameterSweep). Only Cartesian-product sweeps exist: the run count is the product of the dimensions’ lengths. - Partition
- The partition of one model: the class summary, the materialization-point set,
and the hot-tree / per-event-handler emptiness (§5.7.5 three execution
outputs). Guards (§5.7.6) are checked during
partition_model; a violation is anErr. - Plot
- A plot specification of a
ModelAnalysis(schemaPlot). Structural information only — axes, series selection, value reductions; styling is the viewer’s concern. - Plot
Axis - Axis specification of an analysis
Plot(schemaPlotAxis). - Plot
Series - A single named series of a multi-series line/scatter
Plot(schemaPlotSeries). - Plot
Value - A scalar value derived from a trajectory, used for heatmap / color
channels (schema
PlotValue). Exactly one ofat_time/reduceshould be given. - Prepare
Error - A build-time preparation failure.
- Prepare
Progress - How far along an in-flight build is, handed to
crate::problem::ProblemOptions::progressat every phase boundary AND at every unit of work inside the two phases that dominate a large build. - Problem
Options - Build-time bindings for
esm_problem— everything that fixes a document rather than a run. - Progress
- How far along an in-flight integration is, handed to
SolveOptions::progressonce per accepted step. - Provider
Gate - A provider-key ⇒ engine gate: per-NATIVE-axis selection plus the LOADER variable tails the gate applies to.
- Pushdown
Rewrite Error - A malformed gate/record encountered while deriving provider gates (mirrors
the Julia
RefreshErrorsites in pushdown_rewrite.jl and the PythonPushdownRewriteError). - Rational
- A dimension exponent.
- Reaction
- Chemical reaction
- Reaction
System - Reaction network component
- Reference
Edge - A directed
source → targetedge: source references / depends on target. - Reference
Graph - The resolved reference DAG for one model — the partition pass’s input.
- Reference
Vertex - A vertex in the reference graph, addressed by a kind-namespaced
key. - Remake
- The substitutions
remakeapplies. Every field is optional; an omitted field is inherited unchanged. - RhsProgram
- A compiled right-hand side, possibly restricted to one operator’s terms
and writes (API_SPEC §5.8). Made by
rhs_program. - RhsSelection
- Which terms and which variables an operator keeps (API_SPEC §5.8,
select).Nonekeeps every term, or writes every state. - RhsWorkspace
- The per-call buffers of one program (API_SPEC §5.8): reused across calls,
so a warm call allocates nothing. Made by the program that runs it, and
usable only with that program (or a clone of it), one call at a time. It
may move between threads (
Send); it is notSync. - Schema
Error - A schema validation error
- Scoped
Context - Context for hierarchical scoped reference resolution
- Solution
- A simulation result.
- Solution
Metadata - Provenance metadata for a
Solution. - Solve
Options - Per-run knobs for
crate::problem::solve. - Solver
- Document-scoped, OPTIONAL solver hints (esm-spec §2.2).
- Solver
Time Span solver.time_span(esm-spec §2.2.7): the{start, end}shape oftests[].time_span(TimeSpan), except that each bound may also be an RFC 3339 UTC timestamp, so it is a separate type rather thanf64bounds.- Species
- Chemical species in a reaction system. Keyed by name in the parent map.
- State
Block - One state variable’s block of
u(API_SPEC §5.8):shapecolumn-major fromflat_offset, first index fastest. - Stoichiometric
Entry - Species with stoichiometric coefficient.
- Strip
Set - The construct classes
esm_problemstrips (API_SPEC §5.8). Combine with|; the empty set is the default and changes nothing. - Stripped
Constructs - What
stripremoved (API_SPEC §5.8, “The stripped object”). Empty when nothing was requested or nothing was found. - Stripped
Event - One removed event, flattened and namespaced.
- Stripped
Residual - One stripped implicit equation, as the residual
lhs - rhs. - Stripped
Update - One stripped parameter and its update rules.
- Structural
Error - A structural validation error
- Sweep
Dimension - One axis of a
ParameterSweep(schemaSweepDimension): exactly one ofvalues/rangeis present. - Sweep
Range - Generated range of values for one
SweepDimension(schemaSweepRange). - Tile
Block - One variable’s block in a tile’s (or a whole-domain program’s) inputs (API_SPEC §5.8, “Tile layout”): a column-major block over its storage box, first index fastest.
- TileBox
- One tile’s owned box and storage box, one inclusive range per decomposed
index set, in global 1-based indices; a periodic storage range is
unwrapped (it may run below 1 or past
N). - Tile
Layout - A program’s
uandauxlayout (API_SPEC §5.8): the written variables’ blocks, then the read-only ones, each list in flat-layout order. - Tile
Program - One tile of a
RhsProgram(RFC U3 §4): it readsuandauxover their storage boxes and writes only the owned rows ofdu. - Time
Span - Simulation time interval used by inline model tests.
- Tolerance
- Numerical comparison tolerance used by inline model tests.
- Unit
- Represents a physical unit with dimensions
- Unit
Finding - A single dimensional finding produced while propagating an expression.
- Unit
Parse Failure - A declared unit string that denotes no real unit.
- Unit
Warning - A dimensional-analysis finding surfaced by validation.
- Update
Value - The value form of an update rule: exactly one of
expression,from, orhandler(esm-spec §5.4, “What: exactly one value form”). Modelled as three options rather than an enum so the flattened round trip stays verbatim; the “exactly one” constraint is a schema-layer check. - Validation
Result - Result of structural validation
- Value
Invention Error - A value-invention build-time materialisation error (the Rust analog of
Julia’s
TreeWalkErrorvalue-invention codes). - Value
Invention Result - Result of
materialize_value_invention. - VarGridding
- The gridded layout of one output base-variable, derived from the flat state-element names (RFC §7).
- VarPlan
- One output variable: what a writer declares, plus the inversion that fills
it. Field-for-field the shape of
earthsciio::format::WriteVaronceSelf::griddinghas scattered the trajectory intodata. - Variable
Node - Node representing a variable in an expression graph
- ZBlock
- One block of the
zlayout.
Enums§
- Alg
- Which solver family to use inside diffsol.
- Auto
Records - Carrier for the
"auto"literal inRecordsPerFile. - AxisSel
- One axis of the NEUTRAL per-axis selection handed to a gated provider —
the Rust spelling of the Python engine’s
"all" | [0-based indices]form. - Boundary
Kind - Per-dimension boundary policy for an out-of-range const-array stencil gather
Mirrors the Julia
_CONST_BOUNDARY_KINDS(:periodic/:clamp/:error): a gather at a 1-based index outside1..=nresolves declaratively per the dimension’s policy instead of panicking. - Cadence
- The cadence lattice (
CONFORMANCE_SPEC.md§5.7.1):const ⊏ discrete ⊏ continuous. The derivedOrdis the lattice order (variants declared low-to-high), soclass(node) = maxover inputs is justIterator::max. - Canonicalize
Error - Errors raised during canonicalization (per RFC §5.4.6 / §5.4.7).
- Compile
Error - Errors raised when building a compiled model from a flattened system.
- Compiler
- Which strategy builds a Problem’s right-hand side (API_SPEC §5.8, esm-libraries-spec §2.5.10).
- Component
Type - Type of component in the graph.
- Coupling
Entry - Coupling entry with discriminated union based on type field
- Data
Source Kind - Structural kind of a data loader dataset.
- Dependency
Relationship - PROVENANCE of a dependency — which structural site produced it, NOT a
classification of the operators involved. An equation edge is always
Additive(even forw ~ u * v) and a definition edge alwaysMultiplicative(even forw ~ u + v). - Derive
Error - Error type for ODE derivation operations
- Dimension
- Base physical dimensions — the eight canonical axes shared across the
bindings (
m kg s mol K A cd rad). - Discrete
Event Trigger - Trigger condition for discrete events
- Distribution
- A parameter’s value drawn from a probability distribution rather than fixed
(esm-spec §6.3, schema
Distribution). The closed set isnormal,lognormal,uniform— bindings implement exactly these and reject anything else. - Distribution
Param - A distribution’s location/scale parameter: a number for a scalar parameter, an array for a vector-valued one.
- Document
Format - Which source format a document is written in.
- Edge
Kind - The three kinds of reference edge (RFC §6.1 “Propagation”).
- Edit
Error - Errors that can occur during editing operations
- Equation
Dimension Verdict - The dimensional analyser’s verdict on one equation, in the form a report prints: checked and consistent, provably inconsistent, or not checked.
- EsmError
- Main error type for the ESM format library
- Event
Kind "continuous"or"discrete".- Expr
- Mathematical expression: a number literal, variable reference, or operator node.
- Flatten
Error - Errors raised by
flattenandflatten_modelduring spec-compliant coupled-system flattening. - Flow
- What a
SolveOptions::progressobserver wants the integrator to do next. - Gate
Axis - One native axis of a loader selection — the vocabulary shared by a data
loader’s declared
select.axes(esm-spec §8.9) and by the pushdown record’s gate template. JSON spellings, in the same order as the variants: - Inline
Value - A
default/ override VALUE: either a scalar, or inline row-major nested array data (esm-spec §6.3, §6.6.2 — theNumericArrayLiteralof the schema). - Kernel
Output - One output of a kernel spec (API_SPEC §5.8, “Kernel specs”).
- Key
- A relational key component: an integer / categorical ID, or a tuple thereof. This is the orderable, float-free domain over which the five primitives operate.
- Lane
Kind - The locality a lane program evaluates over (RFC U3 §6), with the index
sets one lane’s
cellscolumn names, in order. - LhsForm
- What an equation’s LHS says about the unknown it names (esm-spec §6.3.1).
- Num
- A numeric value for
group_aggregate. UnlikeKey, values may be floating-point (only keys are float-forbidden, rule 1). Integer aggregates stay integer (so a sum serialises as5, not5.0); a float anywhere in a bucket promotes the reduction tof64. - Output
Error - Failure deriving an
OutputPlan— the output-side mirror of the loader seam’s errors. Every variant names the offending variable or dimension: a mislabeled axis is silently wrong science, so these fail loudly. - Parameter
Update - One update rule: WHEN a parameter refreshes, and WHAT from
(esm-spec §5.4). Every kind except
wienercarries exactly one value form —expression,from, orhandler— held in the flattenedUpdateValue;wienercarries none, because the parameter’sdistributionIS its value. - Parameter
Update Spec - A parameter’s update behaviour (esm-spec §5.4, schema
ParameterUpdateSpec): EITHER a single rule, OR an ordered array of two or more applied in declaration order. - PlotY
- A
Plot’syfield (schemaPlot.yoneOf): a single axis, or an array of axes for inline multi-series line/scatter plots. Untagged: an object is the single-axis form, an array the multi-series form — the two JSON shapes never collide. - Prepare
Phase - Which stage of the build
crate::problem::esm_problemis in when it reports. - Problem
Input - What
esm_problemcan be built from: a path on disk, a raw JSON document, a typed document, or an already-flattened system. - Records
PerFile - Number of records per file — an integer, or the literal
"auto". - Reference
Resolution Error - A reference could not be resolved, or the reference graph has a cycle.
- Region
Bound - One bound of a
makearrayregion box (esm-spec §4.3.2). - Return
Code - Why a solve stopped — the SciML
ReturnCodevocabulary (esm-libraries-spec.md§2.5.3). - Rhs
- Whether
esm_problemcompiles a right-hand side. - RhsError
- Why a program evaluation (
eval_into) failed. - Scale
Factor - One factor of an
ExactScale: a prime number, or π. - Semiring
Op - An associative + commutative semiring combiner for
group_aggregate(rule 5). Every registry⊕is one of these, so input and bucket order can never change the result. - Simulate
Error - Errors raised building an
crate::problem::EsmProblemor runningcrate::problem::solve. - Slot
Kind - What a forcing slot carries.
- Step
Status - Whether an
Integratorhas more to do. - Structural
Error Code - Error codes for structural validation
- System
Kind - The derived system kind (esm-spec §6.3.1).
- Term
Origin - Who authored one
Contributionto a flattened equation (esm-libraries-spec §4.7.5, “Per-term provenance”). - Time
Point - One bound of a
SolverTimeSpan, kept in its authored form. - Unit
Conversion - Multiplicative factor (number) or Expression AST used to convert source- file values to the declared units.
- Unit
Error - Error types for unit operations
- Unit
Severity - Severity of a dimensional finding — the cross-binding policy that decides whether a finding blocks validation.
- Variable
Bound - One bound of a model variable (esm-spec §6.3.2): the
lborubfield. - Variable
Kind - Type/kind of variable, as the graph renders it.
- Variable
MapTransform - A
variable_mapcouplingtransform(esm-spec §10.4): either one of the NAMED transform strings ("param_to_var","identity","additive","multiplicative","conversion_factor") or an Expression evaluated on the source value(s) in the flattened coupled system’s scope (the regridding form). - Variable
Type - Type of model variable (esm-spec §6.3). There are two declared types
and no third: everything else a solver needs — which unknowns are ODE
states, which parameters are Brownian — is DERIVED by
[
crate::classification], never declared. - Vertex
Kind - The three kinds of vertex in the reference graph.
Constants§
- DEFAULT_
ABSTOL - The canonical default absolute tolerance — Julia’s. Rust’s was
1e-8. SeeDEFAULT_RELTOL. - DEFAULT_
RELTOL - The canonical default relative tolerance.
- ERROR_
CODES - The [
codes] registry in ENUMERABLE form:(constant name, code string)for every diagnostic code this binding emits, in declaration order (grouped by the pass that emits it, as the [codes] module is). - LIBRARY_
VERSION - This crate’s OWN version — NOT the
.esmformat version, which isSCHEMA_VERSION. The two are unrelated numbers. Every binding exposes both, under these two names. - SCHEMA_
VERSION - ESM schema version supported by this implementation. Must track the
version in
esm-schema.json’s$id/ esm-spec.md; theschema_version_matches_bundled_schematest enforces it, andparse::library_version()(major-compat gating) derives from it. - UNIT_
FINDING_ ANALYSIS - See
UNIT_FINDING_DIMENSIONAL_MISMATCH. - UNIT_
FINDING_ DIMENSIONAL_ MISMATCH - The cross-binding
codevalues a dimensional finding can carry, as surfaced oncrate::validate::UnitWarning::code. Mirrors Go’sUnitFinding*constants (pkg/earthsci-ast-go/pkg/esm/units.go) and TypeScript’sUnitWarning['code']union (pkg/earthsci-ast-ts/src/units.ts). - UNIT_
FINDING_ DIMENSIONLESS_ LITERAL - A check site the CURRENT neutral-literal rule passes or skips fails once a nonzero bare numeric literal is read as dimensionless at scale 1 (esm-spec §4.8.6). A WARNING at this stage: validity is decided by the current rule alone.
- UNIT_
FINDING_ UNPARSEABLE - See
UNIT_FINDING_DIMENSIONAL_MISMATCH.
Traits§
- Expression
Graph Input - Trait for types that can build expression graphs
- Graph
- The graph kinds the esm-libraries-spec §4.8.3 text exporters render.
- Prepare
Provider - The CONST data-provider contract the build pipeline consumes: one provider feeds
ONE field (the
providers["<ModelPath>.<param>"]convention shared with the Julia/Python bindings). A gated provider may additionally honour a pushed- down per-axis selection; one that cannot is fetched whole and sliced engine-side (the fallback matches the pushdown result exactly). - Time
Origin Source - What the §2.2.7 clock accessors read a time origin from: a document, or
its
domainalone (esm-spec §2.2.7).
Functions§
- add_
coupling - Add a coupling entry to an ESM file
- add_
equation - Add an equation to a model
- add_
model - Add a new model to an ESM file
- add_
reaction - Add a reaction to a reaction system
- add_
reaction_ system - Add a reaction system to an ESM file
- add_
species - Add a species to a reaction system
- add_
variable - Add a variable to a model
- algebraic_
unknowns - Unknowns constrained only implicitly (
H*H*SO4 ~ Ksp). - apply_
dae_ contract - Run the RFC §12 DAE binding contract on
esmin place and return the classification summary. - apply_
scope_ injections - esm-spec §9.7.10 forms A + B: fold any scope-directed injection — a
subsystem-ref edge’s
injectedimport list (form A) or a coupling entry’s injection map (form B) — into the target components’ ownexpression_template_imports, in place, so the ordinary import resolver + §9.6.3 fixpoint lower the target under the consumer-chosen discretization. Runs BEFOREresolve_template_machinery; form B target diagnostics (template_inject_target_*) surface here. - apply_
value_ invention - The combined front-door applied to a typed model: rewrite the derived index sets to their materialised dense extents and drop the value-invention equations. After this the existing resolver / array compiler handles the model with no value-invention-specific path.
- brownian_
parameters - Parameters whose
update.kindiswiener— the SDE noise sources. - build_
reference_ graph - Resolve the reference edges of one
modelvalue into a graph, against the document-scopedindex_setsregistry. - build_
reference_ graph_ with_ index_ sets Deprecated - Deprecated alias of
build_reference_graph. - build_
unit_ env - Build a
HashMap<String, Unit>environment from model variable metadata, together with a list of warnings for any variables whose declared unit string could not be parsed. - callbacks
- The callbacks declared on
prob(§2.5.4). - can_
migrate - Whether
migratesupports this version pair — i.e. whetherto_versionis amongsupported_migration_targets(from_version). - canonical_
index_ set_ json - Canonical byte form of an index set (
CONFORMANCE_SPEC.md§5.5.3): thedistinctrows, each tuple serialised as a JSON array, in §5.5.1 sorted order, as compact JSON (,/:separators, no spaces, UTF-8, no\uXXXXescaping). Two conforming bindings MUST produce byte-for-byte identical output for the same input multiset. - canonical_
json - Emit the canonical on-wire JSON form of an expression (§5.4.6).
- canonicalize
- Canonicalize an
Exprtree per RFC §5.4. Returns a new tree; input is not mutated. - canonicalize_
document - The document-level canonical step: every units string of a decoded document
(the JSON value
to_jsonwrites andload_documentreads) takes the canonical unit spelling (esm-spec §4.8.2, LeanEsm.Units.canon). - capture_
coupling_ diagnostics - Run
f, collecting the WARNING-level coupling diagnostics it emits instead of printing them, and return them alongside its result. - check_
assertion - The esm-spec §6.6.3 pass predicate —
actual == expected, or both values FINITE and|a − e| ≤ max(atol, rtol·max(|a|, |e|))— the same predicate the Julia / Pythonrun_inline_testsuse (see also CONFORMANCE_SPEC §5.20). This is Juliaisapprox. - check_
dimensional_ consistency - Check dimensional consistency of an equation
- check_
equation_ dimensions - Dimension-check an equation, returning EVERY finding.
- check_
expression_ dimensions - Dimension-check a standalone expression (an observed variable’s defining expression), returning EVERY finding.
- classify
- Derive a node’s cadence class. For a leaf, seed it. For an operator node,
class = maxover child classes — which, for a gatherindex(A, e…), ismax(class(A), class(e…)): the index expressions are classed independently of the array, so a stencil splits (§5.7.3 gather rule). - compile_
array - Two-step entry point for array/spatial files: CONSUME the parsed
EsmFileand compile it into the array runtime’scrate::simulate_array::ArrayCompiled, which the caller then solves withcrate::simulate_array::ArrayCompiled::solve. The one-shotcrate::problem::esm_problemborrowsfileand so keeps it alive for the whole build; for a large expanded discretization the typed file is on the order of the compiled rules themselves, and taking the file by value both lets it die before the solve AND lets the single-model build move the observed bodies into the compiled rules instead of deep-copying them (crate::simulate_array::ArrayCompiled::from_file_owned). - compile_
kernels - Compile
specsagainstprob’s (stripped) build (API_SPEC §5.8). The reserved namerhs, with no outputs, is the stripped right-hand side. - component_
exists - Check if a component exists in the ESM file
- component_
graph - Build a component graph from an ESM file
- compose
- Concatenate two callback sets into a new one.
- compute_
fold - Compute a single CONST-folded buffer and return its canonical byte form.
labelis the buffer name (the default array key whenspec.arrayis absent);specis the golden’s per-buffer fold descriptor (foldkind + optionalarray);inputsis the CONST-fold input block (the document literals — the fixtures are value-free, so the values live in the manifest). - constant_
parameters - Parameters with neither a distribution nor an update — plain constants.
- contains
- Check if an expression contains a specific variable
- convert_
units - Convert between compatible units
- default_
dae_ support - Resolve the effective default for
dae_supportfrom the environment:ESM_DAE_SUPPORT=0(orfalse/no/off) disables DAE support. Anything else (including unset) defaults to enabled. - deprecated_
records_ per_ sample_ sites - The JSON pointers at which the deprecated
records_per_sampleis written infile(esm-spec §8.5.1), sorted by plain byte order:/data_sources/<S>/temporal/records_per_sample,/models/<M>[/subsystems/<S>…]/variables/<v>/update[/<i>]/from/records_per_sampleand/reaction_systems/<R>[/subsystems/<S>…]/parameters/<p>/update[/<i>]/from/records_per_sample(/<i>only for an array-formupdate). Loading a document for which this is non-empty warns once,deprecated_records_per_sample. Runs on every load, so a subsystem is scanned as raw JSON for the key, never decoded. - derive_
odes - Generate ODE model from a reaction system
- derive_
output_ gridding - Invert the flat state-element names into one
VarGriddingper output base-variable (RFC §7), the flat index of a name being its position inslot_names— the shapeSolution::state_variable_namesalready has. - derive_
output_ meta - Distill a run document into
OutputMeta— the Rust mirror of Julia’sderive_output_meta. Reads only the document (no build artifacts), so it composes withderive_output_gridding. - derive_
output_ plan - Derive the whole output plan for a run.
- desugar_
pushdown - Recognise the projection-pushdown pattern in
esm’s named model and, when it matches, return a NEW document (Cow::Owned) with the four constructs desugared in (akind:"derived"index set, adistinct:trueoverlap-gated producer aggregate, amember_factorconst parameter, and an inspectablegated_selectrecord) plus the reduction axis of the matched E / A / conc nodes re-pointed onto the generated derived set. Returns the input UNCHANGED (Cow::Borrowed) when no model is selected, the pattern does not match, or the reduction’s semiring is not the additive(+, 0)monoid (the soundness guard). - discrete_
parameters - Parameters carrying any OTHER update — piecewise-constant between refreshes.
- discretize
- Top-level
discretize()entry point per RFC §11/§12 for the rust binding. - distinct
- Set semantics over
rows: sort by the §5.5.1 total order, then drop adjacent duplicates (rule 2). The returned order is the sorted order — never first-seen / insertion order. A pure function of the input multiset, so duplicate, reversed, and permuted inputs all collapse to the identical output. - ephemeral_
injected_ file - esm-spec §9.7.10 form C: build a throwaway
EsmFilein which componentmodel_namehas the test’simports(raw §9.7.2 entries) appended to its ownexpression_template_imports, so the ordinary import resolver + §9.6.3 fixpoint lower its rewrite-targets under the test-chosen discretization. The persistedfileis never mutated. Whensource_pathisSome, the raw base is re-read from it (relativerefs resolve against its directory); otherwise it is re-serialized from the loadedfile(base_diranchors the injectedrefs). This is what lets one test suite exercise a discretization-agnostic PDE leaf under several schemes with no conflict between tests. Mirrors the Julia reference (inline_tests.jl_ephemeral_injected_file). - equation_
dimension_ verdict - Classify one equation the way
check_equation_dimensionsjudges it, and say WHY when it could not be judged. - error_
code_ names - Every diagnostic code string in
ERROR_CODES, sorted. Handy for cross-binding vocabulary diffs and for asserting in a test that a raise site uses a registered code. Mirrors Julia’serror_code_names(). - esm_
problem - Build a
EsmProblem(§2.5.2). - evaluate
- Evaluate a scalar AST expression against a map of float variable bindings.
- evaluate_
cellwise - Evaluate an array-valued expression (elementwise ops over array-producing
faq/makearraynodes — e.g. a grid-geometry template expanded by a §9.7 import, or a §6.6.5 analyticreference) at each 1-based integer cell ofcells, returning onef64per cell. - expand_
coupling_ imports - Expand every
coupling_importentry infile.couplinginto concrete edges, splicing them in the position of the import entry (esm-spec §10.10.3). Returns the effective coupling array, orNoneif the file has nocouplingblock. Non-import entries pass through untouched; a file with nocoupling_importentries returns a clone offile.couplingverbatim. - expression_
graph - Build an expression graph from various ESM components
- expression_
graph_ with_ options - Build an expression graph with explicit
ExpressionGraphOptions. - expression_
names - The variable names an expression or an equation uses, in order of first
use: its string leaves under
lhs,rhsandargs. These are thenamesto giveprint_mathto show an expression on its own, with its names declared. - field_
reduce - Collapse a spatial field to the scalar a §6.6.5
reduceassertion compares (esm-spec §6.6.5); semantics identical to the Julia / Python references: - flatten
- Flatten a coupled
EsmFileinto a single unifiedFlattenedSystem. - flatten_
model - Flatten a single
Modelas a convenience wrapper aroundflatten. - flatten_
with_ options - Flatten with explicit
CouplingImportOptionscontrolling howcoupling_importrefs resolve (esm-spec §10.10.3). When the file carries nocoupling_importentry this is identical toflatten; otherwise the import entries are expanded into concrete edges — spliced in position — as a §4.7.5 sub-step before the coupling-rule step, and flattening proceeds over the expanded coupling sequence. Thecoupling_importsource entry is not mutated on the caller’sfile; the expansion operates on an internal clone. - forcing_
from_ sample - The buffer of
slotbuilt from one provider sample: the check and the conversioncrate::esm_problemapplies to a sample from a provider inProblemOptions::providers, so a runtime that builds its ownForcingSets from provider samples gets, bit for bit, the bufferRhsProgram::default_forcingholds for the same sample (API_SPEC §5.8, “Forcing sets”). - format_
canonical_ float - Format a finite f64 per RFC §5.4.6.
- free_
parameters - Extract all free parameters from an expression
- free_
variables - Extract all free variables from an expression
- get_
component_ type - Get the type of a component
- get_
supported_ migration_ targets Deprecated - Deprecated alias of
supported_migration_targets. - group_
aggregate - Group-by + semiring aggregate (rule 5). Bucket
rowsby theirKey(hashing only to bucket, viaIndexMap), combine each group’sNumvalues with the semiringop(⊕), and emit(key, aggregate)pairs sorted by the canonical key. - group_
gridding_ by_ grid - Partition output variables into GRIDS by their spatial-dim signature
(RFC §9): variables over the same set of axes form one grid, so an
atmosphere over
[lev, lat, lon]and an ocean over[depth, lat, lon]split by construction. The signature is the SORTED SET of a variable’sdim_names, so axis order does not fragment a grid, and every scalar (empty signature) lands in one shared 0-D grid. Groups come back in first-seen signature order. - has_
coupling_ import - True when
filecarries at least onecoupling_importentry in itscouplingarray. - init
- Build a stepping integrator for
prob(§2.5.6). - initial_
state - The initial state
probintegrates from, one value per state element, aligned withEsmProblem::state_variable_names. - is_
coupling_ library_ doc - True when
rawhas the coupling-library-file FORM (top-levelcoupling_roles, esm-spec §10.9). Presence of that key is the sole positive identifier of the file kind; purity is checked separately at the import edge. - is_
ode_ state - Membership test for
ode_states. - is_
template_ library_ doc - True when
rawhas the template-library-file FORM (top-levelexpression_templates, esm-spec §9.7.1). Purity (no models / reaction systems / loaders / coupling / domain) is checked separately at import edges. - load_
document - Load and parse an ESM document that is ALREADY parsed as a
serde_json::Value— the same document a.esmfile holds, just already decoded. Runs the identical pipelineload_stringruns (subsystem-ref resolution, version gates, schema validation, §9.7 template machinery, typed deserialization). - load_
document_ with_ options load_documentwith explicitLoadOptions(base path for relative refs, loader-API metaparameter bindings; esm-spec §9.7.6).- load_
path - Load an ESM file from a filesystem path.
- load_
path_ with_ options - Load an ESM file from a filesystem path, binding the root document’s open metaparameters at the loader API (esm-spec §9.7.6 binding site 4). The file’s own directory anchors relative subsystem and template-import refs.
- load_
string - Load and parse an ESM file from JSON string
- load_
string_ with_ options - Load and parse an ESM file from a JSON string with explicit
LoadOptions(base path for relative refs, loader-API metaparameter bindings; esm-spec §9.7.6). - lower_
enums - Lower every
enum-op node infileto a{op: "const", value: <int>}node using the document’s top-levelenumsblock, returning a NEW document.fileis left untouched. - lower_
enums_ mut lower_enums, applied in place. The_mutspelling API_SPEC.md §8 item 15 assigns to a mutating variant (Julia spells the same thinglower_enums!).- lower_
enums_ raw - Lower every
enum-op node invalueto a{op: "const", value: <int>}node using the file’s top-levelenumsblock. Mutatesvaluein place. - lower_
reactions_ to_ equations - Lower a reaction network to an ODE equation list.
- materialize_
value_ invention - Run the build-time value-invention engine over a raw model document.
- migrate
- Migrate an ESM file from the version it declares to
target_version. - model_
unit_ env - The unit environment a model’s equations are checked against, as one map:
its own declarations (
build_unit_env) plus every scoped reference its expressions can make, with the precedence of [ComponentUnitEnv]. The parse failures returned are the model’s own. - observed_
definition_ json - An observed unknown’s defining RHS, read from a model held as RAW JSON.
- observed_
definitions - Each observed unknown’s defining RHS, keyed by name.
- observed_
field - The build-time field named
name, fromprob’s construction. - observed_
trajectories observed_trajectoryfor several names, in ONE pass over the output grid.- observed_
trajectory - The trajectory of the observed variable
nameoversol’s output grid. - observed_
unknowns - Unknowns defined by a bare-variable LHS (
y ~ f(…)) — eliminable, materializable. - ode_
states - Unknowns appearing under
D(·, t)on some equation LHS. - parse_
cell_ key - Split a flat state-element name into
(base, 1-based indices), orNonewhen it is not a well-formed cell key (no bracket suffix, an empty base name, or a non-integer index). The exact inverse of the"{name}[{i},{j}]"formatting insimulate_array::compile::build_slot_tables, and the Rust twin of Julia’s_parse_cell_key/ Python’s equivalent. - parse_
document - Read an ESM document written in the given format.
- parse_
document_ with_ sources - Read an ESM document as
parse_documentdoes, with where each of its constructs is: oneConstructSourceper pointer, in the order the text writes them. A construct that reads as several entries (a display holding several equations, a container of initialization equations or constraints, a table of declarations) gives one per entry, all with its span. Prose, front matter and anything else that is not a construct of the format gives none. - parse_
markdown - Read a Markdown ESM document (
Source.Md.parseMd). The result is in canonical form. - parse_
math - Read one expression, or one equation, written as math under a set of
declared names: LaTeX for
DocumentFormat::Markdown(Math.parseLatex), Typst math forDocumentFormat::Typst(Math.parseTypst). The inverse ofprint_math:parse_math(&print_math(e, names, f), names, f)isein canonical form. - parse_
typst - Read a Typst ESM document (
Source.Typ.parseTyp). Seeparse_markdown. - parse_
unit - Parse a unit string into a Unit struct
- partition_
model - Run the cadence-partition pass over one model: classify every annotated node,
derive the materialization frontier (both thresholds), check the guards
(expect-cadence agreement, no
CONTINUOUSrelational, acyclic≤DISCRETEgraph), and report the three execution outputs’ emptiness. The model is the innermodels.<name>object (usemodel_with_loadersto attach the document’sdata_sourcesfirst when the model reads loader-seeded variables). - plan_
dimension_ coordinates - Resolve the
coordinatesregistry (§8.3) into the CF dimension coordinates for a set ofVarGriddings — the Rust mirror of Julia’splan_dimension_coordinates. - print_
document - Print an ESM document in the given format.
- print_
markdown - Print an ESM document as Markdown (
Source.Md.printMd). - print_
math - Print one expression, or one equation, as math under a set of declared
names: LaTeX for
DocumentFormat::Markdown(Math.printLatex), Typst math forDocumentFormat::Typst(Math.printTypst). - print_
typst - Print an ESM document as Typst (
Source.Typ.printTyp). Seeprint_markdown. - pushdown_
coupling_ pairs - The
(external name, model variable)routings of a raw document: which external field feeds which declared array. - pushdown_
provider_ gates - Provider-key ⇒ engine gate, derived from
doc’s rewrite record (metadata.x_esd.pushdown.gated_select). - pushdown_
record - The rewrite’s provenance record
metadata.x_esd.pushdown(written bydesugar_pushdown), orNonewhendoccarries none. This is the record the engine reads BACK to derive provider gates. - reject_
solver_ external_ pre_ v13 - Reject
solver.externalin a file declaring esm < 1.3.0. - reject_
solver_ pre_ v11 - Reject a top-level
solverblock in a file declaring esm < 1.1.0. - reject_
solver_ time_ span_ pre_ v13 - Reject
solver.time_spanin a file declaring esm < 1.3.0. - reject_
template_ imports_ pre_ v08 expression_template_imports, top-levelexpression_templates(template-library files), andmetaparametersarrive atesm: 0.8.0; files declaring an earlier version that carry any of them are rejected withtemplate_import_version_too_old(esm-spec §9.6.5). Mirrors [reject_expression_templates_pre_v04] for the §9.7 constructs.- remake
- A NEW EsmProblem with
changesapplied and everything else shared (§2.5.5). - remove_
coupling - Remove a coupling entry from an ESM file by index
- remove_
equation - Remove an equation from a model by index
- remove_
model - Remove a model from an ESM file
- remove_
reaction - Remove a reaction from a reaction system by index
- remove_
species - Remove a species from a reaction system
- remove_
variable - Remove a variable from a model
- replace_
coupling - Replace a coupling entry in an ESM file
- replace_
equation - Replace an equation in a model
- resolve_
references - Resolve reference edges for every model in
document. - resolve_
subsystem_ refs - Resolve every subsystem
{ "ref": ... }in a TYPED document, in place. - resolve_
subsystem_ refs_ raw - Resolve all subsystem references in a parsed JSON value representing an ESM file.
- resolve_
subsystem_ refs_ with_ metaparameters - Like
resolve_subsystem_refs_raw, but with the loader-API metaparameter bindings (esm-spec §9.7.6 site 4) available, so a §4.7 subsystem-edge binding EXPRESSION (NTGT = NX*NY, §9.7.6 site 3) folds against the root document’s closed metaparameter environment (defaults overlaid with the API bindings) at the mount. Mirrors the Pythonresolve_model_refs(..., parent_metaparameters=root_meta_env). - resolve_
template_ machinery - Resolve every esm-spec §9.7 construct of the ROOT document
raw_data(relative import refs resolve againstbase_path): imports recursively with per-edge instantiation,index_setsmerge, metaparameter close (metaparametersis the loader-API binding site 4; already-closed edge bindings win, then API bindings, then defaults) and fold, expression-position substitution, and — for a root library file — §9.7.3 body-reference validation. - resolve_
time_ span - The run interval, most specific first (esm-spec §2.2.7, by the §2.2.2 order):
- resolve_
tolerance - esm-spec §6.6.4, resolved PER FIELD over FOUR levels: assertion > test >
model > the implementation default. Each of
relandabsindependently takes its value from the innermost level that declares it; the default suppliesrel = 1e-6and noabsbound to whatever is still undeclared after the three document levels. Identical to the Julia_resolve_tolerancereference and the Python_resolve_tolerance. Returns(rtol, atol). - resolve_
tolerances - Resolve integration tolerances most-specific first (esm-spec §2.2.2):
- rhs_
program - The right-hand side
probcompiled, as a programRhsProgram::select,RhsProgram::halo,RhsProgram::tileandRhsProgram::lanesaccept (API_SPEC §5.8). Its names are the flattened (dot-namespaced) names on every route; it writes every state. - run_
inline_ tests - Run every inline test (esm-spec §6.6, including the §6.6.5 PDE
assertions) of the selected model(s) of
filethrough the official simulation pathway (crate::problem::esm_problem/crate::problem::solve, the array runtime), and return oneAssertionResultper assertion — carrying the ACTUAL reduction value alongside pass/fail, so conformance harnesses can record and cross-compare the numbers. - run_
inline_ tests_ filtered run_inline_tests_with_providersrestricted to the tests whoseidCONTAINStest_filter.- run_
inline_ tests_ paths - Run the inline tests of every document in
paths, askingoptions_forfor each document’s options. - run_
inline_ tests_ with_ base_ dir run_inline_testswith an explicitbase_diranchoringfrom_filereference paths (esm-spec §6.6.5, pinned convention: relative to the .esm file’s directory).Noneresolves relative paths against the working directory — callers that loaded the document from a path should pass that path’s parent, matching the Julia / Python bindings’ default.- run_
inline_ tests_ with_ options run_inline_tests_filtereddriven by a wholeInlineTestOptions— the entry a CALLER with one loaded document and a full set of knobs wants.- run_
inline_ tests_ with_ providers run_inline_tests_with_base_dirwith the document’sdata_sourcesactually INGESTED (esm-spec §8.9).- sampled_
parameters - Parameters with a
distributionand no update — drawn once at setup. - serialize_
keys - Serialise an already-distinct, already-sorted slice of keys to the canonical compact-JSON index-set form (no further dedup/sort).
- serialize_
pairs - Serialise the
(key, aggregate)output ofgroup_aggregateto the canonical compact-JSON form, each pair as a two-element array[key, value]. - simplify
- Simplify an expression (basic symbolic simplification).
- solve
- Run
probto completion (§2.5.3). - solve_
ensemble - Solve every trajectory of
ens, in index order (§2.5.8). - solve_
to_ completion - Run
integratorto completion (§2.5.6’ssolve!). - solver_
external_ location - Where the document’s
solver.externalpoints (esm-spec §2.2.6), orOk(None)when the document names no run configuration. - state_
cells - Collect the (cell-index-tuple, row) pairs of one array state from the
simulation’s element names (
element_names[row]is the name of state rowrow, e.g."Heat.u[3]"). Flattening prefixes element names with the owning model, and a coupled build may reuse the same bare array name across components (M1.u,M2.u); to avoid mixing every model’s cells into one field, the model-qualified stem wins — an exactmodel.variable/ bare-variablestem match first, then a bare-suffix fallback reached only when no exact stem exists (a bare-keyed single-model build). This is the array analog of [scalar_slot]’s qualified-first two-pass resolution. Sorted by cell tuple so callers get a deterministic pairing. - step
- Advance
integratorby one grid point (§2.5.6’sstep!). - stoichiometric_
matrix - Generate stoichiometric matrix from a reaction system
- stripped
- What
ProblemOptions::stripremoved fromprob, flattened and namespaced (API_SPEC §5.8, “The stripped object”). Empty when nothing was. - substitute
- Substitute variables in an expression, returning a new expression.
- substitute_
in_ model - Substitute variables in all expressions within a model (equations plus discrete/continuous events; other model fields are cloned unchanged).
- substitute_
in_ model_ with_ context substitute_in_modelwith scoped reference resolution.- substitute_
in_ reaction_ system - Substitute variables in all reaction-rate expressions within a reaction system.
- substitute_
in_ reaction_ system_ with_ context substitute_in_reaction_systemwith scoped reference resolution.- substitute_
with_ context - Substitute variables in an expression with scoped reference resolution (esm-spec §2.3.3).
- supported_
migration_ targets - The schema versions
from_versioncan be migrated to. - system_
kind - The DERIVED system kind (esm-spec §6.3.1), which a binding uses when the
system_kindfield is absent and checks against when it is present. - time_
origin - The time origin in seconds from the POSIX epoch (esm-spec §2.2.7):
domain.temporal.reference_time, elsedomain.temporal.start, else the epoch itself, asW0 + f0– whole seconds converted, the fraction added in binary64. - timestamp_
to_ seconds timestampas seconds fromsource’s time origin (esm-spec §2.2.7).- to_dot
- Render
graphas Graphviz DOT (esm-libraries-spec §4.8.3). - to_json
- Serialize an ESM file to JSON string
- to_
json_ compact - Serialize an ESM file to compact JSON string (no pretty printing)
- to_
json_ graph - Render
graphas a JSON adjacency-list document (esm-libraries-spec §4.8.3). Namedto_json_graph, notto_json, becauseto_jsonis the DOCUMENT serializer (API_SPEC.md §8 item 2). Seeto_dot. - to_
mermaid - Render
graphas Mermaid (esm-libraries-spec §4.8.3). Seeto_dot. - update_
model_ metadata - Update model metadata
- validate
- Perform structural validation on an ESM file
- validate_
complete Deprecated - Deprecated alias of
validate_text. - validate_
equation_ dimensions - Validate that an equation’s LHS and RHS have matching dimensions.
- validate_
text - Validate an ESM file completely (schema + structural validation)
- write_
path - Write an ESM file to
pathas pretty-printed JSON.
Type Aliases§
- Build
Provider Factory - The build-time data providers one inline-test BUILD consumes, produced on demand.
- Cadence
Error - A cadence-partition contract violation in a fixture or producer output (a
wrong
expect_cadence, aCONTINUOUSrelational node, afrom_faqcycle, a float topology key, or a malformed node). - Callback
Fn - One callback. See the
wasm32twin for the documentation. - Compile
Deprecated - The former spelling of
Rhs, kept for one minor (API_SPEC §8 item 22). - Covariance
Matrix - Symmetric positive-semidefinite covariance matrix, row-major: entry
[i][j]is the covariance of componentsiandj. - Enum
Lowering Error - Stable diagnostic codes raised by the enum-lowering pass. Mirrors the codes emitted by the TS / Python / Julia / Go bindings.
- Prepare
Progress Fn - A build progress observer. See
crate::problem::ProblemOptions::progress. - Progress
Fn - A progress observer. See
SolveOptions::progress. - Reference
Error Deprecated - Deprecated alias of
ReferenceResolutionError.