quantcore_circuits.review.server¶
Live dashboard backend: serves the React app (reviewer/ → review/static) and the run state.
API (contract: reviewer/contract/state.ts):
GET /api/state—build/<design>/state.json(a fresh state is created from the design if missing)GET /api/events— Server-Sent Events:event: statewheneverstate.jsonchanges, a ping every 15 sGET /files/<p>— files inside the run directory (screenshots undershots/)POST /api/rebuild— rebuild the layout, write the OAS (+ klive if KLayout is open), headless screenshot, update the Layout step
Standard library only; binds to localhost.
Attributes¶
Functions¶
|
The run directory to show: |
|
|
|
Build → OAS (+ sidecar) → klive (if available) → headless KLayout screenshot → state. |
|
Serve the dashboard for |
|
Serve the dashboard in follow mode: it shows the run named |
|
What the dashboard shows before any run exists (follow mode): an empty state that says what to do. |
Module Contents¶
- quantcore_circuits.review.server.live_run_dir(root: pathlib.Path, run: str | None = None) pathlib.Path | None¶
The run directory to show:
root/<run>if named, else the oneroot/_live.jsonpoints at (the run that saw the latest tracked event), else the most recently updatedroot/*/state.json.
- quantcore_circuits.review.server.make_handler(run_dir, design_source, root: pathlib.Path | None = None)¶
run_dir: a Path (one run) or a callable returning the current run directory (or None): follow mode.
- quantcore_circuits.review.server.rebuild_layout(run, design_source) dict¶
Build → OAS (+ sidecar) → klive (if available) → headless KLayout screenshot → state.
- quantcore_circuits.review.server.serve(design, port: int = 8765, open_browser: bool = True, run_dir: str | pathlib.Path | None = None, background: bool = False)¶
Serve the dashboard for
designon http://127.0.0.1:port.background=Truereturns the server (running in a daemon thread) instead of blocking, for use from Jupyter.
- quantcore_circuits.review.server.serve_live(root: str | pathlib.Path | None = None, run: str | None = None, port: int = 8765, open_browser: bool = True, background: bool = False)¶
Serve the dashboard in follow mode: it shows the run named
run, or (default) whichever run saw the latest tracked event (<root>/_live.json, written byquantcore_circuits.track.start()), switching by itself when a notebook moves on to another design. Same API asserve().
- quantcore_circuits.review.server.waiting_state(root: pathlib.Path) dict¶
What the dashboard shows before any run exists (follow mode): an empty state that says what to do.
- quantcore_circuits.review.server.STATIC¶