mxcubecore.model.lims_session#
Classes
|
Represents a downloadable file with metadata used to match pipeline references. |
|
Represents a beamline. |
|
Represents an investigation and serves as a proposal to replace the Session class. |
|
Represents a LIMS system. |
|
Manages LIMS sessions and connected users. |
|
Represents a user connected to MXCuBE. |
|
Metadata containing pagination details. |
|
Pagination metadata. |
|
Represents a generic parameter attached to entities like investigations, samples, or datasets. |
|
Proposal with key identifying details. |
|
Represents a resource, usually a file associated with a sample or |
|
Parameters metadata related to a sample, including a list of associated resources. |
|
Represents a description of a sample sheet as defined in user portals. |
|
Represents an experiment in a specific time slot on a beamline for a proposal. |
- class mxcubecore.model.lims_session.Download(*, path: str, filename: str, groupName: str | None = None)[source]#
Bases:
BaseModelRepresents a downloadable file with metadata used to match pipeline references.
- 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]] = {'filename': FieldInfo(annotation=str, required=True, description="Name of the file (e.g., 'example.hkl')"), 'groupName': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description="Group name used for model matching (e.g., 'Group1')"), 'path': FieldInfo(annotation=str, required=True, description='Full path to the file on disk')}#
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 mxcubecore.model.lims_session.Instrument(*, name: str, id: int, instrumentScientists: List[Any])[source]#
Bases:
BaseModelRepresents a beamline.
- 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]] = {'id': FieldInfo(annotation=int, required=True), 'instrumentScientists': FieldInfo(annotation=List[Any], required=True), 'name': 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 mxcubecore.model.lims_session.Investigation(*, name: str, startDate: datetime, endDate: datetime, id: int, title: str, visitId: str, summary: str | None = '', parameters: Dict[str, Any], instrument: Instrument, investigationUsers: List[Any])[source]#
Bases:
BaseModelRepresents an investigation and serves as a proposal to replace the Session class.
- Parameters:
name (str) – Name of the investigation.
startDate (datetime) – Start date of the investigation.
endDate (datetime) – End date of the investigation.
id (int) – Unique identifier of the investigation.
title (str) – Title of the investigation.
visitId (str) – Identifier for the visit associated with the investigation.
summary (str | None) – Summary description of the investigation.
parameters (Dict[str, Any]) – Dictionary of investigation-specific parameters.
instrument (Instrument) – Associated instrument for the investigation.
investigationUsers (List[Any]) – List of users involved in the investigation.
- 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]] = {'endDate': FieldInfo(annotation=datetime, required=True), 'id': FieldInfo(annotation=int, required=True), 'instrument': FieldInfo(annotation=Instrument, required=True), 'investigationUsers': FieldInfo(annotation=List[Any], required=True), 'name': FieldInfo(annotation=str, required=True), 'parameters': FieldInfo(annotation=Dict[str, Any], required=True), 'startDate': FieldInfo(annotation=datetime, required=True), 'summary': FieldInfo(annotation=Union[str, NoneType], required=False, default=''), 'title': FieldInfo(annotation=str, required=True), 'visitId': 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 mxcubecore.model.lims_session.Lims(*, name: str = '', description: str = '')[source]#
Bases:
BaseModelRepresents a LIMS system.
- 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]] = {'description': FieldInfo(annotation=str, required=False, default=''), 'name': FieldInfo(annotation=str, required=False, default='')}#
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 mxcubecore.model.lims_session.LimsSessionManager(*, active_session: Session | None = None, sessions: List[Session] | None = [], users: Dict[str, LimsUser] | None = {})[source]#
Bases:
BaseModelManages LIMS sessions and connected users.
- 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]] = {'active_session': FieldInfo(annotation=Union[Session, NoneType], required=False, default=None), 'sessions': FieldInfo(annotation=Union[List[Session], NoneType], required=False, default=[]), 'users': FieldInfo(annotation=Union[Dict[str, LimsUser], NoneType], required=False, default={})}#
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 mxcubecore.model.lims_session.LimsUser(*, user_name: str = '', sessions: List[Session] | None = [])[source]#
Bases:
BaseModelRepresents a user connected to MXCuBE.
- 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]] = {'sessions': FieldInfo(annotation=Union[List[Session], NoneType], required=False, default=[]), 'user_name': FieldInfo(annotation=str, required=False, default='')}#
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 mxcubecore.model.lims_session.Meta(*, page: MetaPage)[source]#
Bases:
BaseModelMetadata containing pagination details.
- Parameters:
page (MetaPage) – Pagination details.
- 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].
- class mxcubecore.model.lims_session.MetaPage(*, totalWithoutFilters: int, total: int, totalPages: int, currentPage: int)[source]#
Bases:
BaseModelPagination metadata.
- 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]] = {'currentPage': FieldInfo(annotation=int, required=True), 'total': FieldInfo(annotation=int, required=True), 'totalPages': FieldInfo(annotation=int, required=True), 'totalWithoutFilters': FieldInfo(annotation=int, 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 mxcubecore.model.lims_session.Parameter(*, name: str, value: str, id: int, units: str)[source]#
Bases:
BaseModelRepresents a generic parameter attached to entities like investigations, samples, or datasets.
- 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]] = {'id': FieldInfo(annotation=int, required=True), 'name': FieldInfo(annotation=str, required=True), 'units': FieldInfo(annotation=str, required=True), 'value': 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 mxcubecore.model.lims_session.Proposal(*, proposal_id: str = '', person_id: str = '', type: str = '', code: str = '', number: str = '', title: str = '')[source]#
Bases:
BaseModelProposal with key identifying details.
- Parameters:
proposal_id (str) – Unique identifier for the proposal.
person_id (str) – Identifier of the person associated.
type (str) – Type/category of the proposal (e.g., “MX”).
code (str) – Specific code associated with the proposal e.g., “IH-LS”.
number (str) – Proposal number; may be sequential or unique (uniqueness may depend on the combination of code and number)
title (str) – Title of the proposal
- 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]] = {'code': FieldInfo(annotation=str, required=False, default=''), 'number': FieldInfo(annotation=str, required=False, default=''), 'person_id': FieldInfo(annotation=str, required=False, default=''), 'proposal_id': FieldInfo(annotation=str, required=False, default=''), 'title': FieldInfo(annotation=str, required=False, default=''), 'type': FieldInfo(annotation=str, required=False, default='')}#
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 mxcubecore.model.lims_session.Resource(*, _id: str, filename: str, file: str, fileType: str, createdAt: datetime, updatedAt: datetime, groupName: str | None = None)[source]#
Bases:
BaseModel- Represents a resource, usually a file associated with a sample or
investigation.
- Parameters:
id (str) – The unique identifier for the resource. The key “_id” is used in JSON and mapped to “id” in the class.
filename (str) – The name of the file associated with the resource.
file (str) – The URL or path pointing to the actual file or resource content.
fileType (str) – The type of the file (e.g., “pdb”, “hkl”, etc.).
createdAt (datetime) – The timestamp representing when the resource was created.
updatedAt (datetime) – The timestamp representing when the resource was last updated.
groupName (Optional[str]) – The optional group name associated with the resource (default is None).
_id (str) –
- 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]] = {'createdAt': FieldInfo(annotation=datetime, required=True), 'file': FieldInfo(annotation=str, required=True), 'fileType': FieldInfo(annotation=str, required=True), 'filename': FieldInfo(annotation=str, required=True), 'groupName': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'id': FieldInfo(annotation=str, required=True, alias='_id', alias_priority=2), 'updatedAt': FieldInfo(annotation=datetime, 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 mxcubecore.model.lims_session.SampleInformation(*, _id: str, investigationId: int, sampleId: int, createdAt: datetime, updatedAt: datetime, resources: List[Resource])[source]#
Bases:
BaseModelParameters metadata related to a sample, including a list of associated resources.
- Parameters:
id (str) – The unique identifier for the sample. The key “_id” is used in JSON and mapped to “id” in the class.
investigationId (int) – The unique identifier of the investigation this sample is associated with.
sampleId (int) – The unique identifier for the sample in ICAT. Most of the cases this represents the protein itself
createdAt (datetime) – The timestamp representing when the sample information was created.
updatedAt (datetime) – The timestamp representing when the sample information was last updated.
resources (List[Resource]) – A list of Resource objects associated with this sample information.
_id (str) –
- 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]] = {'createdAt': FieldInfo(annotation=datetime, required=True), 'id': FieldInfo(annotation=str, required=True, alias='_id', alias_priority=2), 'investigationId': FieldInfo(annotation=int, required=True), 'resources': FieldInfo(annotation=List[Resource], required=True), 'sampleId': FieldInfo(annotation=int, required=True), 'updatedAt': FieldInfo(annotation=datetime, 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 mxcubecore.model.lims_session.SampleSheet(*, id: int, name: str, investigation: Investigation, modTime: datetime, parameters: List[Parameter], datasets: List[Any], meta: Meta)[source]#
Bases:
BaseModelRepresents a description of a sample sheet as defined in user portals.
- Parameters:
id (int) – Unique identifier for the sample sheet.
name (str) – Name of the sample sheet, often corresponding to the protein’s name.
investigation (Investigation) – Investigation associated with the sample sheet.
modTime (datetime) – Last modification time of the sample sheet.
parameters (List[Parameter]) – Generic list of parameters, dependent on the user portal.
datasets (List[Any]) – List of datasets collected for this sample.
meta (Meta) – Pagination metadata.
- 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]] = {'datasets': FieldInfo(annotation=List[Any], required=True), 'id': FieldInfo(annotation=int, required=True), 'investigation': FieldInfo(annotation=Investigation, required=True), 'meta': FieldInfo(annotation=Meta, required=True), 'modTime': FieldInfo(annotation=datetime, required=True), 'name': FieldInfo(annotation=str, required=True), 'parameters': FieldInfo(annotation=List[Parameter], 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 mxcubecore.model.lims_session.Session(*, session_id: str = '', beamline_name: str = '', start_date: str = '', start_time: str = '', end_date: str = '', end_time: str = '', title: str = '', code: str = '', number: str = '', proposal_id: str = '', proposal_name: str = '', comments: str | None = '', start_datetime: datetime = None, end_datetime: datetime | None = None, actual_start_date: str = '', actual_start_time: str = '', actual_end_date: str = '', actual_end_time: str = '', nb_shifts: str = '', scheduled: str = '', is_rescheduled: bool = False, is_scheduled_beamline: bool = False, is_scheduled_time: bool = False, user_portal_URL: str | None = None, data_portal_URL: str | None = None, logbook_URL: str | None = None, volume: str | None = None, dataset_count: str | None = None, sample_count: str | None = None)[source]#
Bases:
BaseModelRepresents an experiment in a specific time slot on a beamline for a proposal.
This class is maintained for legacy purposes because ISPyB relies on it.
- Parameters:
session_id (str) – Unique identifier for the experiment, dependent on the LIMS.
beamline_name (str) – Name of the beamline where the experiment is scheduled.
start_date (str) – Official start date (format: YYYYMMDD).
start_time (str) – Official start time.
end_date (str) – Official end date (format: YYYYMMDD).
end_time (str) – Official end time.
title (str) – Title of the proposal associated with the session.
code (str) – Code associated with the proposal.
number (str) – Proposal number.
proposal_id (str) – Unique identifier of the proposal.
proposal_name (str) – Name of the proposal.
comments (str | None) – Optional comments about the session.
start_datetime (datetime) – Start datetime of the session.
end_datetime (datetime | None) – End datetime of the session
actual_start_date (str) – Start date if the session was rescheduled.
actual_start_time (str) – Start time if the session was rescheduled.
actual_end_date (str) – End date if the session was rescheduled.
actual_end_time (str) – End time if the session was rescheduled.
nb_shifts (str) – Number of shifts allocated to the session (typically 8h)
scheduled (str) – if the session is officially scheduled and approved.
is_rescheduled (bool) – if the session was rescheduled in time or beamline.
is_scheduled_beamline (bool) – if the session is scheduled on the current bm
is_scheduled_time (bool) – if the session is currently active.
user_portal_URL (str | None) – Optional link to the session page in the User Portal.
data_portal_URL (str | None) – link to the data portal or LIMS.
logbook_URL (str | None) – Optional link to the session page in the logbook.
volume (str | None) – Optional volume (in bytes) of data produced.
dataset_count (str | None) – Optional number of datasets collected.
sample_count (str | None) – Optional number of samples collected.
- 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]] = {'actual_end_date': FieldInfo(annotation=str, required=False, default=''), 'actual_end_time': FieldInfo(annotation=str, required=False, default=''), 'actual_start_date': FieldInfo(annotation=str, required=False, default=''), 'actual_start_time': FieldInfo(annotation=str, required=False, default=''), 'beamline_name': FieldInfo(annotation=str, required=False, default=''), 'code': FieldInfo(annotation=str, required=False, default=''), 'comments': FieldInfo(annotation=Union[str, NoneType], required=False, default=''), 'data_portal_URL': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'dataset_count': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'end_date': FieldInfo(annotation=str, required=False, default=''), 'end_datetime': FieldInfo(annotation=Union[datetime, NoneType], required=False, default_factory=<lambda>), 'end_time': FieldInfo(annotation=str, required=False, default=''), 'is_rescheduled': FieldInfo(annotation=bool, required=False, default=False), 'is_scheduled_beamline': FieldInfo(annotation=bool, required=False, default=False), 'is_scheduled_time': FieldInfo(annotation=bool, required=False, default=False), 'logbook_URL': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'nb_shifts': FieldInfo(annotation=str, required=False, default=''), 'number': FieldInfo(annotation=str, required=False, default=''), 'proposal_id': FieldInfo(annotation=str, required=False, default=''), 'proposal_name': FieldInfo(annotation=str, required=False, default=''), 'sample_count': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'scheduled': FieldInfo(annotation=str, required=False, default=''), 'session_id': FieldInfo(annotation=str, required=False, default=''), 'start_date': FieldInfo(annotation=str, required=False, default=''), 'start_datetime': FieldInfo(annotation=datetime, required=False, default_factory=builtin_function_or_method), 'start_time': FieldInfo(annotation=str, required=False, default=''), 'title': FieldInfo(annotation=str, required=False, default=''), 'user_portal_URL': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'volume': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.