math_spec.piecewise
Expand piecewise: blocks into plain variables and constraints.
A block becomes ordinary affine declarations before anything reads the model,
under names prefixed with the block's own; what each method emits is tabled in
docs/reference/language/piecewise.md. A link expression is judged before
expansion, so a refusal names the link the file wrote rather than an emitted
constraint.
assumptions_of(block, expanded)
#
What block assumes of its numbers, by the name the document prints and a refusal quotes.
A curve has an x-axis only where two links tie it, so the increasing
condition — and the shape it is checked with — exist only there; lp
alone needs a segment to state a line for; a mask must be one run.
The space in each name is what keeps these apart from the file's own
assumptions: entries in one mapping: a declaration is named as an
expression writes it, so no file can write one of these.
Source code in src/math_spec/piecewise.py
declaration_of(expanded)
#
The curve of one expanded block, as a program carries it.
Source code in src/math_spec/piecewise.py
derivations_of(block, expanded)
#
How each parameter block's expansion emitted is filled, by name.
Everything emitted hangs off the mask, so a block masking nothing emits nothing for the caller to be told about.
Source code in src/math_spec/piecewise.py
expand_piecewise(schema)
#
Return schema as a :class:_ExpandedSpec — every piecewise: block expanded away.
Memoised on schema.
| RAISES | DESCRIPTION |
|---|---|
PiecewiseExpansionError
|
A block naming something that does not exist, or emitting a name the file already declares. |