Skip to main content

Module formula

Module formula 

Source
Expand description

Equation-editor formulas: parsing and grid-cell evaluation.

The grammar follows the VERDI formula editor: arithmetic (+ - * / ^ **), elementary functions, and per-cell aggregation over time or vertical layers. NAME[n] references variable NAME in the n-th opened dataset (1-based); an unqualified NAME refers to the dataset being viewed.

Structs§

VarRef

Enums§

Aggregate
AggregateAxis
BinaryOp
Expr
Function

Constants§

FUNCTION_NAMES
Names accepted by the parser, listed in the formula editor and docs.

Traits§

FormulaInputs
Data access used while evaluating a formula.

Functions§

depends_on
Whether the result varies along axis, i.e. some reference is not enclosed by an aggregation over that axis.
evaluate
Evaluate expr at the given time and layer indices into a displayable slice.
evaluate_constant
Evaluate a formula that contains only numbers and functions.
is_identifier
Whether text is a plain identifier usable as a formula name.
is_identifier_char
Characters that may appear in an unquoted variable name after the first.
parse
Parse a formula expression (without a name = prefix).
references
Unique variable references in order of first appearance.