vibesketch.document.nanostructures

Generated nanostructures as species of a document (#137).

A nanotube, graphene flake, nanoribbon or fullerene is added as a species whose first conformer holds the generated atoms and whose nanostructure record holds the parameters, the bonds and an identity key in place of an InChIKey. It is a finite cluster model: writers take it like any species with a 3D structure, with its charge and multiplicity checked against the electron count. It is not drawn on the canvas, so a redraw keeps it (vibesketch.document.derive.derive()); its depiction is #138.

Functions

attach_to_picture(document, generic_id, ...)

document with a labelled structure moved onto a nanostructure picture's anchor.

masses(symbols)

Average and monoisotopic mass of the atoms, from RDKit's periodic table.

pictures(document)

The nanostructure pictures on the canvas: index, species, style, box and anchors (#138).

summary(species)

What a client shows of a nanostructure species: identity, formula, atom count.

with_nanostructure(document, parameters, *)

document with a generated nanostructure added as a new species, and its summary.

with_picture(document, species_id[, style, ...])

document with a picture of a nanostructure species on its canvas, as one object.

exception vibesketch.document.nanostructures.NanostructureRefused

Bases: ValueError

Parameters this generator cannot build; the message says why.

vibesketch.document.nanostructures.attach_to_picture(document, generic_id, species_id, anchor='upper-end')[source]

document with a labelled structure moved onto a nanostructure picture’s anchor.

The structure’s one attachment atom (#139) is put on the anchor and the structure turned so its bond leaves the picture outwards; figures then print the two as one structure. Raises NanostructureRefused.

Parameters:
Return type:

Document

vibesketch.document.nanostructures.masses(symbols)[source]

Average and monoisotopic mass of the atoms, from RDKit’s periodic table.

Parameters:

symbols (list[str])

Return type:

tuple[float, float]

vibesketch.document.nanostructures.pictures(document)[source]

The nanostructure pictures on the canvas: index, species, style, box and anchors (#138).

Parameters:

document (Document)

Return type:

list[dict[str, Any]]

vibesketch.document.nanostructures.summary(species)[source]

What a client shows of a nanostructure species: identity, formula, atom count.

Parameters:

species (Species)

Return type:

dict[str, Any]

vibesketch.document.nanostructures.with_nanostructure(document, parameters, *, species_id=None, label=None, charge=0, multiplicity=None, picture_style=None, picture_label=False)[source]

document with a generated nanostructure added as a new species, and its summary.

The multiplicity defaults to the lowest the electron count allows (singlet or doublet); one that is impossible is refused, as is any parameter the generator cannot build, with the reason. Raises NanostructureRefused. Optional picture_style also adds the depiction; any refusal returns neither model nor picture.

Parameters:
Return type:

tuple[Document, dict[str, Any]]

vibesketch.document.nanostructures.with_picture(document, species_id, style='schematic', *, label=False, rear='light', brk='auto', width=8.0, at=None)[source]

document with a picture of a nanostructure species on its canvas, as one object.

The picture goes to the right of the drawing unless at (its top-left corner, KET units) is given; width is in bond lengths. Raises NanostructureRefused for an unknown species, style or option.

Parameters:
Return type:

Document