vibesketch.document.coordinates

Species from 3D structures other programs wrote: QVF sections, XYZ frames.

A vibe-qc result, a structure vibe-view saved or exported, or an XYZ file carries atoms and Cartesian coordinates, sometimes with a charge, a multiplicity, a SMILES, a compound number and a name, and sometimes the steps of a reaction scheme. This module turns them into a document:

  • each structure’s bonds are perceived (vibesketch.chem.perceive), with the stated charge, or the one its SMILES implies, else neutral;

  • the molecules are laid out in 2D, the scheme’s steps as reaction rows and the rest in a row below, and the document is derived from that drawing;

  • each species keeps its coordinates as an imported conformer, with the stated multiplicity, compound number and name.

What cannot be done is said in the warnings: a structure without bonds that fit, a SMILES the coordinates contradict, a spin the electrons cannot have.

Functions

from_structures(structures, *[, steps, ...])

A document drawn from structures, the steps as reaction rows.

Classes

Step(id, reactants, products[, reagents, ...])

One reaction step between structures, by chemical role (QVF § 5.14).

Structure(id, symbols, positions[, charge, ...])

One structure as another program wrote it.

Exceptions

NothingDrawn

No structure could be drawn.

exception vibesketch.document.coordinates.NothingDrawn

Bases: ValueError

No structure could be drawn.

class vibesketch.document.coordinates.Step(id, reactants, products, reagents=<factory>, arrow='forward', conditions=<factory>, yield_text=None)

Bases: object

One reaction step between structures, by chemical role (QVF § 5.14).

Parameters:
id: str
reactants: list[str]
products: list[str]
reagents: list[str]
arrow: str = 'forward'
conditions: list[str]
yield_text: str | None = None
class vibesketch.document.coordinates.Structure(id, symbols, positions, charge=None, multiplicity=None, label=None, name=None, smiles=None)

Bases: object

One structure as another program wrote it.

Parameters:
id: str

a QVF section id, an XYZ frame.

Type:

How the warnings name it

symbols: list[str]
positions: list[list[float]]
charge: int | None = None
multiplicity: int | None = None
label: str | None = None
name: str | None = None
smiles: str | None = None
vibesketch.document.coordinates.from_structures(structures, *, steps=None, warnings=None, source='imported')

A document drawn from structures, the steps as reaction rows.

warnings are the caller’s so far, kept first. source is what a stated name records as its origin. Raises NothingDrawn when no structure can be drawn.

Parameters:
Return type:

Derivation