comnum.spec_check_link#
- comnum.spec_check_link(kinds)#
Check the ports of a link of block types: every block finds the facts it needs among those the blocks before it give.
- Parameters:
kinds (list[str]) – the block types, in the order of the link.
- Raises:
ValueError – naming the first block that misses a fact and the blocks that give it.
Examples
>>> import comnum >>> comnum.spec_check_link(["source", "awgn", "noise_estimate"]) >>> try: ... comnum.spec_check_link(["fec_encode", "map", "demap"]) ... except ValueError as e: ... print(str(e).split(":")[1].strip()) link block 3 (demap) needs noise, which no block before it gives