vibe-sketcherDocumentation

vibesketcher.inputs

Input writers: from a document’s job to a program’s input files.

>>> from vibesketcher.document import load
>>> from vibesketcher.inputs import write_input
>>> bundle = write_input(load("ethanol.vsk"), species="m1", program="xyz")
>>> bundle.files[0].name
'm1.xyz'

Every writer fails closed: what it cannot express raises WriterRefusal with the reasons. vibe-sketcher writers lists them.

class vibesketcher.inputs.Batch(bundles=<factory>, refused=<factory>)

Bases: object

Inputs for several species with one writer and one specification.

Parameters:
bundles: list[InputBundle]
refused: dict[str, list[str]]

Per species id, why the writer refused it.

class vibesketcher.inputs.InputBundle(program, species, files)

Bases: object

Everything a writer produced for one job.

Parameters:
program: str
species: str
files: tuple[InputFile, ...]
class vibesketcher.inputs.InputFile(name, content, media_type)

Bases: object

One file of a program input.

Parameters:
name: str

Suggested file name, without directories.

content: str
media_type: str
class vibesketcher.inputs.InputWriter

Bases: ABC

Translate a job specification into one program’s input, or refuse.

name: ClassVar[str]

The registry name, also the value of Job.program.

description: ClassVar[str]

One line for listings.

tasks: ClassVar[frozenset[Literal['geometry', 'sp', 'opt', 'freq', 'opt+freq', 'tddft', 'nmr']]]

The tasks this writer can express.

fields: ClassVar[frozenset[str]] = frozenset({})

The specification fields, besides task, this writer can express.

method_capabilities()

Method-specific encoding limits, if supplied; never a runtime probe.

Return type:

list[dict[str, Any]]

info()

Additive discovery shared by SDK, CLI, REST and MCP.

Return type:

dict[str, Any]

refusals(species, spec)

Everything in the request this writer cannot express; empty if it can.

Parameters:
Return type:

list[str]

write(species, spec)

The input files for species and spec; raises WriterRefusal.

Parameters:
Return type:

InputBundle

exception vibesketcher.inputs.UnknownReference(kind, identifier)

Bases: KeyError

The document has no job or species with that id.

Parameters:
Return type:

None

exception vibesketcher.inputs.UnknownWriter(name)

Bases: LookupError

No writer is registered under that name.

Parameters:

name (str)

Return type:

None

exception vibesketcher.inputs.WriterRefusal(program, reasons)

Bases: ValueError

The writer cannot express the request; reasons says what and why.

Parameters:
Return type:

None

vibesketcher.inputs.get_writer(name)

The writer registered as name; raises UnknownWriter.

Parameters:

name (str)

Return type:

InputWriter

vibesketcher.inputs.register(writer, *, replace=False)

Make writer available under writer.name.

Parameters:
Return type:

None

vibesketcher.inputs.write_input(document, *, job=None, species=None, program=None, spec=None)

Write the input for one job of document.

Name a job by its id, or give a species id and a program (with an optional specification; the default is the geometry only). Raises WriterRefusal when the writer cannot express the request, UnknownWriter for an unknown program, and UnknownReference for an id the document does not have.

Parameters:
Return type:

InputBundle

vibesketcher.inputs.write_inputs(document, *, program, spec, species=None)

The inputs for species (default: every species) with one writer.

A species the writer refuses is listed in Batch.refused with the reasons, and the others are still written; a proton in a mechanism should not stop the rest of it. Raises UnknownWriter for an unknown program and UnknownReference for an unknown species id.

Parameters:
Return type:

Batch

vibesketcher.inputs.writers()

Every registered writer, by name.

Return type:

list[InputWriter]

Modules

base

The input-writer interface.

neb

Reaction-path inputs from a sketched reaction: NEB-TS for ORCA, CI-NEB for vibe-qc (#29).

orca

The ORCA input writer (roadmap WP 2.2).

orca_keywords

The ORCA keyword model: what vibe-sketcher knows how to say in ORCA.

qcschema

The QCSchema molecule writer.

recipe

Resolve a recipe's stages into the calls vibe-qc would run, refusing the rest.

registry

The registry of input writers, and the one call that runs them.

vibeqc

The vibe-qc writer: a Python script that runs the job with vibeqc.run_job.

xyz

The XYZ writer: the geometry of one species, nothing else.