cottax.core.refusal_kinds module¶
Every refusal kind the maths defines, for a study matching a refusal by kind.
- class CycleTooLarge(size: int, limit: int)[source]¶
Bases:
Violation- size: int¶
- limit: int¶
- template: AbstractClassVar[str] = '{size} nodes on one cycle is beyond the exact order search (limit {limit}): raise `GaussSeidelMinimal(limit=)`, or hand `GaussSeidelOrdered` an order'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class KeyRepeats(keys: tuple)[source]¶
Bases:
Violation- keys: tuple¶
- template: AbstractClassVar[str] = 'by_name: {keys!r} each key more than one rule'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NoRule(nodes: tuple)[source]¶
Bases:
Violation- nodes: tuple¶
- template: AbstractClassVar[str] = 'no rule keyed by a node of {nodes!r}: key one, `NoCuts()` to leave it alone, or use the one rule alone for every cycle'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OrderMismatch(order: tuple, nodes: tuple)[source]¶
Bases:
Violation- order: tuple¶
- nodes: tuple¶
- template: AbstractClassVar[str] = 'gauss_seidel: the order {order!r} does not name the nodes {nodes!r} exactly once each -- an order sweeps one cycle, and one per cycle is `ByName`'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class SeveralRules(keyed: tuple)[source]¶
Bases:
Violation- keyed: tuple¶
- template: AbstractClassVar[str] = 'several rules keyed on one cycle, by {keyed!r}: cycles are disjoint, so one key lies on one'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnInsideRead(place: Place, own: Place)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'owns {own!r}, which lies inside {place!r}, which it reads -- that read would silently be a boundary input'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnsNested(place: Place, other: Place)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'owns {place!r} and {other!r}, one inside the other -- two outputs written to one storage'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnsTwice(place: Place, other: Place)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'duplicate output name {place!r}'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class ReadInsideOwn(place: Place, own: Place)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'reads {place!r}, which lies inside {own!r}, which it owns -- reads are matched by equality, so this read would silently miss its own output'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class ReadsOwn(place: Place)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'reads {place!r}, which it also owns. Reading the name a node produces back makes it mean the value assumed and the value produced at once -- `Cut` it and read the copy'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NothingToAsk(interface: str, what: str)[source]¶
Bases:
Violation- interface: str¶
- what: str¶
- template: AbstractClassVar[str] = 'a graph with no {what} has no class to find its {interface} by'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class Constant(problem: Label, places: tuple[Place, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{problem!r} reads {places} as a condition, but nothing in its cycle produces it, so no unknown of the problem can move it -- a constant is not a condition; compute it from the unknowns, or drop it'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NoProblem(cycle: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'coupled cycle {cycle} declares no problem, so it has no conditions and there is nothing to hand a driver -- `Cut` a variable in the cycle and drive the iteration from outside, or declare the problem to drive within the cycle'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OutsideCycle(problem: Label, unknowns: tuple[Place, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{problem!r} has no body and is in no cycle at its level: nothing it reads depends on {unknowns}, so no iteration can determine them -- a problem is answered by a condition computed from its unknowns (e.g. r_u(u) = 0), not by a value'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnReadInsideCycle(problem: Label, places: tuple[Place, ...], readers: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{problem!r} owns {places} without answering it, and it is read by {readers} inside the block it drives -- a report is bound after convergence, so a reader on the cycle would iterate against a value that does not exist yet'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class ReadInsideCycle(problem: Label, places: tuple[Place, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{problem!r} reads {places} without holding against it, and it is produced inside the block it drives -- a driver reads its data before the block runs, so it must come from outside (an earlier block, or a boundary input)'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class RequirementUnanswered(node: Label, conditions: tuple[Place, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{node!r} holds {conditions} against nothing: it has no unknowns, so no driver can move it -- `Determine` it by a variable on its cycle, or drop it'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class SeveralOutermost(cycle: tuple[Label, ...], problems: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'cycle {cycle} declares several problems ({problems}) with nothing saying which is outer -- one driver answers one problem, so `Combine` them into a single problem over every unknown, or `Nest` the others inside one of them. Which is a modelling decision, not something the blocking can read off the graph'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class StillCyclic(problem: Label, cycle: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = "inside {problem!r}'s iteration, {cycle} is still cyclic with no problem on it, so there is no condition map to build for it. Cut a variable and pick a driver (inside / outside), or nest a problem that answers it in {problem!r}"¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnAroundOwner(place: Place, witness: Place, node: Label, other: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'output {witness!r} of {other!r} lies inside {place!r}, owned by {node!r} -- two nodes would determine one place'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnedTwice(place: Place, node: Label, other: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'output {place!r} is owned by both {other!r} and {node!r}'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnerInsideRead(place: Place, witness: Place, readers: tuple[Label, ...], owner: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'output {witness!r} of {owner!r} lies inside {place!r}, read by {readers} -- that read would silently miss this output'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnInsideOwner(place: Place, witness: Place, node: Label, other: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'output {place!r} of {node!r} lies inside {witness!r}, owned by {other!r} -- two nodes would determine one place'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class ReadInsideOwner(place: Place, witness: Place, readers: tuple[Label, ...], owner: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{readers} read {place!r}, which lies inside {witness!r}, owned by {owner!r} -- reads are matched by equality, so this would silently be a boundary input'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class OwnsNothing[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'a functional node must own at least one variable'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class StatesNothing(node: str)[source]¶
Bases:
Violation- node: str¶
- template: AbstractClassVar[str] = '{node}: an empty condition node -- no unknowns and no conditions, so it is in no structure'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class BlockTooSmall(block: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'block {block} is not two nodes -- a box contracts at least two into one'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class BoxOwnsNothing(block: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'block {block} owns nothing, so as one node it would compute nothing and be unreachable -- a box is a computation, so contract only what produces'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NestingLoop(inner: Label, outer: Label, chain: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{outer!r} is already answered inside {inner!r} ({chain}), so nesting the one in the other closes a loop -- nesting is a forest'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NodeInTwoBlocks(nodes: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{nodes} each in two blocks -- a node is contracted into one box at most'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NotAProblem(nodes: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{nodes} determines nothing, so no iteration of it answers anything -- an end of a nesting is a problem: `Determine` it, naming the unknowns it fixes, or `Unnest` it first so the plan says the nesting went'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class SelfNested(inner: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{inner!r} inside itself -- an iteration does not answer the problem it is'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class Unbound(inner: Label, outer: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'nesting {inner!r} in {outer!r}: an end is not a node of this graph'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class Unreachable(inner: Label, outer: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{inner!r} and {outer!r} are not on one cycle, so no iteration of the one re-runs the other and there is nothing for the nesting to mean -- `Unnest` it before cutting or rewiring the pair apart'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class AlreadyCut(var: Place, copy: Place)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{var!r} is already cut: its copy {copy} exists. A variable is cut at most once -- two cuts would assume two values for one place. Cut with more readers at once to share a copy'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class AlreadyDetermined(requirement: Label, unknowns: tuple[Place, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{requirement!r} already determines {unknowns!r} -- `Undetermine` it first, so the earlier choice is dropped deliberately rather than silently replaced'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class AlreadyUndetermined(problem: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{problem!r} already determines nothing, so there is nothing to take off'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class DoesNotRead(var: Place, nodes: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = "cut({var}): {nodes} do not read {var!r}, so there is no read to move onto the copy -- a cut's readers read the variable, and its producer stays as it is"¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NoReaders(var: Place, copy: Place)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'cut({var}): no readers, so {copy!r} would be a name nothing reads'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NotProduced(var: Place)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{var!r} is not computed here, so there is nothing to cut'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NotRenamed(node: Label, places: tuple[Place, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{node!r} neither reads nor owns {places!r}'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NoUnknowns[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'determine(): no unknowns -- a condition node that determines nothing is what it already is'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class UnknownTwice(unknowns: tuple[Place, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'determine(): {unknowns!r} names an unknown twice'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class AlreadyNested(inner: Label, outer: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{inner!r} is already answered inside {outer!r} -- a problem has one enclosing iteration, so `Unnest` it before nesting it somewhere else'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NameTaken(name: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'node name {name!r} is already bound -- an insert adds a binding, it does not replace one'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NodeTwice(nodes: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'combine(): {nodes!r} names a node twice'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NotAddable(kind: str)[source]¶
Bases:
Violation- kind: str¶
- template: AbstractClassVar[str] = 'combine(): a {kind} defines no `+`, so no two of them can be folded'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NotBound(name: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'not a node of this graph: {name!r} -- an edit names what is bound'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NotNested(inner: Label)[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{inner!r} is not nested inside anything, so there is nothing to undo'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NotOfKind(nodes: tuple[Label, ...], kind: str, found: str)[source]¶
Bases:
Violation- kind: str¶
- found: str¶
- template: AbstractClassVar[str] = 'combine({kind}): {nodes!r} is {found}, and a fold is well-defined over one kind only'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NothingDeleted[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'delete(): nothing to delete'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NothingInserted[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'insert(): nothing to insert'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class NothingToCombine[source]¶
Bases:
Violation- template: AbstractClassVar[str] = 'combine(): fewer than two nodes, so nothing to combine'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- class Stranded(inner: tuple[Label, ...], outer: tuple[Label, ...])[source]¶
Bases:
Violation- template: AbstractClassVar[str] = '{inner} in {outer} would lose one end and keep the other -- `Unnest` it first, so a plan never quietly voids what an earlier op recorded'¶
e.g. ‘output {place!r} is owned by both {other!r} and {node!r}’
- Type:
Wording
- 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 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
- 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