cottax.core.maths.steps module

An executable graph read as steps: Run a function node, Solve a cycle.

check_every_node(g: SteppedExecutableGraph)[source]

Every level’s checks_node, root first, each asked of every node.

Return type:

Iterator[Violation]

class Run[N: Label](node: N)[source]

Bases: Frozen, Generic[N]

A function node, run.

node: N
class Solve[N: Label, G](problem: N, interior: G)[source]

Bases: Frozen, Generic[N, G]

A cycle: its outermost problem, and what one iteration of it runs.

problem: N
interior: G

The cycle without problem, proved at the level steps was asked of.

type Step[N: Label, G] = Run | Solve

What a run does with one component of an executable graph, by label.

class SteppedExecutableGraph[N: Label, V: Place](graph: NestingGraph[N, V])[source]

Bases: ExecutableGraph[N, V], Generic[N, V]

An executable graph read as steps, and the proofs over it that keep them. A level below adds checks_node alone, which holds of every subset, so every interior is proved at the level steps was asked of.

checks: PerLevel[tuple[Callable[[Any], object], ...]] = (<function check_every_node>,)

Callable [self] -> iterable of violations, which are raised at construction unless skipped (see unchecked).

checks_node: PerLevel[tuple[Callable[[N, NodeDefinition[V]], Iterator[Violation]], ...]] = ()

the one thing a level below adds.

Type:

(name, node) -> violations

property steps: tuple[Step[N, Self], ...]

One per component, in dependency order. One node is a Run – a problem is never alone on its cycle – and several are a cycle, a Solve of its one outermost problem over the interior.