saealib.core.PortSpec#
- class saealib.core.PortSpec(*, name, direction, data, cardinality, required_services=(), optional=False)[source]#
Bases:
objectA named, directional data contract.
cardinalityandoptionalare independent axes despite the shared vocabulary.cardinalitydescribes how many items arrive per activation once the port is connected (membership inCARDINALITIES, including"OPTIONAL", is checked by the compiler’s contract diagnostics, not here).optionaldescribes whether the port may have no upstream producer at all (checked by the dataflow compilation rule). Any combination of the two is valid, e.g. a port withcardinality=ONE, optional=Truerequires exactly one item whenever it is connected, but the connection itself is not required.- Parameters:
name (str)
direction (PortDirection)
data (DataSpec)
cardinality (str)
required_services (tuple[ServiceRequirement, ...])
optional (bool)
Methods
Method Details