cottax.consumers.surface.interface_types module¶
- type Named[P] = str | P¶
A place as written: a name, or a path.
- class Step[source]¶
Bases:
FrozenOne step from a container of models to what it holds: a name its place gives the node (DerivedNames.node_in_tree).
- class Field(name: str)[source]¶
Bases:
StepA dataclass’s public field, or a named tuple’s.
- name: str¶
- class Surface[N: Label, V: Place](locator: Locator[V, N])[source]¶
Bases:
Frozen,Generic[N,V]What a model is written through: locator says what a bare string means, and what else is written means what its Written answer says. A part is a level under it adding methods; a surface a study uses joins parts, a class. A method’s parameter annotated Place, Label or a tuple of either (alone, | None, varargs, or in a Mapping) is read through the surface before the method runs: a caller writes it any way the surface reads, and the method is handed it exact.
- located(locator: Locator[V, N])[source]¶
The same surface, strings meaning what locator says.
- Return type:
Self
- place(written: Any, *, role: str = 'what is written')[source]¶
A place: a string, as the locator says, an exact place, or what it stands for (Written), if one place: a V path, a wrapper’s one output.
- Return type:
V
- places(written: Any, *, role: str = 'what is written')[source]¶
Places: one written alone, or several; what stands for places, all of them.
- Return type:
tuple[V,...]
- node(written: Any, *, role: str = 'what is written')[source]¶
A node name: a string, as the locator says, an exact name, or the name it takes (Written): an N path, a wrapper’s function’s name.
- Return type:
N
- nodes(written: Any, *, role: str = 'what is written')[source]¶
Node names: one written alone, or several.
- Return type:
tuple[N,...]
- property derived: DerivedNames[N, V]¶
The names derived from the class of place the locator locates.
- class Purpose(mint: Mint)[source]¶
Bases:
FrozenA purpose as a study writes it: called on a name as written, the Derived name.
- class Derived(mint: Mint, written: Any, beside: tuple[str, ...])[source]¶
Bases:
FrozenThe name mint derives from one as written, read where the surface reads it and never stored: cx.copy(‘y’), cx.solve(‘f’), cx.given.beside(‘y’, ‘k’) (beside the names one deeper first, a place only).
- written: Any¶
- beside: tuple[str, ...]¶
- class Given[source]¶
Bases:
MintA read written as a value, beside the first output: ^given.<output>.<parameter>.
- class RolePlaces(entries: OrderedMap[type[Role], PlaceToPlace])[source]¶
Bases:
FrozenWhere a driver’s data and reports go, a rule per role (entries), found along the role’s ancestry, the most specific first: a PerUnknown role’s applied to each unknown, a PerProblem one’s to the problem’s name read as a place. A role with no entry is refused: nothing is named after a role unless a rule says so. a | b joins two, b’s winning.
- entries: OrderedMap[type[Role], PlaceToPlace]¶
- core_role_places = RolePlaces(entries={<class 'cottax.core.driven.roles.Start'>: ^start, <class 'cottax.core.driven.roles.Steps'>: ^steps})¶
a start at ^start.u, the steps at ^steps.<problem>.
- Type:
Core’s roles, each at its purpose