vibe-sketcherDocumentation

vibesketcher.server.diffraction

REST routes for powder diffraction planning and overlays (#207).

Every route reads; none changes a document. A calculated pattern comes from a document’s periodic structure or from posted CIF text; a measured pattern is posted as text or base64 bytes with its file name and stated axis, and its provenance (SHA-256 of the posted bytes, axis, wavelength, instrument fields as given) is returned with the points and printed on the overlay.

Functions

router(store)

Classes

CifPatternRequest(*, cif[, settings, block, ...])

FigureRequest(*[, structure, cif, block, ...])

MeasuredRequest(*, filename[, text, ...])

A measured file: text or data_base64 (the original bytes), and its name.

PatternRequest(*, structure[, settings])

class vibesketcher.server.diffraction.PatternRequest(*, structure, settings=<factory>)[source]

Bases: BaseModel

Parameters:
model_config = {'extra': 'forbid'}

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

structure: str
settings: dict[str, Any]
class vibesketcher.server.diffraction.CifPatternRequest(*, cif, settings=<factory>, block=None, setting=None)[source]

Bases: BaseModel

Parameters:
model_config = {'extra': 'forbid'}

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

cif: str
settings: dict[str, Any]
block: str | None
setting: str | None
class vibesketcher.server.diffraction.MeasuredRequest(*, filename, text=None, data_base64=None, settings, points=True)[source]

Bases: BaseModel

A measured file: text or data_base64 (the original bytes), and its name.

Parameters:
model_config = {'extra': 'forbid'}

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

filename: str
text: str | None
data_base64: str | None
settings: dict[str, Any]
points: bool
class vibesketcher.server.diffraction.FigureRequest(*, structure=None, cif=None, block=None, setting=None, settings=<factory>, measured=None, options=<factory>, format='svg', dpi=300)[source]

Bases: BaseModel

Parameters:
model_config = {'extra': 'forbid'}

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

structure: str | None
cif: str | None
block: str | None
setting: str | None
settings: dict[str, Any]
measured: MeasuredRequest | None
options: dict[str, Any]
format: Literal['svg', 'pdf', 'png']
dpi: int
vibesketcher.server.diffraction.router(store)[source]
Parameters:

store (Store)

Return type:

APIRouter