snapred.backend.dao.request package

Submodules

snapred.backend.dao.request.CalibrationAssessmentRequest module

class snapred.backend.dao.request.CalibrationAssessmentRequest.CalibrationAssessmentRequest(*, run: ~snapred.backend.dao.RunConfig.RunConfig, useLiteMode: bool, focusGroup: ~snapred.backend.dao.state.FocusGroup.FocusGroup, calibrantSamplePath: str, workspaces: ~typing.Dict[~snapred.meta.mantid.WorkspaceNameGenerator.WorkspaceType, ~typing.List[~snapred.meta.mantid.WorkspaceNameGenerator.WorkspaceName]], peakFunction: ~snapred.meta.mantid.AllowedPeakTypes.PeakFunctionEnum, crystalDMin: float, crystalDMax: float, nBinsAcrossPeakWidth: int, fwhmMultipliers: ~snapred.backend.dao.Limit.Pair[float] = <factory>, maxChiSq: float = <factory>, combinedPixelMask: ~snapred.meta.mantid.WorkspaceNameGenerator.WorkspaceName | None = None)

Bases: BaseModel

The CalibrationAssessmentRequest class is crafted to streamline the process of initiating a calibration assessment for a specific run, set against standard crystal data typically provided through a cif file. It incorporates a run configuration, mapping various workspaces by their type to workspace names for analytical context, and specifies a focusGroup for targeted assessment. The calibrantSamplePath points to the sample data, while useLiteMode, nBinsAcrossPeakWidth, peakIntensityThreshold, and peakFunction define the assessment’s operational parameters, with defaults set according to system configurations.

calibrantSamplePath: str
combinedPixelMask: WorkspaceName | None
crystalDMax: float
crystalDMin: float
focusGroup: FocusGroup
fwhmMultipliers: Pair[float]
maxChiSq: float
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}

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

nBinsAcrossPeakWidth: int
peakFunction: PeakFunctionEnum
run: RunConfig
useLiteMode: bool
classmethod validate_fwhmMultipliers(v: Any) Pair[float]
workspaces: Dict[WorkspaceType, List[WorkspaceName]]

snapred.backend.dao.request.CalibrationExportRequest module

class snapred.backend.dao.request.CalibrationExportRequest.CalibrationExportRequest(*, createRecordRequest: CreateCalibrationRecordRequest)

Bases: BaseModel

The CalibrationExportRequest class facilitates the process of saving completed and satisfactorily assessed calibrations to disk. It acts as a conduit for passing the outcomes of the calibration assessment step back to the system, including both the calibrationRecord, which details the calibration process and parameters, and the calibrationIndexEntry, which indexes the calibration for reference.

createRecordRequest: CreateCalibrationRecordRequest
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

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

snapred.backend.dao.request.CalibrationIndexRequest module

class snapred.backend.dao.request.CalibrationIndexRequest.CalibrationIndexRequest(*, run: RunConfig)

Bases: BaseModel

The CalibrationIndexRequest class is designed to facilitate the retrieval of calibration records that match the instrument state of a specific run. By including a run configuration, it allows users to query calibration data relevant to the conditions and settings of a particular experimental run.

model_config: ClassVar[ConfigDict] = {}

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

run: RunConfig

snapred.backend.dao.request.CalibrationLoadAssessmentRequest module

class snapred.backend.dao.request.CalibrationLoadAssessmentRequest.CalibrationLoadAssessmentRequest(*, runId: str, version: int, useLiteMode: bool, checkExistent: bool)

Bases: BaseModel

The CalibrationLoadAssessmentRequest class is crafted to initiate the generation and loading of an assessment for a specified calibration version linked to a run’s instrument state. It specifies a runId and version to identify the calibration of interest, along with a checkExistent flag that, when true, avoids regenerating the assessment if it already exists.

checkExistent: bool
model_config: ClassVar[ConfigDict] = {}

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

runId: str
useLiteMode: bool
version: int

snapred.backend.dao.request.ClearWorkspacesRequest module

class snapred.backend.dao.request.ClearWorkspacesRequest.ClearWorkspacesRequest(*, exclude: List[str], clearCache: bool)

Bases: BaseModel

clearCache: bool
exclude: List[str]
model_config: ClassVar[ConfigDict] = {}

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

snapred.backend.dao.request.ListWorkspacesRequest module

class snapred.backend.dao.request.ListWorkspacesRequest.ListWorkspacesRequest(*, excludeCache: bool)

Bases: BaseModel

excludeCache: bool
model_config: ClassVar[ConfigDict] = {}

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

snapred.backend.dao.request.DiffractionCalibrationRequest module

class snapred.backend.dao.request.DiffractionCalibrationRequest.DiffractionCalibrationRequest(*, runNumber: str, calibrantSamplePath: str, focusGroup: ~snapred.backend.dao.state.FocusGroup.FocusGroup, useLiteMode: bool, crystalDMin: float = <factory>, crystalDMax: float = <factory>, peakFunction: ~snapred.meta.mantid.AllowedPeakTypes.SymmetricPeakEnum = <factory>, convergenceThreshold: float = <factory>, nBinsAcrossPeakWidth: int = <factory>, maximumOffset: float = <factory>, fwhmMultipliers: ~snapred.backend.dao.Limit.Pair[float] = <factory>, maxChiSq: float = <factory>, removeBackground: bool = False, pixelMasks: ~typing.List[~snapred.meta.mantid.WorkspaceNameGenerator.WorkspaceName] = [], combinedPixelMask: ~snapred.meta.mantid.WorkspaceNameGenerator.WorkspaceName | None = None, continueFlags: ~snapred.backend.error.ContinueWarning.ContinueWarning.Type | None = <Type.UNSET: 0>, startingTableVersion: int | ~snapred.backend.dao.indexing.Versioning.VersionState = VersionState.DEFAULT)

Bases: BaseModel

The DiffractionCalibrationRequest class is designed to kick-start the calibration process for a specific run by comparing it against known crystallographic data from a cif file. It includes the runNumber, calibrantSamplePath, and the focusGroup involved, alongside settings like useLiteMode for simplified processing and a series of calibration parameters such as crystalDMin, crystalDMax, peakFunction, and thresholds for convergence and peak intensity. These parameters are pre-configured with default values from the system’s configuration, ensuring a consistent and precise approach to diffraction calibration.

calibrantSamplePath: str
combinedPixelMask: WorkspaceName | None
continueFlags: Type | None
convergenceThreshold: float
crystalDMax: float
crystalDMin: float
focusGroup: FocusGroup
fwhmMultipliers: Pair[float]
maxChiSq: float
maximumOffset: float
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}

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

nBinsAcrossPeakWidth: int
peakFunction: SymmetricPeakEnum
pixelMasks: List[WorkspaceName]
removeBackground: bool
runNumber: str
startingTableVersion: int | VersionState
useLiteMode: bool
classmethod validate_fwhmMultipliers(v: Any) Pair[float]

snapred.backend.dao.request.FarmFreshIngredients module

class snapred.backend.dao.request.FarmFreshIngredients.FarmFreshIngredients(*, runNumber: str, versions: ~snapred.backend.dao.request.FarmFreshIngredients.Versions = (VersionState.LATEST, VersionState.LATEST), useLiteMode: bool, timestamp: float | None = None, cifPath: str | None = None, calibrantSamplePath: str | None = None, keepUnfocused: bool | None = None, convertUnitsTo: str | None = None, convergenceThreshold: float = <factory>, nBinsAcrossPeakWidth: int = <factory>, peakIntensityThreshold: float | None = None, peakFunction: ~snapred.meta.mantid.AllowedPeakTypes.SymmetricPeakEnum = <factory>, maxOffset: float = <factory>, crystalDBounds: ~snapred.backend.dao.Limit.Limit[float] = <factory>, fwhmMultipliers: ~snapred.backend.dao.Limit.Pair[float] = <factory>, maxChiSq: float | None = <factory>, focusGroups: ~typing.List[~snapred.backend.dao.state.FocusGroup.FocusGroup] | None = None, state: str | None = None)

Bases: BaseModel

from these, the Sous Chef can make everything

calibrantSamplePath: str | None
cifPath: str | None
convergenceThreshold: float
convertUnitsTo: str | None
crystalDBounds: Limit[float]
property focusGroup: FocusGroup
focusGroups: List[FocusGroup] | None
fwhmMultipliers: Pair[float]
keepUnfocused: bool | None
maxChiSq: float | None
maxOffset: float
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'validate_assignment': True}

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

nBinsAcrossPeakWidth: int
peakFunction: SymmetricPeakEnum
peakIntensityThreshold: float | None
runNumber: str
state: str | None
timestamp: float | None
useLiteMode: bool
classmethod validate_crystalDBounds(v: Any) Limit[float]
classmethod validate_focusGroups(v: Any)
classmethod validate_fwhmMultipliers(v: Any) Pair[float]
classmethod validate_versions(v) Versions
property version: int | VersionState
versions: Versions
class snapred.backend.dao.request.FarmFreshIngredients.Versions(calibration, normalization)

Bases: tuple

calibration: int | VersionState

Alias for field number 0

normalization: int | VersionState

Alias for field number 1

snapred.backend.dao.request.FocusSpectraRequest module

class snapred.backend.dao.request.FocusSpectraRequest.FocusSpectraRequest(*, runNumber: str, useLiteMode: bool, focusGroup: FocusGroup, preserveEvents: bool, inputWorkspace: str, groupingWorkspace: str, maskWorkspace: WorkspaceName | None = None, outputWorkspace: WorkspaceName | None = None)

Bases: BaseModel

focusGroup: FocusGroup
groupingWorkspace: str
inputWorkspace: str
maskWorkspace: WorkspaceName | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

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

outputWorkspace: WorkspaceName | None
preserveEvents: bool
runNumber: str
useLiteMode: bool

snapred.backend.dao.request.InitializeStateRequest module

class snapred.backend.dao.request.InitializeStateRequest.InitializeStateRequest(*, runId: str, humanReadableName: str, useLiteMode: bool)

Bases: BaseModel

humanReadableName: str
model_config: ClassVar[ConfigDict] = {}

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

runId: str
useLiteMode: bool

snapred.backend.dao.request.NormalizationRequest module

class snapred.backend.dao.request.NormalizationRequest.NormalizationRequest(*, runNumber: str, backgroundRunNumber: str, useLiteMode: bool, focusGroup: ~snapred.backend.dao.state.FocusGroup.FocusGroup, calibrantSamplePath: str, smoothingParameter: float = <factory>, crystalDBounds: ~snapred.backend.dao.Limit.Limit[float] = <factory>, nBinsAcrossPeakWidth: int = <factory>, fwhmMultipliers: ~snapred.backend.dao.Limit.Pair[float] = <factory>, continueFlags: ~snapred.backend.error.ContinueWarning.ContinueWarning.Type | None = <Type.UNSET: 0>, correctedVanadiumWs: ~snapred.meta.mantid.WorkspaceNameGenerator.WorkspaceName | None = None)

Bases: BaseModel

This class encapsulates all the necessary parameters to request a normalization process, including default values from application.yml for ease of use and consistency across runs. It is designed to provide a comprehensive and customizable framework for requesting normalization calibrations, facilitating precise and tailored calibration processes.

backgroundRunNumber: str
calibrantSamplePath: str
continueFlags: Type | None
correctedVanadiumWs: WorkspaceName | None
crystalDBounds: Limit[float]
focusGroup: FocusGroup
fwhmMultipliers: Pair[float]
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid'}

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

nBinsAcrossPeakWidth: int
runNumber: str
smoothingParameter: float
useLiteMode: bool

snapred.backend.dao.request.NormalizationExportRequest module

class snapred.backend.dao.request.NormalizationExportRequest.NormalizationExportRequest(*, createIndexEntryRequest: CreateIndexEntryRequest, createRecordRequest: CreateNormalizationRecordRequest)

Bases: BaseModel

This class is utilized to encapsulate the necessary data for saving a completed normalization process to disk, following a satisfactory assessment by the user. It packages both the comprehensive details of the normalization process and its contextual metadata, ensuring that significant normalization efforts are archived in a structured and accessible manner. This approach facilitates not only the preservation of critical scientific data but also supports data governance, compliance, and reproducibility within the research workflow.

createIndexEntryRequest: CreateIndexEntryRequest
createRecordRequest: CreateNormalizationRecordRequest
model_config: ClassVar[ConfigDict] = {}

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

same_version()

snapred.backend.dao.request.OverrideRequest module

class snapred.backend.dao.request.OverrideRequest.OverrideRequest(*, calibrantSamplePath: str)

Bases: BaseModel

calibrantSamplePath: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

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

snapred.backend.dao.request.RenameWorkspaceRequest module

class snapred.backend.dao.request.RenameWorkspaceRequest.RenameWorkspaceRequest(*, oldName: str, newName: str)

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}

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

newName: str
oldName: str

snapred.backend.dao.request.RenameWorkspacesFromTemplateRequest module

class snapred.backend.dao.request.RenameWorkspacesFromTemplateRequest.RenameWorkspacesFromTemplateRequest(*, workspaces: List[WorkspaceName], renameTemplate: str)

Bases: BaseModel

Rename a list of workspaces according to a template. The template must be a formattable string with a placeholder labeled workspaceName. In the new workspace names, the old workspace name will appear at this label.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

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

renameTemplate: str
classmethod renameTemplate_has_workspaceName(v: str) str
workspaces: List[WorkspaceName]

snapred.backend.dao.request.SmoothDataExcludingPeaksRequest module

class snapred.backend.dao.request.SmoothDataExcludingPeaksRequest.SmoothDataExcludingPeaksRequest(*, runNumber: str, useLiteMode: bool, focusGroup: ~snapred.backend.dao.state.FocusGroup.FocusGroup, calibrantSamplePath: str, inputWorkspace: str, outputWorkspace: str, smoothingParameter: float = <factory>, crystalDMin: float = <factory>, crystalDMax: float = <factory>)

Bases: BaseModel

This class encapsulates all necessary parameters for a request to smooth data while excluding peaks, including default values from configuration for ease of use and consistency across runs. It offers a comprehensive framework for specifying the details of a data smoothing operation, ensuring that significant data features are preserved while reducing noise.

calibrantSamplePath: str
crystalDMax: float
crystalDMin: float
focusGroup: FocusGroup
inputWorkspace: str
model_config: ClassVar[ConfigDict] = {}

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

outputWorkspace: str
runNumber: str
smoothingParameter: float
useLiteMode: bool

snapred.backend.dao.request.VanadiumCorrectionRequest module

class snapred.backend.dao.request.VanadiumCorrectionRequest.VanadiumCorrectionRequest(*, runNumber: str, useLiteMode: bool, focusGroup: ~snapred.backend.dao.state.FocusGroup.FocusGroup, calibrantSamplePath: str, inputWorkspace: str, backgroundWorkspace: str, outputWorkspace: str, crystalDMin: float = <factory>, crystalDMax: float = <factory>)

Bases: BaseModel

backgroundWorkspace: str
calibrantSamplePath: str
crystalDMax: float
crystalDMin: float
focusGroup: FocusGroup
inputWorkspace: str
model_config: ClassVar[ConfigDict] = {}

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

outputWorkspace: str
runNumber: str
useLiteMode: bool

Module contents