mxcubecore.model.lims_session#

Classes

Instrument(*, name, id, instrumentScientists)

Represents a beamline.

Investigation(*, name, startDate, endDate, ...)

Represents an investigation and serves as a proposal to replace the Session class.

Lims(*[, name, description])

Represents a LIMS system.

LimsSessionManager(*[, active_session, ...])

Manages LIMS sessions and connected users.

LimsUser(*[, user_name, sessions])

Represents a user connected to MXCuBE.

Meta(*, page)

Metadata containing pagination details.

MetaPage(*, totalWithoutFilters, total, ...)

Pagination metadata.

Parameter(*, name, value, id, units)

Represents a generic parameter attached to entities like investigations, samples, or datasets.

Proposal(*[, proposal_id, person_id, type, ...])

Proposal with key identifying details.

Resource(*, _id, filename, file, fileType, ...)

Represents a resource, usually a file associated with a sample or

SampleInformation(*, _id, investigationId, ...)

Parameters metadata related to a sample, including a list of associated resources.

SampleSheet(*, id, name, investigation, ...)

Represents a description of a sample sheet as defined in user portals.

Session(*[, session_id, beamline_name, ...])

Represents an experiment in a specific time slot on a beamline for a proposal.

class mxcubecore.model.lims_session.Instrument(*, name: str, id: int, instrumentScientists: List[Any])[source]#

Bases: BaseModel

Represents a beamline.

Parameters:
  • name (str) – Name of the beamline.

  • id (int) – Unique identifier of the beamline.

  • instrumentScientists (List[Any]) – List of scientists associated with the instrument.

class mxcubecore.model.lims_session.Investigation(*, name: str, startDate: datetime, endDate: datetime, id: int, title: str, visitId: str, summary: str, parameters: Dict[str, Any], instrument: Instrument, investigationUsers: List[Any])[source]#

Bases: BaseModel

Represents 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) – 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.

class mxcubecore.model.lims_session.Lims(*, name: str = '', description: str = '')[source]#

Bases: BaseModel

Represents a LIMS system.

Parameters:
  • name (str) – Unique identifier for the LIMS (e.g., “ispyb”, “icat”).

  • description (str) – Free text providing a short description of the LIMS.

class mxcubecore.model.lims_session.LimsSessionManager(*, active_session: Session | None = None, sessions: List[Session] | None = [], users: Dict[str, LimsUser] | None = {})[source]#

Bases: BaseModel

Manages LIMS sessions and connected users.

Parameters:
  • active_session (Session | None) – The current active session, if any.

  • sessions (List[Session] | None) – List of selectable sessions determined based on connected users.

  • users (Dict[str, LimsUser] | None) – Dictionary of currently connected users.

class mxcubecore.model.lims_session.LimsUser(*, user_name: str = '', sessions: List[Session] | None = [])[source]#

Bases: BaseModel

Represents a user connected to MXCuBE.

Parameters:
  • user_name (str) – Identifier for the user, typically their login name.

  • sessions (List[Session] | None) – List of sessions the user is allowed to collect data from.

class mxcubecore.model.lims_session.Meta(*, page: MetaPage)[source]#

Bases: BaseModel

Metadata containing pagination details.

Parameters:

page (MetaPage) – Pagination details.

class mxcubecore.model.lims_session.MetaPage(*, totalWithoutFilters: int, total: int, totalPages: int, currentPage: int)[source]#

Bases: BaseModel

Pagination metadata.

Parameters:
  • totalWithoutFilters (int) – Total count of items without filters applied.

  • total (int) – Total count of items with filters applied.

  • totalPages (int) – Total number of pages available.

  • currentPage (int) – Current page number.

class mxcubecore.model.lims_session.Parameter(*, name: str, value: str, id: int, units: str)[source]#

Bases: BaseModel

Represents a generic parameter attached to entities like investigations, samples, or datasets.

Parameters:
  • name (str) – Name of the parameter.

  • value (str) – Value assigned to the parameter.

  • id (int) – Unique identifier of the parameter.

  • units (str) – Measurement units, if applicable.

class mxcubecore.model.lims_session.Proposal(*, proposal_id: str = '', person_id: str = '', type: str = '', code: str = '', number: str = '', title: str = '')[source]#

Bases: BaseModel

Proposal 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

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) –

class mxcubecore.model.lims_session.SampleInformation(*, _id: str, investigationId: int, sampleId: int, createdAt: datetime, updatedAt: datetime, resources: List[Resource])[source]#

Bases: BaseModel

Parameters 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) –

class mxcubecore.model.lims_session.SampleSheet(*, id: int, name: str, investigation: Investigation, modTime: datetime, parameters: List[Parameter], datasets: List[Any], meta: Meta)[source]#

Bases: BaseModel

Represents 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.

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: BaseModel

Represents 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.