comnum.spec_schema#

comnum.spec_schema()#

The JSON Schema of a block of a declarative link: one alternative per block, with the type, default, unit, accepted values and bounds of every parameter, and the ports of the block (x-needs, x-gives), for editors and graphical front ends.

Returns:

the schema (draft 2020-12).

Return type:

dict

Raises:

ValueError – for a schema that has no Python form (not expected from the registry).

Examples

>>> import comnum
>>> s = comnum.spec_schema()
>>> awgn = next(a for a in s["oneOf"] if a.get("title") == "awgn")
>>> awgn["required"], awgn["x-gives"]
(['type', 'snr_db'], ['noise'])