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
|
|
|
Average and monoisotopic mass of the atoms, from RDKit's periodic table. |
|
The nanostructure pictures on the canvas: index, species, style, box and anchors (#138). |
|
What a client shows of a nanostructure species: identity, formula, atom count. |
|
|
|
|
- exception vibesketch.document.nanostructures.NanostructureRefused¶
Bases:
ValueErrorParameters this generator cannot build; the message says why.
- vibesketch.document.nanostructures.attach_to_picture(document, generic_id, species_id, anchor='upper-end')[source]¶
documentwith 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.
- vibesketch.document.nanostructures.masses(symbols)[source]¶
Average and monoisotopic mass of the atoms, from RDKit’s periodic table.
- vibesketch.document.nanostructures.pictures(document)[source]¶
The nanostructure pictures on the canvas: index, species, style, box and anchors (#138).
- vibesketch.document.nanostructures.summary(species)[source]¶
What a client shows of a nanostructure species: identity, formula, atom count.
- vibesketch.document.nanostructures.with_nanostructure(document, parameters, *, species_id=None, label=None, charge=0, multiplicity=None, picture_style=None, picture_label=False)[source]¶
documentwith 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. Optionalpicture_stylealso adds the depiction; any refusal returns neither model nor picture.- Parameters:
document (Document)
parameters (Annotated[Nanotube | Graphene | Nanoribbon | Fullerene, FieldInfo(annotation=NoneType, required=True, discriminator='kind')] | dict[str, Any])
species_id (str | None)
label (str | None)
charge (int)
multiplicity (int | None)
picture_style (str | None)
picture_label (bool)
- Return type:
- vibesketch.document.nanostructures.with_picture(document, species_id, style='schematic', *, label=False, rear='light', brk='auto', width=8.0, at=None)[source]¶
documentwith 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;widthis in bond lengths. RaisesNanostructureRefusedfor an unknown species, style or option.