mxcubeweb.core.adapter.beamline_action_adapter#

Classes

Action(*, name, username, state, arguments, ...)

ActionsList(*, actions_list)

Argument(*, name, type[, items])

BeamlineActionAdapter(ho, role, app[, ...])

JSONSchemaArgument(*, name, type[, jsonschema])

class mxcubeweb.core.adapter.beamline_action_adapter.Action(*, name: str, username: str, state: int, arguments: list[mxcubeweb.core.adapter.beamline_action_adapter.JSONSchemaArgument | mxcubeweb.core.adapter.beamline_action_adapter.Argument], argument_type: str, messages: list[str], type: str, data: str | dict | None)[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'argument_type': FieldInfo(annotation=str, required=True), 'arguments': FieldInfo(annotation=list[Union[JSONSchemaArgument, Argument]], required=True), 'data': FieldInfo(annotation=Union[str, dict, NoneType], required=True), 'messages': FieldInfo(annotation=list[str], required=True), 'name': FieldInfo(annotation=str, required=True), 'state': FieldInfo(annotation=int, required=True), 'type': FieldInfo(annotation=str, required=True), 'username': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.adapter.beamline_action_adapter.ActionsList(*, actions_list: list[mxcubeweb.core.adapter.beamline_action_adapter.Action])[source]#

Bases: BaseModel

Parameters:

actions_list (list[mxcubeweb.core.adapter.beamline_action_adapter.Action]) –

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'actions_list': FieldInfo(annotation=list[Action], required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.adapter.beamline_action_adapter.Argument(*, name: str, type: str, items: list[str] | None = None)[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'items': FieldInfo(annotation=Union[list[str], NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True), 'type': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubeweb.core.adapter.beamline_action_adapter.BeamlineActionAdapter(ho: HardwareObject, role: str, app, resource_handler_config: ResourceHandlerConfigModel = ResourceHandlerConfigModel(url_prefix='', name=None, exports=[], commands=['stop', 'run_action'], attributes=['data', 'get_all_actions']))[source]#

Bases: AdapterBase

Parameters:
msg()[source]#

Return a message describing the current state.

Should be used to communicate details of the state to the user.

Returns:

The message string.

Return type:

(str)

run_action(value: BeamlineActionInputModel)[source]#

Start beamline action.

Parameters:

value (BeamlineActionInputModel) –

stop()[source]#

Stop the execution.

class mxcubeweb.core.adapter.beamline_action_adapter.JSONSchemaArgument(*, name: str, type: str, jsonschema: str = '', signature: list[str])[source]#

Bases: BaseModel

Parameters:
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

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

model_fields: ClassVar[dict[str, FieldInfo]] = {'jsonschema': FieldInfo(annotation=str, required=False, default=''), 'name': FieldInfo(annotation=str, required=True), 'signature': FieldInfo(annotation=list[str], required=True), 'type': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.