vibesketch.document.model¶
The vibe-sketch document, schema version 1.
A .vsk file is one JSON object. It carries the canvas state verbatim, in
the engine’s own format (KET), so a drawing survives a round trip without
loss, and a normalized layer the compute side reads: species with their
identifiers, charge, multiplicity and 3D conformers; reactions with roles,
arrows and conditions; program-neutral job specifications; the figure style;
and provenance. The design is roadmap section 3.1; docs/document.md
describes every field.
The model is strict. Unknown fields are refused rather than ignored, and the
cross-references (a reaction’s species, a job’s species) must resolve, so an
agent that writes a document gets told what is wrong instead of having its
data silently dropped. schema/vibe-sketch-1.schema.json is generated from
these classes (vibe-sketch schema) and must not be edited by hand.
Module Attributes
The value of a version-1 document's |
|
The arrows a reaction can carry (roadmap WP 3.1). |
|
the structure only. |
Classes
|
The drawing as the canvas engine stores it, embedded verbatim. |
|
One 3D structure of a species: element symbols and Cartesian coordinates. |
|
A coordinate an optimisation holds fixed. |
|
A vibe-sketch document, schema version 1. |
|
One revision of the document: who changed it, through what, and why. |
|
A calculation to run on one species with one program. |
|
A program-neutral description of a calculation. |
|
A name for a species, with where it came from and how sure it is. |
|
Where the document came from. |
|
One step of a scheme: who reacts, under which conditions, to give what. |
|
What a job may use on the machine that runs it. |
|
One submission of a job to a queue. |
|
An implicit solvation model and the solvent it describes. |
|
A molecule or ion that appears in the drawing. |
|
How exported figures look. |
- vibesketch.document.model.SCHEMA_ID: Final = 'vibe-sketch/1'¶
The value of a version-1 document’s
schemafield.
- vibesketch.document.model.Arrow¶
The arrows a reaction can carry (roadmap WP 3.1).
alias of
Literal[‘forward’, ‘equilibrium’, ‘retrosynthetic’, ‘resonance’]
- class vibesketch.document.model.Canvas(*, format, data=<factory>)¶
Bases:
_StrictThe drawing as the canvas engine stores it, embedded verbatim.
- format: Literal['ket']¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Conformer(*, method, symbols, xyz_angstrom)¶
Bases:
_StrictOne 3D structure of a species: element symbols and Cartesian coordinates.
- Parameters:
- method: _Token¶
- electron_count(charge)¶
Electrons in the neutral atoms, less the charge.
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Constraint(*, kind, atoms, value=None)¶
Bases:
_StrictA coordinate an optimisation holds fixed.
Atoms are 0-based indices into the species’ conformer: the drawing’s atoms first, then the hydrogens.
- Parameters:
- kind: Literal['distance', 'angle', 'dihedral', 'position']¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Document(*, schema='vibe-sketch/1', revision=0, canvas=<factory>, species=<factory>, reactions=<factory>, jobs=<factory>, style=<factory>, provenance)¶
Bases:
_StrictA vibe-sketch document, schema version 1.
- Parameters:
- model_config = {'extra': 'forbid', 'json_schema_extra': {'description': 'A .vsk file: a drawing and what to compute from it.'}, 'populate_by_name': True, 'title': 'vibe-sketch document', 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- schema_id: Literal['vibe-sketch/1']¶
- provenance: Provenance¶
- species_by_id(identifier)¶
The species with
identifier; raisesKeyErrorwhen there is none.
- job_by_id(identifier)¶
The job with
identifier; raisesKeyErrorwhen there is none.
- class vibesketch.document.model.Edit(*, revision, at, actor, client=None, summary)¶
Bases:
_StrictOne revision of the document: who changed it, through what, and why.
- Parameters:
at (AwareDatetime)
actor (Literal['human', 'agent', 'system'])
client (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[a-z0-9][a-z0-9_.:+-]{0,63}$, ascii_only=None)] | None)
summary (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=500, pattern=None, ascii_only=None)])
- at: AwareDatetime¶
- actor: Literal['human', 'agent', 'system']¶
- summary: _Text¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Job(*, id, species, program, spec, runs=None)¶
Bases:
_StrictA calculation to run on one species with one program.
- Parameters:
id (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_-]{0,63}$, ascii_only=None)])
species (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_-]{0,63}$, ascii_only=None)])
program (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[a-z0-9][a-z0-9_.:+-]{0,63}$, ascii_only=None)])
spec (JobSpec)
- id: _Identifier¶
- species: _Identifier¶
- program: _Token¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.JobSpec(*, task, method=None, basis=None, aux_basis=None, approximation=None, dispersion=None, solvent=None, states=None, constraints=None, resources=None)¶
Bases:
_StrictA program-neutral description of a calculation.
Writers translate it into one program’s input and refuse, with a reason, whatever they cannot express (AGENTS.md, ground rule 5). The model only checks that the specification is consistent in itself.
- Parameters:
task (Literal['geometry', 'sp', 'opt', 'freq', 'opt+freq', 'tddft', 'nmr'])
method (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z0-9][A-Za-z0-9()+*/,_.-]{0,63}$, ascii_only=None)] | None)
basis (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z0-9][A-Za-z0-9()+*/_.-]{0,63}$, ascii_only=None)] | None)
aux_basis (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z0-9][A-Za-z0-9()+*/_.-]{0,63}$, ascii_only=None)] | None)
approximation (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z0-9][A-Za-z0-9()_-]{0,31}$, ascii_only=None)] | None)
dispersion (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z0-9][A-Za-z0-9()_-]{0,31}$, ascii_only=None)] | None)
solvent (Solvent | None)
constraints (list[Constraint] | None)
resources (Resources | None)
- constraints: list[Constraint] | None¶
- static calculation_fields()¶
The fields that only mean something for a calculation.
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Name(*, value, source, confidence)¶
Bases:
_StrictA name for a species, with where it came from and how sure it is.
- Parameters:
value (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=500, pattern=None, ascii_only=None)])
source (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[a-z0-9][a-z0-9_.:+-]{0,63}$, ascii_only=None)])
confidence (Literal['high', 'medium', 'low'])
- value: _Text¶
- source: _Token¶
- confidence: Literal['high', 'medium', 'low']¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Provenance(*, app, created=<factory>, edits=<factory>)¶
Bases:
_StrictWhere the document came from.
- Parameters:
- app: _Text¶
- created: AwareDatetime¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Reaction(*, id, reactants, reagents=<factory>, products, arrow='forward', conditions=<factory>, yield_=None)¶
Bases:
_StrictOne step of a scheme: who reacts, under which conditions, to give what.
- Parameters:
id (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_-]{0,63}$, ascii_only=None)])
reactants (Annotated[list[Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_-]{0,63}$, ascii_only=None)]], MinLen(min_length=1)])
reagents (list[Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_-]{0,63}$, ascii_only=None)]])
products (Annotated[list[Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_-]{0,63}$, ascii_only=None)]], MinLen(min_length=1)])
arrow (Literal['forward', 'equilibrium', 'retrosynthetic', 'resonance'])
conditions (list[Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=500, pattern=None, ascii_only=None)]])
yield_ (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=500, pattern=None, ascii_only=None)] | None)
- id: _Identifier¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Resources(*, nprocs=1, maxcore_mb=None)¶
Bases:
_StrictWhat a job may use on the machine that runs it.
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Run(*, queue='vibe-queue', host='localhost', id, submitted)¶
Bases:
_StrictOne submission of a job to a queue.
- Parameters:
queue (Literal['vibe-queue'])
host (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$, ascii_only=None)])
id (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z0-9_-]{1,64}$, ascii_only=None)])
submitted (AwareDatetime)
- queue: Literal['vibe-queue']¶
- submitted: AwareDatetime¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Solvent(*, model, name)¶
Bases:
_StrictAn implicit solvation model and the solvent it describes.
- Parameters:
- model: Literal['CPCM', 'SMD']¶
- name: _SolventName¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Species(*, id, label=None, smiles=None, inchikey=None, charge=0, multiplicity=1, name=None, conformers=<factory>)¶
Bases:
_StrictA molecule or ion that appears in the drawing.
- Parameters:
id (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Za-z][A-Za-z0-9_-]{0,63}$, ascii_only=None)])
label (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=1, max_length=500, pattern=None, ascii_only=None)] | None)
smiles (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^\S+$, ascii_only=None)] | None)
inchikey (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[A-Z]{14}-[A-Z]{10}-[A-Z]$, ascii_only=None)] | None)
charge (int)
name (Name | None)
- id: _Identifier¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class vibesketch.document.model.Style(*, preset='acs-1996')¶
Bases:
_StrictHow exported figures look.
- Parameters:
preset (Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern=^[a-z0-9][a-z0-9_.:+-]{0,63}$, ascii_only=None)])
- preset: _Token¶
- model_config = {'extra': 'forbid', 'populate_by_name': True, 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].