comnum.Native#
- class comnum.Native(kind: str, /, **params: Any)#
A block of the registry of declarative links,
Native("awgn_ebn0", ebn0_db=10); the classes ofcomnum.blocksbuild them.- Parameters:
Example
>>> import comnum >>> comnum.Native("awgn_ebn0", ebn0_db=10).spec("channel") {'type': 'awgn_ebn0', 'label': 'channel', 'ebn0_db': 10}
- bind(condition: Mapping[str, Any] | None, *, fiber: Mapping[str, Any] | None = None, name: str | None = None, label: str | None = None, profile: bool = False, base_dir: str | PathLike[str] | None = None) Callable[[Frame, Rng], None]#
The block of a condition, built by the Rust registry (see
Block.bind()):labelis its name in the chain,namethe campaign, and the condition is labelled as the Rust runner does, for the blocks that report or write files under their label (probe,dump).- Parameters:
condition (dict | None) – the values of the grid variables.
fiber (dict | None) – the
fiberof the specification.name (str | None) – the name of the campaign.
label (str | None) – the name of the block in the chain.
profile (bool) – unused (a single block).
base_dir (str | os.PathLike | None) – the directory the relative paths of the block are resolved against (that of its specification file).
- Returns:
the
applymethod of aLinkBlock.- Return type:
Example
>>> import comnum >>> from comnum import blocks as B >>> apply = B.AwgnEbn0(ebn0_db=comnum.var("x")).bind({"x": 5.0}) >>> callable(apply) True