Project

EarthSciASTDiff

Analytical sparse Jacobians for EarthSciAST (.esm) models by symbolic differentiation of the expression AST.

Contents

This is the documentation for the older version v0.7.0. For the latest release, see v0.8.0.

sys_view

Stable type · Differentiate a model

Tier: stable · Kind: type · Topic: Differentiate a model

JuliaPythonRust
SysViewSysViewSysView

Julia

struct SysView
SysView(variables::Dict{String, Any}, equations::Vector, index_sets::Dict{String, Any}, domain, data_sources, refs)
SysView(variables, equations, index_sets, domain, data_sources, refs)
SysView(variables, equations, index_sets)
SysView(variables, equations, index_sets, domain)
SysView(variables, equations, index_sets, domain, data_sources)
SysView

Uniform system view: variables (name → ModelVariable), equations, the document’s index_sets, its domain (nothing when it has none; the evaluation document carries its time origin, esm-jacobian-spec.md §8.1) and its data_sources (nothing when unknown: a FlattenedSystem does not carry them; the derived documents copy the entries a data-fed parameter names, §8.1). Construct with sysview .

Source

Python

class SysView
SysView(variables: dict[str, object], equations: list, index_sets: dict[str, object], domain: object = None, data_sources: object = None)

A model or flattened system as the band calculus sees it: its variables, equations and index sets, with subsystems already expanded. Build one with sysview .

Source

Rust

pub struct SysView<'a> {
    pub variables: IndexMap<String, Cow<'a, ModelVariable>>,
    pub equations: Cow<'a, Vec<Equation>>,
    pub index_sets: IndexMap<String, IndexSet>,
    pub domain: Option<&'a Domain>,
    pub data_sources: Option<&'a IndexMap<String, DataSource>>,
    pub refs: Option<Rc<RefLayer>>,
}

impl<'a> SysView<'a> { pub fn with_data_sources(self, data_sources: Option<&'a IndexMap<String, DataSource>>) -> Self }

A model as the band calculus sees it: its variables, equations and index sets. Build one with sysview (one model of a document) or sysview_flat (a flattened system).

Each variable is borrowed from its model or flattened system, except a pointwise-lifted state of a flattened system, which the view owns with its grid shape (see sysview_flat).

Source · Rust docs