cadCAD-org / cadcad-ri

The Reference Implementation
https://cadcad.org
BSD 2-Clause "Simplified" License
18 stars 10 forks source link

[Impl] pass through blocks #56

Open DrCatman opened 1 year ago

DrCatman commented 1 year ago

pass in a space and non-negative integer

domain: space co-domain: same space, n copies

mzargham commented 1 year ago
from cadcad.blocks import deadend, indentity

deadend

annotations

def deadend(domain:List[Space], n_terminals=1:int )-> Block:

use

myblock = deadend([Real])

expected

myblock.domain = domain #input argument
myblock.codomain = [EmptySpace for _ in range(n_terminals)]

identity (and related broadcast block)

annotations

def identity(domain:List[Space], n_terminals=1:int )-> Block:

use

myblock = identity([Real])

expected

myblock.domain = domain #input argument
myblock.codomain = [Real for _ in range(n_terminals)]