cottax.consumers.execution.refusals module

Why a run is refused: a place a data structure does not index, an implementation it cannot call, a problem Drive cannot give one, a body returning a miscount or failing when traced, a graph proved below what runs, a node that cannot be a jit cache key, a value given twice or none.

class ForeignPlace(places: tuple, classes: tuple, structure: str, own: str)[source]

Bases: Violation

places: tuple
classes: tuple
structure: str
own: str
template: AbstractClassVar[str] = '{places!r}, of classes {classes}: {structure} indexes a {own} alone, so it neither reads nor writes them'

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

Type:

Wording

class NotCallable(node: object, implementation: object)[source]

Bases: Violation

node: object
implementation: object
template: AbstractClassVar[str] = '{node!r} is implemented by {implementation!r}, which describes what runs it and is not itself something to call -- `Implement` it with a callable here'

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

Type:

Wording

class NotADriverImplementation(node: object, implementation: object)[source]

Bases: Violation

node: object
implementation: object
template: AbstractClassVar[str] = '{node!r} is driven, and run by {implementation!r}, which is not a `DriverImplementation`: nothing says which driver it implements'

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

Type:

Wording

class ImplementsAnother(node: object, driver: str, implements: str)[source]

Bases: Violation

node: object
driver: str
implements: str
template: AbstractClassVar[str] = '{node!r} is driven by a {driver}, and its implementation implements a {implements}: what runs it is not what was accepted'

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

Type:

Wording

class DataMissing(node: object, implementation: str, roles: tuple)[source]

Bases: Violation

node: object
implementation: str
roles: tuple
template: AbstractClassVar[str] = '{node!r} is run by {implementation}, which needs data its driver does not take: {roles}'

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

Type:

Wording

class ReportUnavailable(node: object, implementation: str, roles: tuple)[source]

Bases: Violation

node: object
implementation: str
roles: tuple
template: AbstractClassVar[str] = '{node!r} asks its driver for reports {implementation} cannot produce: {roles}'

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

Type:

Wording

class NoneAccepts(node: object, problem: object)[source]

Bases: Violation

node: object
problem: object
template: AbstractClassVar[str] = '{node!r}: no implementation given accepts {problem!r}'

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

Type:

Wording

class NoneImplements(node: object, contract: str)[source]

Bases: Violation

node: object
contract: str
template: AbstractClassVar[str] = '{node!r}: no implementation given implements its contract, a {contract}'

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

Type:

Wording

class NoDefaultContract(implementation: object, implements: str)[source]

Bases: Violation

implementation: object
implements: str
template: AbstractClassVar[str] = '{implementation!r} implements {implements}, which has no default contract: `Assign` it by hand'

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

Type:

Wording

class ReturnedUnlike(node: object, count: int, outputs: tuple, got: str)[source]

Bases: Violation

node: object
count: int
outputs: tuple
got: str
template: AbstractClassVar[str] = '{node!r} returned {got} for its {count} outputs {outputs!r}: a body returns one value per output, in order -- one output takes the whole return value'

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

Type:

Wording

class TraceFailed(node: object, reason: str)[source]

Bases: Violation

node: object
reason: str
template: AbstractClassVar[str] = '{node!r} fails when traced at these shapes ({reason}): a body jax cannot trace, or shapes that do not match'

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

Type:

Wording

class ProvedBelow(proof: str)[source]

Bases: Violation

proof: str
template: AbstractClassVar[str] = 'a run takes a `CallableGraph`, and the graph is a {proof}: prove it a `CallableGraph`'

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

Type:

Wording

class Unhashable(node: object, kind: str, count: int, leaves: str)[source]

Bases: Violation

node: object
kind: str
count: int
leaves: str
template: AbstractClassVar[str] = '{node!r}: a {kind} holding {count} unhashable leaf/leaves ({leaves}) cannot be a jit cache key. A value carried in the graph is an input the graph does not name -- give it an output on a node of its own, so it can be supplied without rebuilding'

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

Type:

Wording

class BodyByIdentity(node: object, fn: object)[source]

Bases: Violation

node: object
fn: object
template: AbstractClassVar[str] = '{node!r}: {fn!r} is a bound method, minted fresh on every access and comparing its receiver by identity, so re-assembling this graph gives a fresh jit cache key. Pass the object itself if it is callable, or a frozen dataclass wrapping the call'

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

Type:

Wording

class PartialBody(node: object, fn: object)[source]

Bases: Violation

node: object
fn: object
template: AbstractClassVar[str] = '{node!r}: {fn!r} is a `functools.partial`, which compares by identity, so re-assembling this graph gives a fresh jit cache key. Pass a frozen dataclass whose fields are the bound arguments'

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

Type:

Wording

class NotDriverData(problem: object, role: str, why: str)[source]

Bases: Violation

problem: object
role: str
why: str
template: AbstractClassVar[str] = "`values[{role}]` names an unknown of {problem!r}, {why}: only a driven problem's own roles take data"

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

Type:

Wording

class NotAnUnknown(role: str, written: object, why: str)[source]

Bases: Violation

role: str
written: object
why: str
template: AbstractClassVar[str] = "`values[{role}]` names {written!r}, {why}: a driver's data is keyed by an unknown of the problem it drives"

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

Type:

Wording

class TakesNoValue(problem: object, role: str, place: object)[source]

Bases: Violation

problem: object
role: str
place: object
template: AbstractClassVar[str] = "{problem!r}'s `{role}` is at {place!r}, which a node computes: it takes no value"

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] = '`values[Inputs]` names {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

class ValuedTwice(place: object, sources: tuple)[source]

Bases: Violation

place: object
sources: tuple
template: AbstractClassVar[str] = '{place!r} is given twice, by {sources}: an input has one source'

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

Type:

Wording

class Unvalued(missing: str)[source]

Bases: Violation

missing: str
template: AbstractClassVar[str] = 'no value for {missing} -- by name in `values={{Inputs: {{name: value}}, Role: {{unknown: value}}}}`, or from a structure in `read_from`'

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

Type:

Wording

class NoSlotFor(role: str)[source]

Bases: Violation

role: str
template: AbstractClassVar[str] = "{role} by structure: a {role} is one per problem, at no unknown's place in a structure -- give or read it by name"

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

Type:

Wording

class NoRoleAt(role: str, written: object)[source]

Bases: Violation

role: str
written: object
template: AbstractClassVar[str] = '`out[{role}, {written!r}]`: no driver takes or reports a {role} for the problem determining it -- a role is read at an unknown of its driven problem'

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

Type:

Wording

class NoneTakes(role: str)[source]

Bases: Violation

role: str
template: AbstractClassVar[str] = '{role} by structure: no driver of the graph takes or reports a {role}'

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

Type:

Wording