vibe-sketcherDocumentation

vibesketcher.document.transfer

Read-only transfer of exactly one selected, complete canvas molecule.

Functions

import_transfer(document, data)

Append one viewer geometry, refusing changed connectivity or identity warnings.

prepare_transfer(document, selection)

Export a complete selected molecule as QVF without editing document.

Classes

SelectedAtom(*, node, atom)

StructureTransfer(data, species, generated)

TransferSelection(*, atoms[, generate])

Exceptions

TransferRefused

The selection cannot be transferred without guessing its meaning.

exception vibesketcher.document.transfer.TransferRefused[source]

Bases: ValueError

The selection cannot be transferred without guessing its meaning.

class vibesketcher.document.transfer.SelectedAtom(*, node, atom)[source]

Bases: BaseModel

Parameters:
  • node (Annotated[str, MinLen(min_length=1), MaxLen(max_length=200)])

  • atom (Annotated[int, Ge(ge=0), Strict(strict=True)])

model_config = {'extra': 'forbid', 'strict': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

node: str
atom: StrictInt
class vibesketcher.document.transfer.TransferSelection(*, atoms, generate=False)[source]

Bases: BaseModel

Parameters:
model_config = {'extra': 'forbid', 'strict': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

atoms: list[SelectedAtom]
generate: bool
class vibesketcher.document.transfer.StructureTransfer(data: 'bytes', species: 'str', generated: 'bool')[source]

Bases: object

Parameters:
data: bytes
species: str
generated: bool
vibesketcher.document.transfer.prepare_transfer(document, selection)[source]

Export a complete selected molecule as QVF without editing document.

References belong to this exact document’s KET atom slots. Partial and multiple fragments are refused, including two copies of the same species. Generating a missing conformer requires explicit generate=True.

Parameters:
Return type:

StructureTransfer

vibesketcher.document.transfer.import_transfer(document, data)[source]

Append one viewer geometry, refusing changed connectivity or identity warnings.

Parameters:
Return type:

tuple[Document, list[str]]