Source code for event_model.documents.run_start

# ruff: noqa
# generated by datamodel-codegen:
#   filename:  run_start.json

from __future__ import annotations

from typing import Any, Literal, TypeAlias, TypedDict

from typing_extensions import NotRequired


[docs] class Hints(TypedDict): """ Start-level hints """ dimensions: NotRequired[list[list[list[str] | str]]] """ The independent axes of the experiment. Ordered slow to fast """
class Calculation(TypedDict): args: NotRequired[list[Any]] callable: str """ callable function to perform calculation """ kwargs: NotRequired[dict[str, Any]] """ kwargs for calcalation callable """ class ConfigurationProjection(TypedDict): config_device: str config_index: int field: str location: Literal["configuration"] """ Projection comes from configuration fields in the event_descriptor document """ stream: str type: Literal["linked"] """ Projection is of type linked, a value linked from the data set. """ DataType: TypeAlias = dict[str, "DataType"] class LinkedEventProjection(TypedDict): field: str location: Literal["event"] """ Projection comes and event """ stream: str type: Literal["linked"] """ Projection is of type linked, a value linked from the data set. """ class StaticProjection(TypedDict): type: Literal["static"] """ Projection is of type static, a value defined here in the projection """ value: Any """ value explicitely defined in the static projection """ class CalculatedEventProjection(TypedDict): calculation: Calculation """ required fields if type is calculated """ field: str location: Literal["event"] """ Projection comes and event """ stream: str type: Literal["calculated"] """ Projection is of type calculated, a value that requires calculation. """
[docs] class Projections(TypedDict): """ Describe how to interperet this run as the given projection """ configuration: dict[str, Any] """ Static information about projection """ name: NotRequired[str] """ The name of the projection """ projection: dict[ str, ConfigurationProjection | LinkedEventProjection | CalculatedEventProjection | StaticProjection, ] version: str """ The version of the projection spec. Can specify the version of an external specification. """
[docs] class RunStart(TypedDict): """ Document created at the start of run. Provides a seach target and later documents link to it """ data_groups: NotRequired[list[str]] """ An optional list of data access groups that have meaning to some external system. Examples might include facility, beamline, end stations, proposal, safety form. """ data_session: NotRequired[str] """ An optional field for grouping runs. The meaning is not mandated, but this is a data management grouping and not a scientific grouping. It is intended to group runs in a visit or set of trials. """ data_type: NotRequired[DataType] group: NotRequired[str] """ Unix group to associate this data with """ hints: NotRequired[Hints] owner: NotRequired[str] """ Unix owner to associate this data with """ project: NotRequired[str] """ Name of project that this run is part of """ projections: NotRequired[list[Projections]] sample: NotRequired[dict[str, Any] | str] """ Information about the sample, may be a UID to another collection """ scan_id: NotRequired[int] """ Scan ID number, not globally unique """ time: float """ Time the run started. Unix epoch time """ uid: str """ Globally unique ID for this run """