vibesketch.document.generics

Generic structures in the drawing as document entries: R-group cores, their definitions and bracketed groups (#90).

They are derived from the drawing like species, and written as CXSMILES without coordinates: R-group atoms carry their labels ($_R1$), a definition’s attachment points _AP1, and brackets their S-groups (Sg:n:...). The drawing stays the source of truth; nothing here is edited by clients (maintainer decisions, 2026-10-24).

Functions

cxsmiles(mol)

mol as canonical CXSMILES without coordinates, its R-group atoms as $_R1$.

derive_generics(document, scene, labels, ...)

The drawing's R-group cores, bracketed groups and R-group definitions.

generics_report(document)

The document's generic structures and R-group definitions, as JSON data.

vibesketch.document.generics.cxsmiles(mol)[source]

mol as canonical CXSMILES without coordinates, its R-group atoms as $_R1$.

Parameters:

mol (Any)

Return type:

str

vibesketch.document.generics.derive_generics(document, scene, labels, taken, warnings)[source]

The drawing’s R-group cores, bracketed groups and R-group definitions.

Only what figures can draw becomes an entry; a structure the drawing cannot express stays a note, as before. A generic structure keeps its id and compound number while its CXSMILES is the same. taken holds the identifiers already used, and gains the new ones.

Parameters:
Return type:

tuple[list[Generic], list[RGroup]]

vibesketch.document.generics.generics_report(document)[source]

The document’s generic structures and R-group definitions, as JSON data.

Parameters:

document (Document)

Return type:

dict[str, list[dict[str, Any]]]