cottax.core.maths.valued module

A proved graph and a value at exactly each of its boundary inputs.

check_every_input_given(g: GraphWithValues)[source]
Return type:

Iterator[Violation]

check_nothing_owned_given(g: GraphWithValues)[source]
Return type:

Iterator[Violation]

check_only_inputs_given(g: GraphWithValues)[source]
Return type:

Iterator[Violation]

class GraphWithValues[G: ProvedGraph, V: Place](graph: G, values: OrderedMap[V, Any])[source]

Bases: Frozen, Generic[G, V]

A proved graph and a value at exactly each of its boundary inputs. Its checks read the graph’s structure alone, so any proof holds; a consumer says which it takes.

graph: G
values: OrderedMap[V, Any]
checks: PerLevel[tuple[Callable[[Any], object], ...]] = (<function check_every_input_given>, <function check_nothing_owned_given>, <function check_only_inputs_given>)

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

class InputMissing(places: tuple)[source]

Bases: Violation

places: tuple
template: AbstractClassVar[str] = 'no value given at {places!r}, which the graph reads and nothing in it computes'

e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’

Type:

Wording

class OwnedGiven(places: tuple)[source]

Bases: Violation

places: tuple
template: AbstractClassVar[str] = 'a value given at {places!r}, which the graph computes: an owned place only ever means the value the run computes'

e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’

Type:

Wording

class NotAPlace(places: tuple)[source]

Bases: Violation

places: tuple
template: AbstractClassVar[str] = 'a value given at {places!r}, which the graph neither reads nor computes'

e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’

Type:

Wording