cottax.consumers.declaration.refusals module

Why a declaration is refused: a wrapper writing nothing, a signature it cannot read, a declaration held but not in the model, a model with no place to find its names by or none of its own, a value given where nothing reads it.

class NoOutputs(fn: str, kind: str)[source]

Bases: Violation

fn: str
kind: str
template: AbstractClassVar[str] = "{fn} writes no place: name its outputs, `@method('y')` or `method({fn}, 'y')` -- a bare `@method` hands it the function alone, so this {kind} names none"

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

Type:

Wording

class NotPositional(fn: str, parameter: str, kind: str)[source]

Bases: Violation

fn: str
parameter: str
kind: str
template: AbstractClassVar[str] = '{fn}: `{parameter}` is {kind}, so no read binds it -- every parameter is a read, bound by position'

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

Type:

Wording

class HeldByValue(fn: str, parameter: str)[source]

Bases: Violation

fn: str
parameter: str
template: AbstractClassVar[str] = '{fn}: `{parameter}` has a default, which is a setting held by value -- make it a place and read it'

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

Type:

Wording

class ReadsUnlike(fn: str, reads: tuple, parameters: tuple)[source]

Bases: Violation

fn: str
reads: tuple
parameters: tuple
template: AbstractClassVar[str] = '{fn} takes {parameters!r} but reads are given for {reads!r}: one place per parameter'

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

Type:

Wording

class HeldNotInModel(held: tuple)[source]

Bases: Violation

held: tuple
template: AbstractClassVar[str] = '{held!r} held by another declaration but not in the model: put each in a slot too, for what stays at its name'

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

Type:

Wording

class Nameless(models: tuple)[source]

Bases: Violation

models: tuple
template: AbstractClassVar[str] = '{models!r} write no place, so nothing says how their nodes are named: a node writes something'

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

Type:

Wording

class Unnamed(model: str)[source]

Bases: Violation

model: str
template: AbstractClassVar[str] = '{model} has no name of its own: put it in a slot, `{{"name": ...}}`, and write that name where its node name is due'

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

Type:

Wording

class NotAnInput(places: tuple)[source]

Bases: Violation

places: tuple
template: AbstractClassVar[str] = 'a value given at {places!r}, which the graph does not read from outside: only a boundary input takes a value'

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

Type:

Wording