vibesketch.document.qvf¶
QVF, the vibyverse’s file format, as vibe-sketch’s document format.
Every program of the vibe family keeps its files as QVF (the qvf repository’s spec/qvf-format-spec.md, toolkit release 0.6). A vibe-sketch QVF holds:
a vendor section
x_vibesketch.document, not critical, its namespace declared in the manifest’sextensions, with the membersdocument(the vibe-sketch document, schemavibe-sketch/1, drawing included),species(each species’ identifiers, including those without a 3D structure) andsdf(the species as an SD file);a
preview(spec § 5.15): a PNG of the species as the thumbnail, at most 1024 pixels on its longest side, and the scheme as SVG;one
structuresection per species that has a 3D conformer, namedstructure_<species id>, with its bonds and its identity (§ 5.1): charge, multiplicity, SMILES, InChI, InChIKey, a checked name and the compound number aslabel;a
reaction.scheme(§ 5.14) with the steps whose reactants and products all have a structure section;a
job.spec(§ 5.9) for each calculation on such a species, a job set whose jobs name their structure.
So any QVF reader shows the molecules, knows which is which and what the scheme and its calculations are, without knowing vibe-sketch.
A vibe-qc calculation is submitted as a QVF job container (§ 5.9,
job_container()): one structure, one job.spec in the names
vibe-qc’s run_job takes, the x_vibesketch.document vendor section
with the whole document, and provenance.run_status: "pending".
vibeqc run job.qvf updates that file in place, so the result keeps the
drawing that asked for it.
Reading takes the document from x_vibesketch.document when there is
one. A finished container (run_status stated) also gives back its
result: the runner’s structure becomes a new conformer of the job’s
species, and result says
what happened: job, species, status (pending, running,
converged or failed), program, program_version, method,
tasks, energy (provenance.scf_energy as written, {value,
units}), energy_hartree (the same in hartree when the units say so),
conformer (the index of the new conformer, or None), exit_status,
started_utc, finished_utc and wall_seconds. A QVF from another
program, such as a vibe-qc result, contributes its structure sections as
species: bonds perceived from the 3D coordinates with the charge the section
states (or its SMILES implies), a 2D layout for the drawing, the coordinates
kept as the conformer, and the section’s multiplicity, label and name.
qvf-writer, which provides the qvf_writer and qvf_reader modules, is
an optional dependency installed from the qvf checkout.
Module Attributes
|
The version of the |
|
the |
QVF's registered media type (the qvf repository's spec/file-type). |
Functions
|
The document a QVF archive holds; raises |
|
A pending QVF job container for one vibe-qc job: what |
|
Why replacing this archive would lose data, or |
Whether qvf-writer is installed, so QVF can be read and written. |
|
|
One species as a QVF of its own: one structure with its identity. |
|
A pending QVF job container for one stage of a recipe, for one species. |
|
The document as a QVF archive; raises |
Exceptions
A QVF that vibe-sketch cannot read, or cannot write. |
|
|
qvf-writer is not installed, or is older than the supported toolkit release. |
- vibesketch.document.qvf.stage_container(document, recipe_id, stage_id, species_id, *, preview=False)[source]¶
A pending QVF job container for one stage of a recipe, for one species.
Like
job_container(), with thejob.specspelled from the stage’s resolvedrun_jobkeywords (vibesketch.inputs.recipe): the typed fields, the runner’s tasks for the stage’s kind, and every other keyword underoptionsby name. The structure is the species’ first conformer: the campaign’s stage driver replaces its coordinates with the accepted geometry it is staged, so the template never runs on the sketch’s coordinates where a parent stage exists. RaisesQvfErrorfor a stage the resolver refuses or a species without a conformer.
- vibesketch.document.qvf.MEDIA_TYPE = 'application/vnd.vibe-qc.qvf+zip'¶
QVF’s registered media type (the qvf repository’s spec/file-type).
- exception vibesketch.document.qvf.QvfError[source]¶
Bases:
ValueErrorA QVF that vibe-sketch cannot read, or cannot write.
Bases:
QvfErrorqvf-writer is not installed, or is older than the supported toolkit release.
- Parameters:
found (str)
- Return type:
None
- vibesketch.document.qvf.from_qvf(data)[source]¶
The document a QVF archive holds; raises
QvfError.A job container gives back its result too (
Derivation.result, the module docstring says what it holds).- Parameters:
data (bytes)
- Return type:
- vibesketch.document.qvf.job_container(document, job, *, preview=True)[source]¶
A pending QVF job container for one vibe-qc job: what
vibeqc runexecutes.The archive holds the job’s species as its one
structure(the first conformer, with its identity), onejob.specinrun_job’s names (thevibeqcwriter’s translation, which refuses what it cannot express), the wholedocumentin thex_vibesketch.documentvendor section, a preview of the scheme, andprovenance.run_status: "pending". The runner updates the same file in place and keeps the vendor section, so the result opens back with its drawing (from_qvf()).documentshould already listjob, so the result names it. RaisesKeyErrorfor an unknown species,QvfErrorfor one without a conformer, the writer’sWriterRefusalfor a specification it cannot express, andQvfUnavailablewithout qvf-writer.
- vibesketch.document.qvf.overwrite_refusal(data)[source]¶
Why replacing this archive would lose data, or
Nonefor a native sketch.Results are imported as structures, not retained as opaque payloads. Only archives reproducible from their stored sketch may be overwritten. Preview images are allowed to change; calculation data, additional metadata and unknown members require Save As. Invalid archives fail closed too.
- vibesketch.document.qvf.qvf_available()[source]¶
Whether qvf-writer is installed, so QVF can be read and written.
- Return type:
- vibesketch.document.qvf.species_qvf(document, species_id, *, document_id=None)[source]¶
One species as a QVF of its own: one structure with its identity.
This is the file a 3D viewer opens. The charge and multiplicity are on the structure section and, as the spec asks of a single structure, in
provenancetoo. RaisesKeyErrorfor an unknown species,QvfErrorfor one without a conformer.