vibesketch.inputs.base

The input-writer interface.

A writer turns one species and one program-neutral job specification into the input files of one program. It fails closed (AGENTS.md, ground rule 5): before rendering anything it lists everything in the request it cannot express, and if that list is not empty it raises WriterRefusal with the reasons instead of guessing a keyword. The vibe-qc QCSchema adapter’s stance is the model: reject what you cannot represent, never drop it.

Subclasses implement InputWriter._refusals() and InputWriter._render(). InputWriter.write() is the only public entry point and always runs the checks first, so no subclass can skip them.

Functions

first_conformer(species)

The conformer writers use: the first, the one the document ranks highest.

needs_conformer(writer, species)

The refusal for a species without 3D coordinates, if it has none.

Classes

InputBundle(program, species, files)

Everything a writer produced for one job.

InputFile(name, content, media_type)

One file of a program input.

InputWriter()

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

Exceptions

WriterRefusal(program, reasons)

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

class vibesketch.inputs.base.InputBundle(program, species, files)

Bases: object

Everything a writer produced for one job.

Parameters:
program: str
species: str
files: tuple[InputFile, ...]
class vibesketch.inputs.base.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 vibesketch.inputs.base.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.

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 vibesketch.inputs.base.WriterRefusal(program, reasons)

Bases: ValueError

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

Parameters:
  • program (str)

  • reasons (Sequence[str])

Return type:

None