math_spec.dimensions
Static dim-set checking — a type system whose type is a set of dim names.
Every node's dim set is computable before any data is bound, so this pass runs
at load on the resolved tree. The per-node rules are the "Dim algebra" table in
docs/reference/language/expressions.md; a constraint's two sides together
must equal its dims, and a where or a bound may not exceed the frame.
check_schema(schema, resolved)
#
Check every declaration's dim rules, on the trees resolved holds for schema.
| RAISES | DESCRIPTION |
|---|---|
DimensionError
|
On the first declaration that breaks one. |
Source code in src/math_spec/dimensions.py
dims_of(node, schema, context)
#
The dim set of a resolved expression, checking every rule on the way.
| RAISES | DESCRIPTION |
|---|---|
DimensionError
|
On the first rule broken. |
Source code in src/math_spec/dimensions.py
join_dims(columns, inner, context, operand)
#
The dims inner has once columns joins it, an expression's or a predicate's alike.
The dims joined on go, the dims grouped by arrive, and each column joined
on and not grouped by opens its own axis (:attr:JoinColumns.axes), which
the :class:~math_spec.program.Sum over the join takes away. A column
both joined on and grouped by keeps its dim. The call a refusal quotes is
at where each group is one row, and sum otherwise.
| RAISES | DESCRIPTION |
|---|---|
DimensionError
|
operand does not carry a dim the call joins on, or already carries one the call adds. |