vibesketch.viewer

Showing a species in vibe-view, the family’s 3D viewer.

Two routes, both carrying the structure as a QVF of its own (one structure, its charge and multiplicity; vibesketch.document.qvf.species_qvf()):

  • The hand-off. When vibe-view’s Sketch button started this server, it named a private directory in VIBEVIEW_SKETCH_HANDOFF (vibe-view #77, vibe-sketch #1). Sending writes the QVF, then a record {"schema": "vibe-view-sketch-handoff/1", "path": "<absolute path>"} under a name that does not end in .json, renamed into place so the viewer never reads half a record. Names sort in the order of sending. A directory that has gone means the viewer has closed.

  • vibe-view’s own command. Otherwise, when vibe-view is installed (the vibe-view command, or the vibeview package beside vibe-sketch), vibe-view open FILE opens the QVF in its viewer.

Neither imports vibe-view; the coupling is the command line and the record.

Functions

mode()

How a species would reach vibe-view now: handoff, launch or None.

show(document, species_id, *[, document_id, ...])

Show one species in vibe-view; returns how and the QVF written.

show_result(document, run_id, view, *[, ...])

Open the selected run's retained data using the shared result-view contract.

Exceptions

ViewerUnavailable

No vibe-view to show the structure in.

exception vibesketch.viewer.ViewerUnavailable[source]

Bases: RuntimeError

No vibe-view to show the structure in.

vibesketch.viewer.mode()[source]

How a species would reach vibe-view now: handoff, launch or None.

Return type:

Literal[‘handoff’, ‘launch’] | None

vibesketch.viewer.show(document, species_id, *, document_id=None, return_dir=None)[source]

Show one species in vibe-view; returns how and the QVF written.

Raises KeyError for an unknown species, QvfError for one without a 3D structure, and ViewerUnavailable with what to do when there is no viewer.

Parameters:
Return type:

dict[str, str]