Skip to content
Construct PsiQDK QREF

qref

qref

Public API of QREF.

SCHEMA_GENERATORS module-attribute

SCHEMA_GENERATORS = {'v1': generate_schema_v1}

MODELS module-attribute

MODELS = {'v1': SchemaV1}

LATEST_SCHEMA_VERSION module-attribute

LATEST_SCHEMA_VERSION = 'v1'

SchemaV1

Bases: BaseModel

Root object in Program schema V1.

version instance-attribute

version: Literal['v1']

program instance-attribute

program: RoutineV1

verify_topology

verify_topology(routine: RoutineV1) -> TopologyVerificationOutput

Checks whether program has correct topology.

Correct topology cannot include cycles or disconnected ports.

Parameters:

Name Type Description Default
routine RoutineV1

Routine or program to be verified.

required

generate_program_schema

generate_program_schema(version: str = LATEST_SCHEMA_VERSION) -> dict[str, Any]

Generate Program schema of given version.

Parameters:

Name Type Description Default
version str

version identifier of the schema.

LATEST_SCHEMA_VERSION

Returns:

Type Description
dict[str, Any]

A dictionary with JSON schema describing program.

Raises:

Type Description
ValueError

if version does not match any known version schema.