cottax.consumers.surface.interface module¶
A surface converts whatever is input to cottax native names.
Of a place:
DerivedNames: how a class of names gives the other class, and a name one deeper.
Of a type that wants to be a place or a node (Written):
How it is converted from what it can be given from the surface (itself + the naming rules)
- class DerivedNames[N: Label, V: Place][source]¶
Bases:
Answer,Generic[N,V]How a class of names gives the other class, and a name one deeper; how it wears a purpose is core’s Minting.
- about: AbstractClassVar[Any] = (<class 'cottax.core.maths.places.Place'>, Label)¶
a class, a type alias of one, a protocol, or a tuple of those. @answers refuses a class that is none; a protocol is met by shape, which a class cannot be asked.
- Type:
What the interface is answered per, bound by the interface
- abstractmethod beside(place: V, name: str)[source]¶
place one name deeper: where a read written as a value sits, under its purpose.
- Return type:
V
- abstractmethod node_at(place: V)[source]¶
The node name a place gives: where a closure over it binds.
- Return type:
N
- class Written[N: Label, V: Place][source]¶
Bases:
Answer,Generic[N,V]What a study writes where a name is due that is neither a string nor an exact name: the places it stands for, and the node name it takes. Registered by the owner of its class (pytree for a V / N builder, declaration for a wrapper or a problem); a class nobody answers is no name.
- abstractmethod places(written: Any)[source]¶
The places written stands for; None where it is no place.
- Return type:
tuple[V,...] |None
- abstractmethod node(written: Any, names: DerivedNames[N, V])[source]¶
The node name written takes, names the surface’s rules; None where it is no node name.
- Return type:
Optional[N]
- class Locator[V: Place, N: Label][source]¶
Bases:
Frozen,Choice,Generic[V,N]How a bare string is converted to a cottax native Place or Label.
Handed in as:
surface.located(Under(V.plasma, GetAttrKey)), a surface whose strings are attributes under .plasma; cx.Scope(V.plasma, GetAttrKey) is the same.
- places: AbstractClassVar[type[Place]]¶
what the names derived from one are found by.
- Type:
The class of place it locates
- nodes: AbstractClassVar[type[Label]]¶
The class of node name it locates.
- class Part(locator: Locator[V, N])[source]¶
-
A level of a surface adding methods: each takes exact names, its parameters annotated Place or Label read by the surface before it runs, and returns a declaration, an op or a run. What it defaults to is an AbstractVar a final binds. Two parts defining one name are refused where they are joined.
Handed in as:
class Mine(ShippedSurface, MyPart), the shipped parts and one of a study’s own, then Mine(locator, conventions) – or a surface joining only the parts it names.
- class Editing(locator: Locator[V, N])[source]¶
Bases:
PartCore’s own edits, written by name: the ops a study writes by hand, each named after the op it builds; a copy goes where copies says.
- copies: AbstractVar[PlaceToPlace]¶
^copy.var.
- Type:
Where a cut’s copy of a place goes
- copy(var: Place)[source]¶
Where a cut of var puts its copy, as this surface’s cuts and closings mint it.
- Return type:
- cut(var: Place, readers: tuple[Label, ...], *, copy_of: PlaceToPlace | None = None)[source]¶
readers (one, or several) read a copy of var; its producer stays.
- Return type:
- rename(node: Label, onto: Mapping[Place, Place])[source]¶
The node reads and owns each place of onto at the place it maps to.
- Return type:
- determine(requirement: Label, *unknowns: Place)[source]¶
The requirement determines unknowns: a problem.
- Return type:
- nest(inner: Label, outer: Label)[source]¶
The problem inner is answered inside every iteration of outer.
- Return type: