quantcore_circuits.live.klive

Minimal klive client: ask a running KLayout (with the klive Salt package) to open or reload a layout file.

Protocol (verified against klive 0.4.x klayout/python/klive_server.py): TCP on localhost:8082, one JSON object terminated by a newline. Keys: gds (absolute path, required), keep_position (bool; must always be present), optional technology, lyrdb, l2n, markers. The server replies with a JSON object containing type ("open"/"reload"), file, version and klayout_version.

Attributes

Exceptions

KliveUnavailable

KLayout is not running, or the klive server is not started.

Functions

klive_available([port, timeout]) → bool

send_to_klive(path[, keep_position, lyrdb, ...]) → dict

Open/reload path in KLayout. Returns the server reply (empty dict if it sent none).

Module Contents

exception quantcore_circuits.live.klive.KliveUnavailable

Bases: ConnectionError

KLayout is not running, or the klive server is not started.

quantcore_circuits.live.klive.klive_available(port: int = KLIVE_PORT, timeout: float = 0.3) → bool
quantcore_circuits.live.klive.send_to_klive(path: str | pathlib.Path, keep_position: bool = True, lyrdb: str | pathlib.Path | None = None, technology: str | None = None, port: int = KLIVE_PORT, timeout: float = 2.0) → dict

Open/reload path in KLayout. Returns the server reply (empty dict if it sent none).

quantcore_circuits.live.klive.KLIVE_PORT = 8082