vibesketch.document.embed

3D structures for a document’s species, cached in the document.

Each species gets its conformers from vibesketch.chem.embed.embed_3d() and keeps them while its structure, charge and multiplicity stay the same, so a redraw elsewhere on the canvas does not throw them away (see vibesketch.document.derive). The input writers read the first conformer.

Functions

embed(document[, species, count, replace])

document with 3D conformers for species (default: all of them).

Classes

EmbedReport([embedded, kept, failed, warnings])

What embedding did, per species id.

Exceptions

UnknownSpecies

The document has no species with that id.

class vibesketch.document.embed.EmbedReport(embedded=<factory>, kept=<factory>, failed=<factory>, warnings=<factory>)

Bases: object

What embedding did, per species id.

Parameters:
embedded: list[str]
kept: list[str]

Species that had conformers already and were left alone.

failed: dict[str, str]

Species that could not be embedded, with the reason.

warnings: list[str]
exception vibesketch.document.embed.UnknownSpecies

Bases: KeyError

The document has no species with that id.

vibesketch.document.embed.embed(document, species=None, *, count=1, replace=False)

document with 3D conformers for species (default: all of them).

A species that has conformers keeps them unless replace is set. Raises UnknownSpecies for an id the document does not have.

Parameters:
Return type:

tuple[Document, EmbedReport]