quantcore_circuits.live.klive ============================= .. py:module:: quantcore_circuits.live.klive .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: quantcore_circuits.live.klive.KLIVE_PORT Exceptions ---------- .. autoapisummary:: quantcore_circuits.live.klive.KliveUnavailable Functions --------- .. autoapisummary:: quantcore_circuits.live.klive.klive_available quantcore_circuits.live.klive.send_to_klive Module Contents --------------- .. py:exception:: KliveUnavailable Bases: :py:obj:`ConnectionError` KLayout is not running, or the klive server is not started. .. py:function:: klive_available(port: int = KLIVE_PORT, timeout: float = 0.3) -> bool .. py:function:: 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). .. py:data:: KLIVE_PORT :value: 8082